fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.36k stars 343 forks source link

PDOStatement: Specified key was too long #1292

Closed dbozec closed 2 years ago

dbozec commented 2 years ago

Hi,

I just tried to upgrade my selfoss from 2.14 to 2.18, but now when opening the page in my browser I get the message "Load list error: error Internal Server Error" and there is no data displayed.

in data/logs/default.log I got the following line :

[2021-12-12 09:40:13] selfoss.ERROR: PDOStatement: Specified key was too long; max key length is 1000 bytes  

Seems related to database issue, but I can't find a way to solve it.

Does anyone have a clue for me ?

jtojnar commented 2 years ago

Hi,

that is weird, I do not think we set any long indexes.

Can you please change 0 on this line to 1:

https://github.com/fossar/selfoss/blob/2.18/common.php#L16

and set logger_level=DEBUG in your config.ini?

That should hopefully show you some more info.

Also what version of MySQL are you running?

dbozec commented 2 years ago

Made the changes, makes no difference in the web browser, and not a lot more in data/logs/default.log :

[2021-12-12 10:16:33] selfoss.DEBUG: set cookie on ***.fr/ expiring in 2592000 seconds  
[2021-12-12 10:16:33] selfoss.DEBUG: logged in using valid session  
[2021-12-12 10:16:33] selfoss.DEBUG: Establish database connection  
[2021-12-12 10:16:33] selfoss.ERROR: PDOStatement: Specified key was too long; max key length is 1000 bytes
$ mysql -V
mysql  Ver 14.14 Distrib 5.5.62, for debian-linux-gnu (i686) using readline 6.3
jtojnar commented 2 years ago

Weird. If you could try the latest build, it should provide more detailed logging.

Also in that version, there is no need to change common.php, only specify debug=1 in config.ini (in addition to logger_level=DEBUG).

dbozec commented 2 years ago

Downloaded selfoss-2.19-fd8f195, at first I only had a blank page showing nothing.

I then saw this in my apache error logs :

[Sun Dec 12 10:48:03.118877 2021] [:error] [pid 14296] [client 192.168.1.20:56336] PHP Parse error:  syntax error, unexpected '.', expecting ',' or ';' in /srv/***.fr/src/constants.php on line 3

Changing the considered '.' by a ',' I now have a blank page showing only this message : The PHP dependencies are missing. Did you run `composer install` in the selfoss directory? and the following error in apache logs

[Sun Dec 12 10:49:46.052635 2021] [:error] [pid 14565] [client 192.168.1.20:56380] PHP Parse error:  syntax error, unexpected ''/..'' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) in /srv/***.fr/src/constants.php on line 3
jtojnar commented 2 years ago

That looks like you have PHP older than 5.6. The latest version of selfoss requires 5.6 at minimum and changing the code to comma will just break finding the dependencies.

Maybe the issue with the database is also that MySQL is too old – for me it prints mysql Ver 15.1 Distrib 10.6.5-MariaDB, for Linux (x86_64) using readline 5.1 but I am not sure what the minimal version is since the versioning got super confusing when MySQL got forked into MariaDB.

dbozec commented 2 years ago

Indeed, my PHP is 5.5.9 I knew I had to clean and upgrade my server for a while, it seems that the time has come to do something more than just upgrading some things here and there. I'll take the time to do so, hoping all will be better.

Thank you for your help.