sbrl / Pepperminty-Wiki

A wiki in a box
https://peppermint.mooncarrot.space/
Mozilla Public License 2.0
177 stars 20 forks source link

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

Open kha84 opened 1 year ago

kha84 commented 1 year ago

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:

kha84 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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