pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
2.82k stars 76 forks source link

Error : "Request faild with status code 500" on opening 'folders' on memories mobile #1152

Closed Lumberj4cked closed 3 weeks ago

Lumberj4cked commented 3 weeks ago

-->

_Describe the bug A clear and concise description of what the bug is._ when I try to load the 'Folders' page on 'Explore' tab it sometimes loads but mostly shows error 'Request failed with status code 500', this didn't used to happen, I updated nextcloud and memories yesterday, enabled HW transcoding and set --log_bin_trust_function_creators=true on my docker compose for MariaDB, I also missed the 'places' on top of my 'explore' tab on mobile so I tried to recreate the places db and had some issues with that. doing occ memories:places-setup via docker exec -u 33 -t nextcloud php occ memories:places-setup kept freezing, doing it first via docker exec -u 33 -it nextcloud bash and then do php occ memories:places-setup did work and I still did not see the places on mobile but they did show up on PC so I called it a day. After this, nextcloud and memories all day. but since halfway today I get that error, in the nextcloud logs it shows the error:

Exception Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused Exception thrown: Doctrine\DBAL\Exception

I can connect to my database without issues, and sometimes it works to load the folders page but most of the time I get this error

_To Reproduce Steps to reproduce the behavior:_ I try to open the folders page but it shows me the error, it works better on PC/Web than on mobile but it still keeps happening, I don't know what is causing it sadly

Screenshots Screenshot_20240420_191944_Memories

Screenshot 2024-04-20 193120

Platform:

Additional context I restarted the nextcloud instance, the database instance, i dont use redis. I can connect to the DB without issues, nextcloud is not in maintenance, i use docker for my Nextcloud and DB instances.

and

{"reqId":"BgjYRXIPOjjTJreOthEj","level":3,"time":"2024-04-20T17:43:24+00:00","remoteAddr":"x.xxx.xxx.xxredacted for privacy","user":"--","app":"index","method":"GET","url":"/apps/memories/api/days","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0","version":"28.0.4.1","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","Code":2002,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->","args":[]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT * FROMoc_appconfig",[],[],null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT * FROMoc_appconfig",[],[],null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppConfig.php","line":421,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppConfig.php","line":187,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppConfig.php","line":377,"function":"getApps","class":"OC\\AppConfig","type":"->","args":[]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":128,"function":"getValues","class":"OC\\AppConfig","type":"->","args":[false,"enabled"]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":149,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":231,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":700,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":[]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/index.php","line":37,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/DB/Connection.php","Line":139,"message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","exception":[],"CustomMessage":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused"},"id":"6623ffd037965"}

and

{"reqId":"BgjYRXIPOjjTJreOthEj","level":3,"time":"2024-04-20T17:43:24+00:00","remoteAddr":"x.xxx.xxx.xxredacted for privacy","user":"--","app":"index","method":"GET","url":"/apps/memories/api/days","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0","version":"28.0.4.1","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","Code":2002,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->","args":[]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT * FROMoc_appconfig",[],[],null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":337,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT * FROMoc_appconfig",[],[],null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppConfig.php","line":421,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppConfig.php","line":187,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppConfig.php","line":377,"function":"getApps","class":"OC\\AppConfig","type":"->","args":[]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":128,"function":"getValues","class":"OC\\AppConfig","type":"->","args":[false,"enabled"]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":149,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":231,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":700,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":[]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/index.php","line":37,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/DB/Connection.php","Line":139,"message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","exception":[],"CustomMessage":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused"},"id":"6623ffd037965"}

pulsejet commented 3 weeks ago

Can you try restarting the server?

Lumberj4cked commented 3 weeks ago

I stopped the docker containers, restarted the host and started the containers again, sadly still get the same errors

pulsejet commented 3 weeks ago

Hmm these errors don't seem to be coming from memories definitely. It's even weirder that you'd get them only on mobile; mobile and desktop are running exactly the same thing.

Lumberj4cked commented 3 weeks ago

I get them on desktop too, only on other pages, like places and map and explore, not on folders (only sometimes)

I also don't think it's coming from memories but it is the only app that is affected, nextcloud itself doesn't give me any errors, so I was hoping you had some idea where it came from and if I screwed something up or if there was something I could check out.

pulsejet commented 3 weeks ago

I see some missing class error in the screenshot. Maybe you're missing some modules. How did you install nextcloud?

See https://github.com/nextcloud/server/issues/5043

Lumberj4cked commented 3 weeks ago

I installed it from docker, with the official docker image (not the AIO one from nextcloud) I used to run it on another server but recently migrated it to a new vm, but it did work for about a day or two before it started with these errors so I'm not sure if that gave some problems. I did upgrade from nextcloud version 28.0.3 at the same time

pulsejet commented 3 weeks ago

None of these stand out. Something is causing the DB to refuse the connection, maybe something is logged on the DB side, or some max connection settings. Not sure.

Lumberj4cked commented 3 weeks ago

I will check that out, thank you! I'll do that later seeing as I'm not home at this moment

Lumberj4cked commented 3 weeks ago

I updated the mariadb container to a newer version and now it seems to be working stable again, I got the places back on mobile and the connection doesn't go away anymore

Seems that it was a DB issue like you said, thanks for the help! Closing the issue now