Can't log in via browser

Dear Sir or Madam,

Nextcloud had been running smoothly for three months. Then without me actively changing anything, something broke. I don’t know what. The problem I’m facing is: When I log in via browser (I tried different once), I am able to tip in my user name and password and then hit log in. After that I get a page with an error. I tried different users, but I always get the same error. I still can synch via my mobile apps, but like I said, I can’t log in via browser.

1

Nextcloud version: 21.0.3
Operating system and version: Ubuntu 20.04.2 LTS
Apache: 2.4.41
PHP: 7.4.3

in my nextcloud.log in /var/log I find these two lines:

{“reqId”:“S4yfHEFkfkorzHeGrDgP”,“level”:3,“time”:“2021-07-04T19:05:02+02:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"",“url”:"–",“message”:{“Exception”:“Error”,“Message”:“rename(/var/log/nextcloud.log,/var/log/nextcloud.log.1): Permission denied at /var/www/nextcloud/lib/public/Log/RotationTrait.php#52”,“Code”:0,“Trace”:[{“function”:“onError”,“class”:“OC\\Log\ErrorHandler”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/public/Log/RotationTrait.php",“line”:52,“function”:“rename”},{“file”:"/var/www/nextcloud/lib/private/Log/Rotate.php",“line”:46,“function”:“rotate”,“class”:“OC\Log\Rotate”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/BackgroundJob/Job.php",“line”:52,“function”:“run”,“class”:“OC\Log\Rotate”,“type”:"->"},{“file”:"/var/www/nextcloud/cron.php",“line”:128,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:"->"}],“File”:"/var/www/nextcloud/lib/private/Log/ErrorHandler.php",“Line”:92,“CustomMessage”:"–"},“userAgent”:"–",“version”:“21.0.3.1”}

{“reqId”:“S4yfHEFkfkorzHeGrDgP”,“level”:2,“time”:“2021-07-04T19:05:02+02:00”,“remoteAddr”:"",“user”:"–",“app”:“OC\Log\Rotate”,“method”:"",“url”:"–",“message”:“Log file “/var/log/nextcloud.log” was over 104857600 bytes, moved to “/var/log/nextcloud.log.1"”,“userAgent”:”–",“version”:“21.0.3.1”}

It’s a problem of your logfile rotation. Nextcloud wants to rename the current logfile from /var/log/nextcloud.log to /var/log/nextcloud.log.1
The webserver user doesn’t have permission to create such a new file in /var/log. You can try to create such an empty file, then renaming from an existing could work:

touch /var/log/nextcloud.log.1
chown www-data.www-data /var/log/nextcloud.log.1

Thank you for your response!

I typed in your suggested commands. However, I still can’t log in. I get the following error message in the nextcloud.log (I exchanged the IP and the username with ***):

{“reqId”:“fJpuwRggvwYbDTBZzw8S”,“level”:3,“time”:“2021-07-22T22:11:24+02:00”,“remoteAddr”:“217..185.”,“user”:“.”,“app”:“index”,“method”:“GET”,“url”:"/index.php/apps/dashboard/",“message”:{“Exception”:“OCP\Files\GenericFileException”,“Message”:“file_put_contents failed”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php",“line”:109,“function”:“putContent”,“class”:“OC\Files\Node\File”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Template/IconsCacher.php",“line”:146,“function”:“putContent”,“class”:“OC\Files\SimpleFS\SimpleFile”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Template/SCSSCacher.php",“line”:351,“function”:“setIconsCss”,“class”:“OC\Template\IconsCacher”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Template/SCSSCacher.php",“line”:189,“function”:“cache”,“class”:“OC\Template\SCSSCacher”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Template/CSSResourceLocator.php",“line”:111,“function”:“process”,“class”:“OC\Template\SCSSCacher”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Template/CSSResourceLocator.php",“line”:63,“function”:“cacheAndAppendScssIfExist”,“class”:“OC\Template\CSSResourceLocator”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Template/ResourceLocator.php",“line”:79,“function”:“doFind”,“class”:“OC\Template\CSSResourceLocator”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/TemplateLayout.php",“line”:330,“function”:“find”,“class”:“OC\Template\ResourceLocator”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/TemplateLayout.php",“line”:238,“function”:“findStylesheetFiles”,“class”:“OC\TemplateLayout”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_Template.php",“line”:183,“function”:"__construct",“class”:“OC\TemplateLayout”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php",“line”:210,“function”:“fetchPage”,“class”:“OC_Template”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:172,“function”:“render”,“class”:“OCP\AppFramework\Http\TemplateResponse”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“→”},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},

{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/lib/private/Files/Node/File.php",“Line”:73,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”,“version”:“21.0.3.1”}

{“reqId”:“fJpuwRggvwYbDTBZzw8S”,“level”:3,“time”:“2021-07-22T22:11:24+02:00”,“remoteAddr”:“217..185.”,“user”:“.”,“app”:“PHP”,“method”:“GET”,“url”:"/index.php/apps/dashboard/",“message”:{“Exception”:“Error”,“Message”:“file_put_contents(/media/usb/nextcloud/data/appdata_ocmdkw09qk9w/css/icons/icons-vars.css): failed to open stream: Input/output error at /var/www/nextcloud/lib/private/Files/Storage/Local.php#282”,“Code”:0,“Trace”:[{“function”:“onError”,“class”:“OC\Log\ErrorHandler”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/private/Files/Storage/Local.php",“line”:282,“function”:“file_put_contents”},{“file”:"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:259,“function”:“file_put_contents”,“class”:“OC\Files\Storage\Local”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Files/View.php",“line”:1170,“function”:“file_put_contents”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Files/View.php",“line”:707,“function”:“basicOperation”,“class”:“OC\Files\View”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Files/Node/File.php",“line”:72,“function”:“file_put_contents”,“class”:“OC\Files\View”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php",“line”:109,“function”:“putContent”,“class”:“OC\Files\Node\File”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Template/IconsCacher.php",“line”:146,“function”:“putContent”,“class”:“OC\Files\SimpleFS\SimpleFile”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Template/SCSSCacher.php",“line”:351,“function”:“setIconsCss”,“class”:“OC\Template\IconsCacher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Template/SCSSCacher.php",“line”:189,“function”:“cache”,“class”:“OC\Template\SCSSCacher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Template/CSSResourceLocator.php",“line”:111,“function”:“process”,“class”:“OC\Template\SCSSCacher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Template/CSSResourceLocator.php",“line”:63,“function”:“cacheAndAppendScssIfExist”,“class”:“OC\Template\CSSResourceLocator”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Template/ResourceLocator.php",“line”:79,“function”:“doFind”,“class”:“OC\Template\CSSResourceLocator”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/TemplateLayout.php",“line”:330,“function”:“find”,“class”:“OC\Template\ResourceLocator”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/TemplateLayout.php",“line”:238,“function”:“findStylesheetFiles”,“class”:“OC\TemplateLayout”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_Template.php",“line”:183,“function”:"__construct",“class”:“OC\TemplateLayout”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php",“line”:210,“function”:“fetchPage”,“class”:“OC_Template”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:172,“function”:“render”,“class”:“OCP\AppFramework\Http\TemplateResponse”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/base.php",“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/lib/private/Log/ErrorHandler.php",“Line”:92,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”,“version”:“21.0.3.1”}

Does this file exist and are the permissions sufficient?
dashboard/",“message”:{“Exception”:“Error”,“Message”:“file_put_contents(/media/usb/nextcloud/data/appdata_ocmdkw09qk9w/css/icons/icons-vars.css): failed to open stream: Input/output error

The occ command from command line works or does it throw errors as well?

Well, the file has these permissions and ownership:
-rwxrwx— 1 www-data www-data 112867 Jul 23 11:51 icons-vars.css
Seems normal, right?

I tried various occ commands. They seem to work normally. I tried for example:
sudo -u www-data php occ app:list
It gave me a list of enabled and disabled apps.

Is there noone here that can help me? :frowning_face: