Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextcloud breaks with redis upgrade 5 to 6 #1411

Closed
fredericrous opened this issue Feb 18, 2021 · 13 comments
Closed

nextcloud breaks with redis upgrade 5 to 6 #1411

fredericrous opened this issue Feb 18, 2021 · 13 comments
Labels

Comments

@fredericrous
Copy link

I was seeing the following error in the logging pane of nextcloud. I was using version 19 (tag "19", the latest one)

RedisException: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct? in /var/www/html/lib/private/RedisFactory.php:94

Then I saw this bug report where people were having a similar issue:
https://help.nextcloud.com/t/solved-latest-docker-image-broke-the-installation-redis-password-auth/87598/18

I thought the following PR was the fix but it isn't: #1232

I thought that upgrading to version "20" would solve the issue because the fix was definitely not in image "19". Nextcloud wouldn't boot anymore like it is for the people reporting the issue I just linked. Full stack trace bellow

nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | Configuring Redis as session handler
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | Initializing nextcloud 20.0.7.1 ...
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | Upgrading nextcloud from 19.0.8.1 ...
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | Initializing finished
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | An unhandled exception has been thrown:
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | RedisException: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct? in /var/www/html/lib/private/RedisFactory.php:94
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | Stack trace:
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #0 /var/www/html/lib/private/RedisFactory.php(94): Redis->auth(false)
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #1 /var/www/html/lib/private/RedisFactory.php(108): OC\RedisFactory->create()
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #2 /var/www/html/lib/private/Memcache/Redis.php(43): OC\RedisFactory->getInstance()
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #3 /var/www/html/lib/private/Memcache/Factory.php(135): OC\Memcache\Redis->__construct('6d17c6d689e1626...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #4 /var/www/html/lib/private/Server.php(1018): OC\Memcache\Factory->createLocking('lock')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #5 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #6 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #7 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #8 /var/www/html/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', true)
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #9 /var/www/html/lib/private/Server.php(1977): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #10 /var/www/html/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #11 /var/www/html/lib/private/Server.php(395): OC\Files\View->__construct()
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #12 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #13 /var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #14 /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #15 /var/www/html/lib/private/ServerContainer.php(156): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', true)
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #16 /var/www/html/lib/private/Server.php(1324): OC\ServerContainer->query('OC\\Files\\Node\\H...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #17 /var/www/html/lib/base.php(595): OC\Server->boot()
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #18 /var/www/html/lib/base.php(1091): OC::init()
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #19 /var/www/html/console.php(49): require_once('/var/www/html/l...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #20 /var/www/html/occ(11): require_once('/var/www/html/c...')
nextcloud_nextcloud.1.p331g2jxciu9@DADDYSHOME    | #21 {main}nextcloud_nextcloud.1.v5n5m4pkfa4s@DADDYSHOME    | Configuring Redis as session handler

Adding a password to redis was not a solution for me because other images use the same redis and these images cannot be configured to authenticate with redis. I downgraded to version 5 of redis and nextcloud is now up and running again.

I am not sure but believe the issue I'm having is similar to #1404

@J0WI
Copy link
Contributor

J0WI commented Feb 19, 2021

I thought the following PR was the fix but it isn't: #1232

Is your Redis password empty or still set to false?

@fredericrous
Copy link
Author

Heuu.. Neither? It's just not set. Let me share my docker configs

nexcloud config (without the traefik labels and volume mounts):

  nextcloud:
    image: nextcloud:20
    environment:
      - TZ=${TIMEZONE}
      - MYSQL_HOST=mysql
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=somepassword
      - REDIS_HOST=redis
      - REDIS_HOST_PORT=6379
      - SMTP_HOST=smtp
      - SMTP_PORT=25
      - MAIL_FROM_ADDRESS=nextcloud
      - MAIL_DOMAIN=${DOMAIN}
      - OVERWRITEHOST=drive.${DOMAIN}
      - OVERWRITEPROTOCOL=https
      - NC_loglevel=1
    networks:
      - traefik_public

redis config:

  redis:
    image: redis:5-alpine
    environment:
      - REDIS_REPLICATION_MODE=master
    networks:
      - traefik_public

if instead of redis:5-alpine I use redis, nextcloud won't start

@J0WI
Copy link
Contributor

J0WI commented Feb 19, 2021

Have you checked your config.php?

@J0WI J0WI added the question label Feb 19, 2021
@fredericrous
Copy link
Author

fredericrous commented Feb 19, 2021

I haven't edited config.php. The password for redis is set to false there

  'redis' =>
  array (
    'host' => 'redis',
    'password' => false,
    'port' => 6379,
  ),

So basically I have to replace false by '' in config.php or declare an empty variable REDIS_HOST_PASSWORD ?

@fredericrous
Copy link
Author

It works when I replace false by '' in config.php, thank you J0wi

I think the current documentation of the readme is misleading
REDIS_HOST_PASSWORD (not set by default) Redis password
That's not exactly true, because I had to set redis password to empty, but maybe that's because I was upgrading?

@fredericrous
Copy link
Author

I am now getting a 303 error and am stuck on the login page when using redis 6.
I carefully destroyed the containers, removed the cache of redis, changed the config to get 'password' => '', also set REDIS_HOST_PASSWORD= in the compose file, deployed the containers. I cleared my browser's cache. Tried to login and got the 303 error in the logs, no other message, no loop, the URL in my browser address bar is stuck on something like /login?redirect=/apps/dashboard/
I am not getting any issue with redis 5 so I downgraded for now and will give a try to redis 6 when I'll upgrade to nextcloud 21.

@bf8392
Copy link

bf8392 commented Feb 25, 2021

Have you tested with nc 21 already?

@pnbecker
Copy link

I have the same problem with NC 21.

@mschoettle
Copy link

See also #1291

@JuniorJPDJ
Copy link

I managed to workaround it on my side.
Problem is already fixed in #1232 but...
config files seems not to be updated in place
Remove config files from your volume and copy new configs from this repo - this fixed issue for me, I'm now running nextcloud 20 with redis:alpine without password and it works ;)

@mschoettle
Copy link

Remove config files from your volume and copy new configs from this repo

Which config files are you exactly referring to?

@JuniorJPDJ
Copy link

-rw-r--r-- 1 root root   70 Jul 11 04:01 apcu.config.php
-rw-r--r-- 1 root root  377 Jul 11 04:01 apps.config.php
-rw-r--r-- 1 root root 1.1K Jul 11 04:01 autoconfig.php
-rw-r--r-- 1 root root  552 Jul 11 04:01 redis.config.php
-rw-r--r-- 1 root root  674 Jul 11 04:01 reverse-proxy.config.php
-rw-r--r-- 1 root root 1.3K Jul 11 04:01 s3.config.php
-rw-r--r-- 1 root root  669 Jul 11 04:01 smtp.config.php
-rw-r--r-- 1 root root 1.1K Jul 11 04:01 swift.config.php

Those from nextcloud volume.
Container update seem not to update them.

@JuniorJPDJ JuniorJPDJ mentioned this issue Jul 17, 2021
@J0WI
Copy link
Contributor

J0WI commented Apr 4, 2023

Closing as duplicate of #1232 and #1533

@J0WI J0WI closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants