ghostfolio / ghostfolio

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
https://Ghostfol.io
GNU Affero General Public License v3.0
4.51k stars 454 forks source link

[Bug] Redis Connection Error #3745

Open theflyer08 opened 2 months ago

theflyer08 commented 2 months ago

After the latest docker-update (made by watchdog) the landing page can't be reached. In Portainer no network and port is bind to the Ghostfolio container.

To Reproduce

  1. Every time when the landing page is accessed

Expected behavior

Landing page opens

Logs

Redis Connection Error: [ErrorReply: ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?] [Nest] 107 - 09/09/2024, 7:27:41 AM ERROR [ExceptionHandler] ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?

Environment

Docker Self hosted Debian 12

dtslvr commented 2 months ago

The redis configuration has recently changed due to an update of the cache library: https://github.com/ghostfolio/ghostfolio/blob/bdb3a8f1dc5f89ebda2f081320a2033c774a0ded/apps/api/src/app/redis-cache/redis-cache.module.ts#L25

Maybe the logic here is not correct if you don't have a password? The easiest way would probably be to define REDIS_PASSWORD in your .env file (see .env.example) and restart the containers.

theflyer08 commented 2 months ago

Hi @dtslvr, I entered a redis-password in the .env-file and rebooted the machine. It didn't work. This is the corresponding log:

Redis Connection Error: [ErrorReply: ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?] [Nest] 108 - 09/09/2024, 1:41:08 PM ERROR [ExceptionHandler] ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?

I also tried to enter the same redis-password in the docker-compose.yml file. But this doesn't help either.

sujan46 commented 2 months ago

@theflyer08 Had the same issue v2.105.0. fixed it by updating my docker-compose file. May be relevant?

https://github.com/ghostfolio/ghostfolio/commit/9bf68b0d208c7a1292a96190b43bcf3c59ce0d26

https://github.com/ghostfolio/ghostfolio/blob/557a0bf8080870943f70dfda37f6ae5cb0666a4e/docker/docker-compose.yml#L57

theflyer08 commented 2 months ago

@sujan46: I used an updated docker-compose.yml file. But the error message stays the same.

theflyer08 commented 2 months ago

I tried out the latest .env and the latest docker-compose.yml file. I tried it with and without Redis password. The redis connection error stays the same.

manast1 commented 2 months ago

I had the same issue when upgrading from 2.105.0 to 2.106.0. I can switch beween 2.105.0 and 2.106.0 and see the deifference. In 2.105.0 the log states a redis AUTH warning. In 2.106.0 its an error. I fixed it, but dont remember how. For me it was ${REDIS_PASSWORD} related -> bad config on my side (i tryed to use docker secrets ${REDIS_PASSWORD_FILE}).

My current relevant redis line: command: ['redis-server', '--loglevel warning', '--requirepass', $REDIS_PASSWORD]

flowcool commented 2 months ago

Here's what I've done for that:

  ghost_redis:
    image: redis:alpine
    container_name: ghost_redis
    user: ${PUID}:${PGID}
    restart: unless-stopped
    healthcheck:
      #test: ['CMD-SHELL', 'redis-cli --pass $REDIS_PASSWORD ping | grep PONG']
      test: [ "CMD", "redis-cli", "--pass", $REDIS_PASSWORD, "--no-auth-warning", "ping | grep PONG" ]
      interval: 10s
      timeout: 5s
      retries: 5
    command: ['redis-server', '--requirepass', $REDIS_PASSWORD]
    environment:
      REDIS_PASSWORD: ${REDIS_PASSWORD}
      PUID: ${PUID}
      PGID: ${PGID}
theflyer08 commented 2 months ago

Hi, thank you for the help. I tried all suggestions but no luck. Is anybody using the latest docker-compose version. For me, that doesn't work.

privacyadmin commented 2 months ago

I had the same issue and what I did to fix my error was to comment out the REDDIS_PASSWORD from environment in the ghostfolio container.

theflyer08 commented 2 months ago

I tried that. Then I got the message, that I have no default user configured...

I had the same issue and what I did to fix my error was to comment out the REDDIS_PASSWORD from environment in the ghostfolio container.

rodriguestiago0 commented 2 months ago

Comment #- REDIS_PASSWORD= everywhere and it works.

theflyer08 commented 1 month ago

@rodriguestiago0 I commented out REDIS_PASSWORD in the .env & docker-compose.yml file. That resulted in following error message:

[WARN] This Redis server's `default` user does not require a password, but a password was supplied
Redis Connection Error:  [ErrorReply: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?]
[Nest] 108  -   ERROR [ExceptionHandler] ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
rodriguestiago0 commented 1 month ago

Yes. Both places