YunoHost-Apps / nextcloud_ynh

Nextcloud package for YunoHost
https://nextcloud.com/
GNU Affero General Public License v3.0
147 stars 62 forks source link

After restore: Internal Server Error - can't access web dashboard or files #716

Closed CodeShakingSheep closed 1 week ago

CodeShakingSheep commented 1 month ago

Describe the bug

I had to restore my Nextcloud installation to version 29.0.2~ynh1.

Context

Steps to reproduce

  1. Hit the restore button in webadmin
  2. Ran into a yunohost-api timeout because of endless data dir chowning. Anyway, the restore continued to run afterwards and seemed to be finished successfully, although it ran for more than 8(!) hours (same issue as https://github.com/YunoHost-Apps/nextcloud_ynh/issues/715).
  3. Access Nextcloud dashboard
  4. See this message
    
    Internal Server Error

The server encountered an internal error and was unable to complete your request. Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report. More details can be found in the server log.


### Expected behavior

Restore should be faster and after restore Nextcloud dashboard should be accessible.

### Logs

From `var/logs/nextcloud/nextcloud.log`

"reqId":"BFcCeSX20F5dIgtNC3KM","level":3,"time":"2024-07-31T02:41:47+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"ldap_search(): Search: Can't contact LDAP server at /var/www/nextcloud/apps/user_ldap/> {"reqId":"9UAtwOhfJWsFKUshYXCr","level":2,"time":"2024-07-31T02:50:03+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OCA\Files\BackgroundJob\Sca> {"reqId":"fnGIzqFNilJV285QJ4zN","level":3,"time":"2024-08-11T07:07:37+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/apps/theming/theme/default.css?plain=1&v=b6589fc6","message"> {"reqId":"UJzN4nh3n4BHXUjJ717D","level":3,"time":"2024-08-11T07:07:51+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"UJzN4nh3n4BHXUjJ717D","level":3,"time":"2024-08-11T07:07:51+00:00","remoteAddr":"","user":"","app":"index","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFil> {"reqId":"UJzN4nh3n4BHXUjJ717D","level":3,"time":"2024-08-11T07:07:51+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"UJzN4nh3n4BHXUjJ717D","level":3,"time":"2024-08-11T07:07:51+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"UJzN4nh3n4BHXUjJ717D","level":3,"time":"2024-08-11T07:07:51+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"CWthl7TlL7BUbDroqM2G","level":3,"time":"2024-08-11T07:08:33+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"CWthl7TlL7BUbDroqM2G","level":3,"time":"2024-08-11T07:08:33+00:00","remoteAddr":"","user":"","app":"index","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFil> {"reqId":"CWthl7TlL7BUbDroqM2G","level":3,"time":"2024-08-11T07:08:33+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"CWthl7TlL7BUbDroqM2G","level":3,"time":"2024-08-11T07:08:33+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"CWthl7TlL7BUbDroqM2G","level":3,"time":"2024-08-11T07:08:33+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"7oIfXWrZyAObgzkhbckf","level":2,"time":"2024-08-11T07:11:11+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OCA\Files\BackgroundJob\Sca> {"reqId":"UJtUA3IwU573Dsl7zk1C","level":3,"time":"2024-08-11T07:11:57+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"UJtUA3IwU573Dsl7zk1C","level":3,"time":"2024-08-11T07:11:57+00:00","remoteAddr":"","user":"","app":"index","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFil> {"reqId":"UJtUA3IwU573Dsl7zk1C","level":3,"time":"2024-08-11T07:11:57+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"UJtUA3IwU573Dsl7zk1C","level":3,"time":"2024-08-11T07:11:57+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"UJtUA3IwU573Dsl7zk1C","level":3,"time":"2024-08-11T07:11:57+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"Jh04DQYo8meyt5TN5lsk","level":3,"time":"2024-08-11T07:28:05+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/files/","message":"file_get_contents(/home/yunohost.app/nextcloud> {"reqId":"Jh04DQYo8meyt5TN5lsk","level":3,"time":"2024-08-11T07:28:05+00:00","remoteAddr":"","user":"","app":"index","method":"GET","url":"/nextcloud/apps/files/","message":"Exception thrown: OCP\Files\GenericFileExc> {"reqId":"Jh04DQYo8meyt5TN5lsk","level":3,"time":"2024-08-11T07:28:05+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/files/","message":"file_get_contents(/home/yunohost.app/nextcloud> {"reqId":"Jh04DQYo8meyt5TN5lsk","level":3,"time":"2024-08-11T07:28:05+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/files/","message":"Exception thrown: OCP\Files\GenericFileExce> {"reqId":"Jh04DQYo8meyt5TN5lsk","level":3,"time":"2024-08-11T07:28:05+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/files/","message":"Exception thrown: OCP\Files\GenericFileExce> {"reqId":"Fm9OcksLHUC6eLSPiBui","level":3,"time":"2024-08-11T07:28:11+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"Fm9OcksLHUC6eLSPiBui","level":3,"time":"2024-08-11T07:28:11+00:00","remoteAddr":"","user":"","app":"index","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFil> {"reqId":"Fm9OcksLHUC6eLSPiBui","level":3,"time":"2024-08-11T07:28:11+00:00","remoteAddr":"","user":"","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextc> {"reqId":"Fm9OcksLHUC6eLSPiBui","level":3,"time":"2024-08-11T07:28:11+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile> {"reqId":"Fm9OcksLHUC6eLSPiBui","level":3,"time":"2024-08-11T07:28:11+00:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\Files\GenericFile>


From `var/logs/nginx/<REDACTED_DOMAIN>-error.log`

2024/08/11 06:26:41 [error] 1205198#1205198: 276688 open() "/usr/share/nginx/html/nextcloud/index.php/apps/files/preview-service-worker.js" failed (2: No such file or directory), client: , server: > 2024/08/11 06:27:10 [error] 1205198#1205198: 276688 open() "/usr/share/nginx/html/nextcloud/index.php/apps/files/preview-service-worker.js" failed (2: No such file or directory), client: , server: > 2024/08/11 06:27:25 [error] 1205198#1205198: 276688 open() "/usr/share/nginx/html/nextcloud/index.php/apps/files/preview-service-worker.js" failed (2: No such file or directory), client: , server: > 2024/08/11 06:27:54 [error] 1205198#1205198: 276688 open() "/usr/share/nginx/html/nextcloud/index.php/apps/files/preview-service-worker.js" failed (2: No such file or directory), client: , server: >

rodinux commented 3 weeks ago

Hello, is it possible to see your logs shared below var/logs/nextcloud/nextcloud.log without truncate the end of the lines ?

CodeShakingSheep commented 3 weeks ago

Yes, here it is.

{"reqId":"3rSPbOPP5zV7g2tytOUo","level":3,"time":"2024-08-14T03:11:45+00:00","remoteAddr":"<REDACTED_IP>","user":"<REDACTED_USER>","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextcloud/data/appdata_octwrvilhy9y/js/core/merged-template-prepend.js.deps): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#331","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"29.0.2.2","data":{"app":"PHP"}}
{"reqId":"3rSPbOPP5zV7g2tytOUo","level":3,"time":"2024-08-14T03:11:45+00:00","remoteAddr":"<REDACTED_IP>","user":"<REDACTED_USER>","app":"index","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"29.0.2.2","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php","line":74,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSCombiner.php","line":118,"function":"getContent","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSCombiner.php","line":93,"function":"isCached","class":"OC\\Template\\JSCombiner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":132,"function":"process","class":"OC\\Template\\JSCombiner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":91,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/ResourceLocator.php","line":73,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":401,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":246,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php","line":211,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":183,"function":"render","class":"OCP\\AppFramework\\Http\\TemplateResponse","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/File.php","Line":56,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}}
{"reqId":"3rSPbOPP5zV7g2tytOUo","level":3,"time":"2024-08-14T03:11:45+00:00","remoteAddr":"<REDACTED_IP>","user":"<REDACTED_USER>","app":"PHP","method":"GET","url":"/nextcloud/apps/dashboard/","message":"file_get_contents(/home/yunohost.app/nextcloud/data/appdata_octwrvilhy9y/js/core/merged-template-prepend.js.deps): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#331","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"29.0.2.2","data":{"app":"PHP"}}
{"reqId":"3rSPbOPP5zV7g2tytOUo","level":3,"time":"2024-08-14T03:11:45+00:00","remoteAddr":"<REDACTED_IP>","user":"<REDACTED_USER>","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"29.0.2.2","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php","line":74,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSCombiner.php","line":118,"function":"getContent","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSCombiner.php","line":93,"function":"isCached","class":"OC\\Template\\JSCombiner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":132,"function":"process","class":"OC\\Template\\JSCombiner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":91,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/ResourceLocator.php","line":73,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":401,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":246,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php","line":211,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":183,"function":"render","class":"OCP\\AppFramework\\Http\\TemplateResponse","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/File.php","Line":56,"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}}
{"reqId":"3rSPbOPP5zV7g2tytOUo","level":3,"time":"2024-08-14T03:11:45+00:00","remoteAddr":"<REDACTED_IP>","user":"<REDACTED_USER>","app":"core","method":"GET","url":"/nextcloud/apps/dashboard/","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"29.0.2.2","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php","line":74,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSCombiner.php","line":118,"function":"getContent","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSCombiner.php","line":93,"function":"isCached","class":"OC\\Template\\JSCombiner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":132,"function":"process","class":"OC\\Template\\JSCombiner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php","line":91,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/ResourceLocator.php","line":73,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":401,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->"},{"file":"/var/www/nextcloud/lib/private/TemplateLayout.php","line":246,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":145,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":320,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/index.php","line":114,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/File.php","Line":56,"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}}
rodinux commented 3 weeks ago

Well, sorry I mean the others logs from nextcloud.log

CodeShakingSheep commented 3 weeks ago

Well, sorry I mean the others logs from nextcloud.log

That is the output from nextcloud.log. I shortened it to 5 lines as the errors repeat.

CodeShakingSheep commented 1 week ago

This just resolved itself by upgrading to the latest version 29.0.5~ynh1.