Internal server error when new user tries to log in

I’ve setup Nextcloud 18.0.4 with Nginx and succesfully created an admin user and two regular users.
The admin is able to login, but when regular user #1 tries to login (at another device), an error came up.
I don’t understand the logged details, so I hope one of you is willing to help me:

{"reqId":"mVkCLVfkL4SXgkf1PiUg","level":3,"time":"2020-05-11T22:52:47+02:00","remoteAddr":"192.168.2.254","user":"peter","app":"index","method":"POST","url":"/login","message":{"Exception":"RedisException","Message":"Redis server went away","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Memcache/Redis.php","line":103,"function":"setnx","class":"Redis","type":"->"},{"file":"/var/www/nextcloud/lib/private/Lock/MemcacheLockingProvider.php","line":81,"function":"add","class":"OC\\Memcache\\Redis","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Common.php","line":747,"function":"acquireLock","class":"OC\\Lock\\MemcacheLockingProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":593,"function":"acquireLock","class":"OC\\Files\\Storage\\Common","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":332,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1340,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1384,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Root.php","line":200,"function":"getFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":146,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/Root.php","line":383,"function":"nodeExists","class":"OC\\Files\\Node\\Folder","type":"->"},{"function":"getUserFolder","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyRoot.php","line":65,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/lib/private/Files/Node/LazyRoot.php","line":282,"function":"__call","class":"OC\\Files\\Node\\LazyRoot","type":"->"},{"file":"/var/www/nextcloud/lib/private/Server.php","line":1504,"function":"getUserFolder","class":"OC\\Files\\Node\\LazyRoot","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":552,"function":"getUserFolder","class":"OC\\Server","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":414,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php","line":44,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\CompleteLoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php","line":50,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\LoggedInCheckCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/EmailLoginCommand.php","line":58,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\EmailLoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php","line":54,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\UidLoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":57,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\UserDisabledCheckCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php","line":53,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Login/Chain.php","line":108,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->"},{"file":"/var/www/nextcloud/core/Controller/LoginController.php","line":300,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":299,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Memcache/Redis.php","Line":103,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Linux; Android 10; SM-G970F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.44 Mobile Safari/537.36","version":"18.0.4.2"}

Best regards,
Guido

Based on this message I would assume that your Redis server is unreachable and therefore the file locking fails. Make sure that your Redis server is running.

BTW, if you insert a line with three backticks (```) before and after the block of log lines, the formatting will be much better :wink:

I am trying to understand how to configure redis. I’ve installed redis-server and php-redis; In redis.conf some lines are changed:

unixsocket /var/run/redis/redis-server.sock
unixsocketperm 770```

I entered the command
```usermod -a -G redis www-data```

I also asked the computer:

```# systemctl status redis
â—Ź redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor >
     Active: active (running) since Tue 2020-05-12 21:38:32 CEST; 1min 3s ago
       Docs: http://redis.io/documentation,
             man:redis-server(1)
    Process: 814 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=ex>
   Main PID: 883 (redis-server)
      Tasks: 4 (limit: 9316)
     Memory: 4.7M
     CGroup: /system.slice/redis-server.service
             └─883 /usr/bin/redis-server 127.0.0.1:0

May 12 21:38:28 vanharten systemd[1]: Starting Advanced key-value store...
May 12 21:38:32 vanharten systemd[1]: redis-server.service: Can't open PID file>
May 12 21:38:32 vanharten systemd[1]: Started Advanced key-value store.
root@vanharten:/home/guido# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>```

Can you help me what I can do to solve the problem?

Best regards,
Guido

(I am sorry, I used three backticks at the start and ending of the commands, but the layout still is bad)

In the most recent nextcloud.log file I can’t found any error about redis.
{"reqId":"m2ZA36fIi8GStzbxmeOX","level":3,"time":"2020-05-12T22:34:01+02:00","remoteAddr":"192.168.2.254","user":"peter","app":"index","method":"GET","url":"/apps/files/","message":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/files/lib/Controller/ViewController.php","line":139,"function":"getStorageInfo","class":"OC_Helper","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/ViewController.php","line":187,"function":"getStorageInfo","class":"OCA\\Files\\Controller\\ViewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"index","class":"OCA\\Files\\Controller\\ViewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":299,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/legacy/helper.php","Line":490,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36","version":"18.0.4.2"}