Internal Server Error on New Install. Please help!

I followed Carsten’s guide and all steps were completed without errors. Then I navigate to my nextcloud via the web browser and get this on the page. Please help! Thank you.

RaspberryPi 3
Stretch 9
Nginx
MariahDB
Php 7.3

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: 192.168.1.1
  • Request ID: d1UGpHCLY1P6o43PeK7f

From the nextcloud log below. It appears to be a Redis Exception, but I have no idea how to fix this.

{“reqId”:“J4mbju1SGGpxBdUqlmAj”,“level”:3,“time”:“2019-03-03T20:41:42+01:00”,“remoteAddr”:“192.168.1.1”,“user”:"–",“app”:“index”,“method”:“GET”,“url”:"/login",“message”:{“Exception”:“RedisException”,“Message”:“No such file or directory”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/lib/private/RedisFactory.php",“line”:84,“function”:“connect”,“class”:“Redis”,“type”:"->",“args”:["/var/run/redis/redis.sock",0,0]},{“file”:"/var/www/nextcloud/lib/private/RedisFactory.php",“line”:100,“function”:“create”,“class”:“OC\RedisFactory”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/Memcache/Redis.php",“line”:42,“function”:“getInstance”,“class”:“OC\RedisFactory”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/Memcache/Factory.php",“line”:136,“function”:"__construct",“class”:“OC\Memcache\Redis”,“type”:"->",“args”:[“5583cf631c5292752b8bd9c607c3dfa6/lock”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:861,“function”:“createLocking”,“class”:“OC\Memcache\Factory”,“type”:"->",“args”:[“lock”]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:["*** sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:117,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OCP\Lock\ILockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:132,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCP\Lock\ILockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:165,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OCP\Lock\ILockingProvider”]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:114,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:117,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“LockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:132,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“LockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:1804,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“LockingProvider”]},{“file”:"/var/www/nextcloud/lib/private/Files/View.php",“line”:115,“function”:“getLockingProvider”,“class”:“OC\Server”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:655,“function”:"__construct",“class”:“OC\Files\View”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:117,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OCP\Http\Client\IClientService”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:132,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCP\Http\Client\IClientService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:68,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OCP\Http\Client\IClientService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:98,“function”:“buildClass”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[{“name”:“OC\App\AppStore\Fetcher\AppFetcher”,“class”:“ReflectionClass”}]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:119,“function”:“resolve”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OC\App\AppStore\Fetcher\AppFetcher”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:132,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OC\App\AppStore\Fetcher\AppFetcher”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:1513,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OC\App\AppStore\Fetcher\AppFetcher”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:1161,“function”:“getAppFetcher”,“class”:“OC\Server”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:[" sensitive parameters replaced ***"]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:117,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OC\Installer”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:132,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OC\Installer”]},{“file”:"/var/www/nextcloud/lib/private/legacy/util.php",“line”:738,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OC\Installer”]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:667,“function”:“checkServer”,“class”:“OC_Util”,“type”:"::",“args”:[{“class”:“OC\SystemConfig”}]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:1068,“function”:“init”,“class”:“OC”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/index.php",“line”:40,“args”:["/var/www/nextcloud/lib/base.php"],“function”:“require_once”}],“File”:"/var/www/nextcloud/lib/private/RedisFactory.php",“Line”:84,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0”,“version”:“15.0.5.3”}

You should install a Redis server on your server so that Nextcloud can use it.

Redis is installed on my server

look for the directory above, does it exist?

I setup the redis server per Carsten’s excellent guide:

Install redis
apt update && apt install redis-server php-redis -y

Change configuration and group membership

cp /etc/redis/redis.conf /etc/redis/redis.conf.bak
sed -i “s/port 6379/port 0/” /etc/redis/redis.conf
sed -i s/#\ unixsocket/\unixsocket/g /etc/redis/redis.conf
sed -i “s/unixsocketperm 700/unixsocketperm 770/” /etc/redis/redis.conf
sed -i “s/# maxclients 10000/maxclients 512/” /etc/redis/redis.conf
usermod -a -G redis www-data
cp /etc/sysctl.conf /etc/sysctl.conf.bak && sed -i ‘$avm.overcommit_memory = 1’ /etc/sysctl.conf

Had to remove ref to redis in config.php
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,

to get the nextcloud to work without the redis errors

Yes, /var/run/redis exists and has two sub folders
-rw-rw---- 1 redis redis 6 Mar 4 11:09 redis-server.pid
srwxrwx— 1 redis redis 0 Mar 4 11:09 redis-server.sock

user@nc:~$ ps ax | grep redis
8628 pts/0 S+ 0:00 grep redis
25231 ? Ssl 1:51 /usr/bin/redis-server 127.0.0.1:0

user@nc:~$ apt-cache policy php-redis
php-redis:
Installed: 4.2.0-1
Candidate: 4.2.0-1
Version table:
*** 4.2.0-1 750
750 http://mirrordirector.raspbian.org/raspbian buster/main armhf Packages
100 /var/lib/dpkg/status
3.1.1-1 500
500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages

The message says “No such file or directory” for /var/run/redis/redis.sock, which is true, since you have no ‘redis.sock’ but a ‘redis-server.sock’

I had a look at my redis.conf. Since with the instruction: " sed -i s/#\ unixsocket/\unixsocket/g /etc/redis/redis.conf" you didn’t change the directory of ‘redis.sock’ it should reside under ‘/tmp’ otherwise the sed-command should be
" sed -i s/#\ unixsocket /tmp/redis.sock/\unixsocket /var/run/redis/redis.sock/g /etc/redis/redis.conf "

or similar

Thank you for trying to help. I solved the issue. It has nothing to do with the sed statements. I looked in my redis.config file and noticed I had a different server name than the instructions I was following which explains why the file not found error was happening. A quick change to config.php to match the name in the redis config file solved the issue.

I had this:

array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘port’ => 0,
‘timeout’ => 0.0,
),

and changed it to this:
array (
‘host’ => ‘/var/run/redis/redis-server.sock’,
‘port’ => 0,
‘timeout’ => 0.0,
),