Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few small issues with a fresh install (v0.24) #241

Open
kha84 opened this issue Feb 23, 2023 · 3 comments
Open

Few small issues with a fresh install (v0.24) #241

kha84 opened this issue Feb 23, 2023 · 3 comments

Comments

@kha84
Copy link

kha84 commented Feb 23, 2023

Upon the initial installation, the installer doesn't check if sqlite3 PHP module is installed, even though right now there's a hard requirement for it. This results in a wiki instance being created without creating so much needed sqlite3 database.
It looks functional, unless you attempt to create a new page and save it (preview works fine, btw). But upon saving you start getting HTTP 500.

In apache2 error.log you see this and this is when you realize that you missed to install sqlite3:

[Thu Feb 23 11:50:37.099138 2023] [php:error] [pid 13591] [client ::1:51074] PHP Fatal error:  Uncaught PDOException: could not find driver in /var/www/html/pmwiki/index.php:10474
Stack trace:
#0 /var/www/html/pmwiki/index.php(10474): PDO->__construct()
#1 /var/www/html/pmwiki/index.php(9792): StorageBox->__construct()
#2 /var/www/html/pmwiki/index.php(11565): search::invindex_load()
#3 /var/www/html/pmwiki/index.php(11305): {closure}()
#4 /var/www/html/pmwiki/index.php(14941): {closure}()
#5 {main}
  thrown in /var/www/html/pmwiki/index.php on line 10474, referer: http://localhost/pmwiki/index.php?action=preview-edit&page=Main%20Page

But just installing it doesn't help. You still see these errors upon saving a page:

[Thu Feb 23 12:00:01.095668 2023] [php:error] [pid 14461] [client ::1:57610] PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such table: store in /var/www/html/pmwiki/index.php:10489
Stack trace:
#0 /var/www/html/pmwiki/index.php(10489): PDO->prepare()
#1 /var/www/html/pmwiki/index.php(10504): StorageBox->query()
#2 /var/www/html/pmwiki/index.php(9818): StorageBox->has()
#3 /var/www/html/pmwiki/index.php(11567): search::invindex_merge()
#4 /var/www/html/pmwiki/index.php(11305): {closure}()
#5 /var/www/html/pmwiki/index.php(14941): {closure}()
#6 {main}  thrown in /var/www/html/pmwiki/index.php on line 10489, referer: http://localhost/pmwiki/index.php?action=preview-edit&page=Main%20Page

My guess this happens because the database is only created during the initial install / wiki instance creation.

I'm not familiar with PepermintWiki architecture so I cannot suggest how strong is the requirement for sqlite3 - it's up to you guys to make a decision. The proposed solution here could be:

  • if the requirement for sqlite3 is mandatory, then don't allow user to progress with the installation, until you make sure sqlite3 php module is there and fully functioning
  • If there's no strong requirement for sqlite3 and wiki instance can successfully running without it, then to introduce a proper exception handling. So if it turns out that the sqlite database is not there but the sqlite3 PHP module is available then to create the database silently with all the needed tables and backfill them. If PHP module is not available, then allow user to save pages without doing any calls to PDO.
@kha84
Copy link
Author

kha84 commented Feb 23, 2023

Sorry, I started with a problem but totally forget my manners. I really appreciate this project - it has a unique combination of everything I ever wanted from wiki engines: a simplicity, file based storage and a native support of Markdown syntax. It's just a perfect match for my use case.

@kha84
Copy link
Author

kha84 commented Feb 23, 2023

Also when you hit More -> Statistics -> Untagged pages you get 500:

[Thu Feb 23 12:43:27.537911 2023] [php:warn] [pid 14460] [client ::1:43668] PHP Warning:  Undefined property: stdClass::$untagged-pages in /var/www/html/pmwiki/index.php on line 7182, referer: http://localhost/pmwiki/index.php?action=stats
[Thu Feb 23 12:43:27.537987 2023] [php:warn] [pid 14460] [client ::1:43668] PHP Warning:  Attempt to read property "value" on null in /var/www/html/pmwiki/index.php on line 7182, referer: http://localhost/pmwiki/index.php?action=stats
[Thu Feb 23 12:43:27.538035 2023] [php:error] [pid 14460] [client ::1:43668] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/html/pmwiki/index.php:7182
Stack trace:
#0 /var/www/html/pmwiki/index.php(14941): {closure}()
#1 {main}
  thrown in /var/www/html/pmwiki/index.php on line 7182, referer: http://localhost/pmwiki/index.php?action=stats

And similar thing for More -> Statistics -> Orphan pages:

[Thu Feb 23 12:43:52.994531 2023] [php:warn] [pid 14541] [client ::1:35736] PHP Warning:  Undefined property: stdClass::$orphan-pages in /var/www/html/pmwiki/index.php on line 7182, referer: http://localhost/pmwiki/index.php?action=stats
[Thu Feb 23 12:43:52.994568 2023] [php:warn] [pid 14541] [client ::1:35736] PHP Warning:  Attempt to read property "value" on null in /var/www/html/pmwiki/index.php on line 7182, referer: http://localhost/pmwiki/index.php?action=stats
[Thu Feb 23 12:43:52.994587 2023] [php:error] [pid 14541] [client ::1:35736] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/html/pmwiki/index.php:7182
Stack trace:
#0 /var/www/html/pmwiki/index.php(14941): {closure}()
#1 {main}
  thrown in /var/www/html/pmwiki/index.php on line 7182, referer: http://localhost/pmwiki/index.php?action=stats

@kha84
Copy link
Author

kha84 commented Feb 23, 2023

One more thing, when I hit the "/index.php?action=user-preferences" I can see an extra } character being added to my email, and then when I try to save it I get this error in error.log:

[Thu Feb 23 12:50:05.233058 2023] [php:error] [pid 14457] [client ::1:55970] PHP Fatal error:  Uncaught Error: Call to undefined function email_verify_addresses() in /var/www/html/pmwiki/index.php:8566
Stack trace:
#0 /var/www/html/pmwiki/index.php(14941): {closure}()
#1 {main}
  thrown in /var/www/html/pmwiki/index.php on line 8566, referer: http://localhost/pmwiki/index.php?action=user-preferences

@kha84 kha84 changed the title Small issue with a fresh install (v0.24) Few small issues with a fresh install (v0.24) Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant