Trying to access external storage but getting RedisException: Connection refused

Support intro

Nextcloud version : Nextcloud Hub 5 (27.0.0)
Operating system and version): Ubuntu 22.04.2 LTS
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): replace me

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Go to my External Storage
  2. Click the “Photos” folder (or any othe)

The output of your Nextcloud log in Admin > Logging:

RedisException: Connection refused
/var/www/html/lib/private/RedisFactory.php - line 137:

Redis->pconnect("172.18.0.4", 6379, 0, "*** sensiti ... *", 0, 0)

/var/www/html/lib/private/RedisFactory.php - line 178:

OC\RedisFactory->create("*** sensiti ... *")

/var/www/html/lib/private/Memcache/Redis.php - line 66:

OC\RedisFactory->getInstance()

/var/www/html/lib/private/Memcache/Redis.php - line 137:

OC\Memcache\Redis->getCache()

/var/www/html/lib/private/Lock/MemcacheLockingProvider.php - line 61:

OC\Memcache\Redis->inc("files/c3bf9 ... 7")

/var/www/html/lib/private/Files/Storage/Common.php - line 765:

OC\Lock\MemcacheLockingProvider->acquireLock("files/c3bf9 ... 7", 1, "local::/data/::Readme.md")

/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php - line 607:

OC\Files\Storage\Common->acquireLock("Readme.md", 1, [ "OC\\Lock\ ... "])

/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php - line 607:

OC\Files\Storage\Wrapper\Wrapper->acquireLock("Readme.md", 1, [ "OC\\Lock\ ... "])

/var/www/html/lib/private/Files/View.php - line 1917:

OC\Files\Storage\Wrapper\Wrapper->acquireLock("Readme.md", 1, [ "OC\\Lock\ ... "])

/var/www/html/lib/private/Files/View.php - line 2030:

OC\Files\View->lockPath("/tanmay/fil ... d", 1, false)

/var/www/html/lib/private/Files/View.php - line 1123:

OC\Files\View->lockFile("/tanmay/fil ... d", 1)

/var/www/html/lib/private/Files/View.php - line 571:

OC\Files\View->basicOperation("file_get_contents", "/tanmay/fil ... d", [ "read"])

/var/www/html/lib/private/Files/Node/File.php - line 54:

OC\Files\View->file_get_contents("/tanmay/fil ... d")

/var/www/html/apps/text/lib/Service/ApiService.php - line 278:

OC\Files\Node\File->getContent()

/var/www/html/apps/text/lib/Service/ApiService.php - line 148:

OCA\Text\Service\ApiService->loadContent([ "OC\\Files\\Node\\File"])

/var/www/html/apps/text/lib/Controller/SessionController.php - line 61:

OCA\Text\Service\ApiService->create("*** sensiti ... *")

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Text\Controller\SessionController->create("*** sensiti ... *")

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController([ "OCA\\Text ... "], "create")

/var/www/html/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch([ "OCA\\Text ... "], "create")

/var/www/html/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main("OCA\\Text\\ ... r", "create", [ "OC\\AppFr ... "], [ "text.Session.create"])

/var/www/html/lib/base.php - line 1064:

OC\Route\Router->match("/apps/text/session/create")

/var/www/html/index.php - line 36:

OC::handleRequest()

The output of your config.php file in /path/to/nextcloud:

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '172.18.0.4',
    'port' => 6379,
  ),
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'cloud.mydomain.site',
  ),
  'overwriteprotocol' => 'https',
  'overwritehost' => 'cloud.mydomain.site',
  'overwrite.cli.url' => 'http://cloud.mydomain.site',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '27.0.0.8',
  'dbname' => 'postgres',
  'dbhost' => 'postgres',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'myuser',
  'dbpassword' => '',
  'installed' => true,
  'default_phone_region' => 'my country',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'logtimezone' => 'My timezone',
  'maintenance' => false,
  'app_install_overwrite' =>
  array (
    0 => 'metadata',
  ),
);

Your Redis server/service is offline. It looks like it’s supposed to be available at 172.18.0.4. So check your Redis server status. :slight_smile:

  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '172.18.0.4',
    'port' => 6379,
  ),