Skip to content

🐛 Bug Report: NOAUTH Authentication RedisException thrown #3309

Closed

Description

@rome2o

I've been working on adding possibility of Procfile based deployments so one could deploy to Heroku or Dokku keeping in mind the entrypoints for all required containers e.g. worker-deletes and so fourth.

Ultimately, the Procfile should look like following

web: php -e app/http.php -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php
worker-functions: . worker-functions
worker-audits: ...
worker-deletes: ...

Before I jumped into spinning those containers up, I thought to run deployment through Dockerfile on my Dokku server.

Initially I was getting the following error:

ERROR   php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Uncaught Exception: Failed to connect to database: SQLSTATE[HY000] [2002] Connection refused in /usr/src/code/app/http.php:75

After fiddling around, I found out that the error shown is wrong. Redis credentials had issues, not database. I happen to proceed connecting database successfully.

The next roadblock is the following.

       Fatal error: Uncaught RedisException: NOAUTH Authentication required. in /usr/src/code/vendor/utopia-php/cache/src/Cache/Adapter/Redis.php:32
       Stack trace:
       #0 /usr/src/code/vendor/utopia-php/cache/src/Cache/Adapter/Redis.php(32): Redis->get('cache-_console:...')
       #1 /usr/src/code/vendor/utopia-php/cache/src/Cache/Cache.php(47): Utopia\Cache\Adapter\Redis->load('cache-_console:...', 86400)
       #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(761): Utopia\Cache\Cache->load('cache-_console:...', 86400)
       #3 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(379): Utopia\Database\Database->getDocument(Object(Utopia\Database\Document), 'audit')
       #4 /usr/src/code/app/http.php(104): Utopia\Database\Database->getCollection('audit')
       #5 {main}
         thrown in /usr/src/code/vendor/utopia-php/cache/src/Cache/Adapter/Redis.php on line 32
       [2022-05-30 08:43:03 #8.4]       ERROR   php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Uncaught RedisException: NOAUTH Authentication required. in /usr/src/code/vendor/utopia-php/cache/src/Cache/Adapter/Redis.php:32
       Stack trace:
       #0 /usr/src/code/vendor/utopia-php/cache/src/Cache/Adapter/Redis.php(32): Redis->get('cache-_console:...')
       #1 /usr/src/code/vendor/utopia-php/cache/src/Cache/Cache.php(47): Utopia\Cache\Adapter\Redis->load('cache-_console:...', 86400)
       #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(761): Utopia\Cache\Cache->load('cache-_console:...', 86400)
       #3 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(379): Utopia\Database\Database->getDocument(Object(Utopia\Database\Document), 'audit')
       #4 /usr/src/code/app/http.php(104): Utopia\Database\Database->getCollection('audit')
       #5 {main}
         thrown in /usr/src/code/vendor/utopia-php/cache/src/Cache/Adapter/Redis.php on line 32

Could someone please help?

Thanks

👟 Reproduction steps

Spin up a Dokku server, assign environment variables or push the application to Heroku with environment variables all setup.

Dokku

git push dokku master:master

Heroku

git push heroku master:master

👍 Expected behavior

It should connect to Redis as all the configurations are correct. I've tested it through Medis and TablePlus

👎 Actual Behavior

The app crashes upon deployment after the Dockerfile build is succeeded and app is about to release.

🎲 Appwrite version

Version 0.14.x

💻 Operating system

Linux

🧱 Your Environment

N.A

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. added
    bug
    on May 30, 2022
  2. stnguyen90 commented on Jun 10, 2022

    @stnguyen90
    Contributor

    I believe the problem is the library Appwrite uses to connect to redis doesn't properly pass the user to authenticate.

    The core team is working on replacing the library with one that will support username and password.

  3. usamashafiqs commented on Dec 28, 2022

    @usamashafiqs

    Any update on this ?

  4. rome2o commented on Dec 30, 2022

    @rome2o
    Author

    For me, this was an issue because the REDIS_URL wasn't being parsed properly in the source code of Appwrite.

    Try putting Redis credentials in a plain format in your .env, and see if it works.

    If you wish to debug this, try to print in console the Redis configuration upon boot and see what changes in .env would be required.

    Hopefully this would fix your issue.

  5. adipriyantobpn commented on May 5, 2023

    @adipriyantobpn
  6. liudonghua123 commented on Dec 21, 2023

    @liudonghua123

    I have the similar issues when I try to run appwrite using docker compose followed the guidance on https://github.com/appwrite/appwrite?tab=readme-ov-file#unix.

    docker run -it --rm \
        --volume /var/run/docker.sock:/var/run/docker.sock \
        --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
        --entrypoint="install" \
        appwrite/appwrite:1.4.12

    Details logs: logs.txt

  7. aquelegustavo commented on Jun 28, 2024

    @aquelegustavo

    Hello everyone, how are you?

    I came across the same issue. I noticed that Redis in docker compose installed via script (https://appwrite.io/docs/advanced/self-hosting#install-with-docker) does not set a password. For security reasons, I added line 823 (screenshot below) so that Redis requires a password for connections.

    image

    After making this change, I noticed that the services appwrite and appwrite-task-maintenance are unable to connect to Redis. The appwrite-realtime service seems to be working fine.

    In the case of the appwrite container, it is unable to open the console, triggering the following error in the log when accessed through port 80:
    image

    The appwrite-task-maintenance container throws the following error (a lot of times on terminal):
    image

    I hope I have contributed to the discussion and at least saved some time for those investigating this issue =)

  8. andrekutianski commented on Aug 20, 2024

    @andrekutianski

    This also affects environments where an external Redis is used that is not defined in the default docker-compose. Appwrite forces you to use a local Redis with this authentication issue.

  9. robsoncombr commented on Oct 16, 2024

    @robsoncombr

    Just found this to avoid duplicates. Redis connection configuration, to me, looks like not to be considering the configured _APP_REDIS_USER / _APP_REDIS_PASS trying to connect without credentials that fails.

    [Error] Message: Failed to create connection: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?

  10. FaisalMohammadi commented on Mar 25, 2025

    @FaisalMohammadi

    is there any update tot this? i am runnig to the same problem. I have external redis set up and putte the credentials inside .env file and also tried with passing --requirepass ${_APP_REDIS_PASS}.

  11. bingoku commented on May 9, 2025

    @bingoku

    This issue has persisted for several years without resolution.

    Upon testing, it was observed that the appwrite-task-maintenance service encounters the NOAUTH Authentication required error whenever Redis is configured with a password. This occurs regardless of whether Redis is running inside the docker-compose environment or externally. If the password requirement is removed from the external Redis instance, the appwrite-task-maintenance service starts without issues.

    Additionally, Appwrite currently lacks support for Redis Cluster configurations, which limits scalability options

    These limitations suggest that Appwrite’s self-hosted version may not yet be suitable for production environments and might be more appropriate for development or testing purposes. 😂

  12. felixlu07 commented on May 14, 2025

    @felixlu07

    @bingoku Encountered something similar as well. Keep getting persistent issues with attributes creation where it is perpetually stuck in pending state.

    How I troubleshooted was to attempt to create an attribute, then almost immediately run docker logs appwrite --since=2m to check the exact error message; I saw --> "NOAUTH Authentication required" errors with Redis in Appwrite 1.6.1". Despite having correct Redis credentials in both .env and docker-compose.yml, the errors continued.

    The fix was to completely remove Redis authentication by clearing the Redis credentials in .env (_APP_REDIS_USER and _APP_REDIS_PASS) and removing the --requirepass parameter from docker-compose.yml. After restarting with docker-compose down && docker-compose up -d, I no longer had the attributes stuck in processing, and everything worked perfectly.

    I could be wrong, but this seems to suggests a bug in how some Appwrite services handle Redis authentication, which appears to be a recurring issue across versions.

  13. keskinonur commented on May 29, 2025

    @keskinonur

    I came up with the same problem and fix it by supplying like this in the docker-compose.yml :

      redis:
        image: redis:7.2.4-alpine
        container_name: appwrite-redis
        <<: *x-logging
        restart: unless-stopped
        command: >
          redis-server
          --maxmemory            512mb
          --maxmemory-policy     allkeys-lru
          --maxmemory-samples    5
          --requirepass ${_APP_REDIS_PASS}
        networks:
          - appwrite
        environment:
          - REDIS_HOST=${_APP_REDIS_HOST}
          - REDIS_PORT=${_APP_REDIS_PORT}
          - REDIS_PASSWORD=${_APP_REDIS_PASS}
        volumes:
          - appwrite-redis:/data:rw
    
  14. kodejuice commented on Feb 9, 2026

    @kodejuice
  15. HarshMN2345 commented on Sep 22, 2026

    @HarshMN2345
    Member

    Fixed by 86c34b4. Closing this.

  16. ibaraki-douji commented on Sep 22, 2026

    @ibaraki-douji
    Contributor
  17. HarshMN2345 commented on Sep 22, 2026

    @HarshMN2345
    Member

    yes, i can also confirm it's resolved, my 2.2.0 instance don't use a redis-proxy anymore and works fine

    see :

    Thankss for confirming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions