"Internal Server Error" after upgrade to 15.0

Hello,

I’ve upgraded Nextcloud from 12.0.X over 13.0, 14.0 to 15.0. After logging in and selecting the calendar the following error message will be shown:

Internal Server Error

The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.

Technical details

  • Remote Address: 172.18.0.6
  • Request ID: aM8Vl3yz41ZQHV2TWyvz

I’m running Nextcloud in docker containers with the latest images.

You need to check the webserver logs to find out what went wrong.

I think I have the same / a similar problem.
After updating with the web based updater, everything seems to be normal. I could browse my files and all was ok. After logging out, I can’t access my nextcloud anymore. It always says “Internal Server Error”.
Here is what’s in my nextcloud.log:

{"reqId":"XBvCdCjtO2f-1KkNhgffHAAAAAc","level":3,"time":"2018-12-20T16:25:24+00:00","remoteAddr":"93.217.252.114","user":"--","app":"core","method":"GET","url":"\/index.php\/login","message":{"Exception":"RuntimeException","Message":"File entry could not be inserted but could also not be selected with getId() in order to perform an update. Please try again.","Code":0,"Trace":[{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Cache\/Cache.php","line":232,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->","args":["appdata_ocadd7405d0b\/js",{"mimetype":"httpd\/unix-directory","mtime":1495637493,"size":-1,"etag":"5c1bc274c9a75","storage_mtime":1495637493,"permissions":31,"parent":0,"checksum":"","path":"appdata_ocadd7405d0b\/js","name":"js"}]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Cache\/Scanner.php","line":292,"function":"put","class":"OC\\Files\\Cache\\Cache","type":"->","args":["appdata_ocadd7405d0b\/js",{"mimetype":"httpd\/unix-directory","mtime":1495637493,"size":-1,"etag":"5c1bc274c9a75","storage_mtime":1495637493,"permissions":31,"parent":0,"checksum":""}]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Cache\/Scanner.php","line":221,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["appdata_ocadd7405d0b\/js",{"mimetype":"httpd\/unix-directory","mtime":1495637493,"size":-1,"etag":"5c1bc274c9a75","storage_mtime":1495637493,"permissions":31,"parent":0,"checksum":""},-1]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Cache\/Scanner.php","line":336,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["appdata_ocadd7405d0b\/js",3,0,false,true]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/View.php","line":1324,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["appdata_ocadd7405d0b\/js",false]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/View.php","line":1368,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->","args":[{"cache":{"__class__":"OC\\Files\\Cache\\Cache"},"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"appdata_ocadd7405d0b\/js","\/appdata_ocadd7405d0b\/js"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Node\/Root.php","line":198,"function":"getFileInfo","class":"OC\\Files\\View","type":"->","args":["\/appdata_ocadd7405d0b\/js"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Node\/Folder.php","line":133,"function":"get","class":"OC\\Files\\Node\\Root","type":"->","args":["\/appdata_ocadd7405d0b\/js"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/AppData\/AppData.php","line":91,"function":"get","class":"OC\\Files\\Node\\Folder","type":"->","args":["js"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/AppData\/AppData.php","line":107,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Template\/JSCombiner.php","line":94,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["core"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Template\/JSResourceLocator.php","line":114,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud","core\/js\/merged-template-prepend.json","core"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Template\/JSResourceLocator.php","line":70,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->","args":["\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud","core\/js\/merged-template-prepend.json"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Template\/ResourceLocator.php","line":78,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->","args":["js\/merged-template-prepend"]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/TemplateLayout.php","line":315,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->","args":[["vendor\/core","js\/merged-template-prepend","search\/js\/search","core\/l10n\/de_DE","core\/js\/merged-share-backend","firstrunwizard\/l10n\/de_DE","firstrunwizard\/js\/jquery.colorbox","firstrunwizard\/js\/firstrunwizard","files_pdfviewer\/l10n\/en","files_pdfviewer\/js\/previewplugin","files_videoplayer\/l10n\/en","files_videoplayer\/js\/viewer","gallery\/l10n\/de_DE","search\/l10n\/de_DE","search\/js\/searchprovider","js\/jquery-ui-fixes","js\/files\/fileinfo","js\/files\/client","js\/contactsmenu","js\/contactsmenu_templates"]]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/TemplateLayout.php","line":154,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::","args":[["vendor\/core","js\/merged-template-prepend","search\/js\/search","core\/l10n\/de_DE","core\/js\/merged-share-backend","firstrunwizard\/l10n\/de_DE","firstrunwizard\/js\/jquery.colorbox","firstrunwizard\/js\/firstrunwizard","files_pdfviewer\/l10n\/en","files_pdfviewer\/js\/previewplugin","files_videoplayer\/l10n\/en","files_videoplayer\/js\/viewer","gallery\/l10n\/de_DE","search\/l10n\/de_DE","search\/js\/searchprovider","js\/jquery-ui-fixes","js\/files\/fileinfo","js\/files\/client","js\/contactsmenu","js\/contactsmenu_templates"]]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/legacy\/template.php","line":211,"function":"__construct","class":"OC\\TemplateLayout","type":"->","args":["error",""]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Template\/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/legacy\/template.php","line":360,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/index.php","line":69,"function":"printExceptionErrorPage","class":"OC_Template","type":"::","args":[{"__class__":"RuntimeException"},500]}],"File":"\/www\/htdocs\/w0069a6f\/maincloud\/nextcloud\/lib\/private\/Files\/Cache\/Cache.php","Line":297,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/71.0.3578.98 Safari\/537.36","version":"15.0.0.10"}

Any ideas…?

/edit: It seems that my desktop app can still access my instance… when i start the app, it get’s synced and shows a green checkmark.

I’ve checked the logs, but can’t see anything about the problem. Is there a way to get more information in the logs?

The following lines are from the log of the docker service app-nextcloud:
app-nextcloud_1 | 172.18.0.4 - 20/Dec/2018:19:50:09 +0100 “GET /index.php” 500
app-nextcloud_1 | 172.18.0.4 - 20/Dec/2018:19:50:10 +0100 “GET /index.php” 302
app-nextcloud_1 | 172.18.0.4 - 20/Dec/2018:19:50:10 +0100 “GET /ocs/v2.php” 200
app-nextcloud_1 | 172.18.0.4 - 20/Dec/2018:19:50:10 +0100 “GET /index.php” 302
app-nextcloud_1 | 172.18.0.4 - 20/Dec/2018:19:50:10 +0100 “GET /index.php” 200

And here are the lines from the log of the docker service web-nextcloud:
web-nextcloud_1 | 172.18.0.6 - - [20/Dec/2018:19:50:10 +0100] “GET /index.php/apps/calendar/ HTTP/1.1” 500 7761 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0”
web-nextcloud_1 | 172.18.0.6 - - [20/Dec/2018:19:50:10 +0100] “GET /index.php/apps/calendar/undefined/img/notifications.svg HTTP/1.1” 302 5 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0”
web-nextcloud_1 | 172.18.0.6 - - [20/Dec/2018:19:50:10 +0100] “GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1” 200 74 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0”
web-nextcloud_1 | 172.18.0.6 - - [20/Dec/2018:19:50:10 +0100] “GET /index.php/apps/calendar/undefined/img/notifications.svg HTTP/1.1” 302 5 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0”
web-nextcloud_1 | 172.18.0.6 - - [20/Dec/2018:19:50:11 +0100] “GET /index.php/apps/files/ HTTP/1.1” 200 49377 “-” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0”

The database service doesn’t output any lines during clicking on the calendar.

I’m still able to access the calendar via Thunderbird and KOrganizer.

I think, that I’ve found the solution! The calendar app is working again!

With the help of the command “sudo -u www-data php occ log:file” I’ve found the logfile of nextcloud. In this logfile were lines like the following, after accessing the calendar:

{“reqId”:“AgVgdA2Nu7g6EQkVLCt7”,“level”:3,“time”:“2018-12-20T20:46:58+00:00”,“remoteAddr”:“172.18.0.6”,“user”:“kadmin”,“app”:“PHP”,“method”:“GET”,“url”:"/index.php/apps/calendar/",“message”:“touch(): Unable to create file /var/www/html/data/appdata_oc4zv45umx60/css/calendar/029b-bc3d-app.min.css because No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#206”,“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0”,“version”:“15.0.0.10”}

In the path /var/www/html/data/appdata_oc4zv45umx60/css/calendar/ the subdirectory calendar was missing. After creating it as user www-data, the “Internal server error” was gone.

Is this subdirectory new in version 15.0 (or maybe 14.0)?

I’ve no idea, what is going wrong in your case. But it maybe, that the following documents helps to fix your problem. These docs were very helpfull for me.
I had to run also the command mysql_upgrade to fix some problems in the mysql database of my nextcloud installation after upgrading.

https://docs.nextcloud.com/server/15/admin_manual/maintenance/upgrade.html
https://docs.nextcloud.com/server/15/admin_manual/configuration_server/occ_command.html

This post was very helpful in addressing my own upgrade issues. It was not only the “calendar” subdirectory that was missing for me; there were several subdirectories I had to create manually.

First within the “js” subdirectory:
…/data/appdata_/js/comments
…/data/appdata_
/js/files
…/data/appdata_/js/files_sharing
…/data/appdata_
/js/files_texteditor
…/data/appdata_*/js/files_versions

and also within the “css” subdirectory:
…/data/appdata_/css/calendar
…/data/appdata_
/css/comments
…/data/appdata_/css/contacts
…/data/appdata_
/css/files
…/data/appdata_*/css/files_sharing

I continued to check nextcloud.log for missing subdirectories until I stopped getting the Internal Server Error.