Skip to content

Fix the Redis Auth warning in rConfig V8 Core

After reading this page, I can clear the Redis Auth warning on the rConfig V8 Core dashboard by requiring a password on Redis, confirm the fix from the command line, and recheck the dashboard straight away. It also covers every message the check and the commands can print, and what to do about each one.

Use this page when the dashboard Health Status panel shows a Redis Auth alert, when php artisan rconfig:redis-security-check exits non-zero, or when Horizon logs NOAUTH errors after a Redis password change. New installs and update.sh on V8.2.19+ set a password for you, so you mostly land here after upgrading an older install, on a server shared with rConfig Pro, or after Redis was reinstalled.

rConfig V8 Core uses Redis for its job queue, cache and sessions. Horizon workers take jobs off the queue and run them, so anything that can write to Redis can make a worker run code. A Redis password is the control that closes this.

Binding Redis to 127.0.0.1 is not enough on its own. Any process on the server can reach a loopback listener, including connections rConfig itself opens on behalf of devices. That is why the check reports the bind address and protected mode for context only, and never passes on them.

The scheduler runs the health checks every five minutes and the dashboard shows the latest result. The check has three outcomes:

Dashboard Message Meaning
Green, no alert Redis requires authentication. Redis rejects clients without a password. Nothing to do.
Red alert Redis has no password set. Run: php artisan rconfig:redis-secure Redis accepts any local client. Follow the steps below.
Amber alert Redis is unreachable; authentication state could not be determined. The check could not connect to Redis at all. See Redis is unreachable.

The same state is available from the command line with php artisan rconfig:redis-security-check, which is read only and safe to run at any time.

  • Shell access to the rConfig server with sudo.
  • rConfig V8 Core V8.2.19+. On older releases, run sudo ./update.sh first (see How to update rConfig V8 Core), which also sets the password for you.
  • The rConfig folder path. The examples use /var/www/html/rconfig.
  • To know whether any other application uses the same Redis instance, for example rConfig Pro installed on the same server. If one does, read Redis shared with another application before you start.
  1. Go to the rConfig folder.

    Terminal window
    cd /var/www/html/rconfig
  2. Check the current state.

    Terminal window
    php artisan rconfig:redis-security-check

    On an unsecured install the output looks like this:

    ERROR Redis has no password set. Run: php artisan rconfig:redis-secure
    Password required ............................................. no
    App can authenticate .......................................... yes
    Bind (context only) ................................. 127.0.0.1 -::1
    Protected mode (context only) ................................. yes

    The exit code tells scripts the same thing: 0 means a password is required, 1 means Redis has no password, 2 means Redis could not be reached.

  3. Preview the change. Nothing is altered.

    Terminal window
    php artisan rconfig:redis-secure --dry-run
  4. Secure Redis.

    Terminal window
    php artisan rconfig:redis-secure

    The command generates a 64 character password, writes it to REDIS_PASSWORD in .env, rebuilds the config cache if one exists, requires the password on the running Redis with CONFIG SET requirepass, saves it to the Redis config file with CONFIG REWRITE, and signals Horizon and the queue workers to restart so they reconnect with it. Supervisor relaunches Horizon on its own. A successful run ends with:

    INFO Redis is now secured. Verify with: php artisan rconfig:redis-security-check

    If it prints a warning instead, find the message under Troubleshooting.

  5. Verify the fix.

    Terminal window
    php artisan rconfig:redis-security-check
    echo $?

    You should see Redis requires authentication., both Password required and App can authenticate set to yes, and an exit code of 0.

  6. Recheck the dashboard now rather than waiting for the next five minute run. Run the health checks as the web server user, not as root:

    Terminal window
    # RHEL, Rocky, Alma
    sudo -u apache php artisan health:check
    # Ubuntu
    sudo -u www-data php artisan health:check

    Refresh the dashboard. The Redis Auth alert is gone.

Rotate the password if it may have leaked, for example after .env was copied somewhere it should not have been.

Terminal window
cd /var/www/html/rconfig
php artisan rconfig:redis-secure --force
php artisan rconfig:redis-security-check

--force generates and applies a new password even when one is already set. Any other application that shares this Redis instance must be given the new value.

The dashboard shows an amber alert and rconfig:redis-security-check exits 2. The check could not open a connection, so it cannot say whether a password is required.

  1. Check that Redis is running.

    Terminal window
    # RHEL, Rocky, Alma
    sudo systemctl status redis
    # Ubuntu
    sudo systemctl status redis-server
  2. Start it if it is stopped, and enable it at boot.

    Terminal window
    sudo systemctl enable --now redis # RHEL, Rocky, Alma
    sudo systemctl enable --now redis-server # Ubuntu
  3. Confirm rConfig points at the right host and port. The check connects to REDIS_HOST and REDIS_PORT from .env (default 127.0.0.1 and 6379).

    Terminal window
    grep -E '^REDIS_(HOST|PORT)=' /var/www/html/rconfig/.env
    redis-cli -h 127.0.0.1 -p 6379 ping

    PONG or NOAUTH Authentication required both mean Redis is listening. A connection error means it is not, or is on another address.

  4. Rerun php artisan rconfig:redis-security-check and continue from the result.

“REDIS_PASSWORD is set in .env but the live Redis does not accept it (desync)”

Section titled ““REDIS_PASSWORD is set in .env but the live Redis does not accept it (desync)””

rconfig:redis-secure stops rather than overwrite a password it did not set. .env and Redis disagree, so Horizon cannot connect either. Pick one:

  • Let rConfig set a fresh password on both sides: php artisan rconfig:redis-secure --force. This needs Redis to accept rConfig’s current credential (or no password) so it can change it.
  • Keep the password Redis already has: copy the requirepass value from your Redis config file into REDIS_PASSWORD in .env, then run php artisan config:cache if your install caches config, and restart Horizon with php artisan horizon:terminate.

“CONFIG REWRITE failed: the password is live but not persisted”

Section titled ““CONFIG REWRITE failed: the password is live but not persisted””

Redis accepted the password but could not save it to its config file, usually because it was started without one. The password works now and is lost when Redis restarts, which brings the red alert back. Add it to the config file by hand:

  1. Read the password rConfig set.

    Terminal window
    grep '^REDIS_PASSWORD=' /var/www/html/rconfig/.env
  2. Add or replace the requirepass line in the Redis config file with that value.

    Terminal window
    sudo vi /etc/redis/redis.conf # older releases: /etc/redis.conf
    # requirepass <value of REDIS_PASSWORD>
    sudo systemctl restart redis
  3. Restart Horizon so it reconnects, then verify.

    Terminal window
    cd /var/www/html/rconfig
    php artisan horizon:terminate
    php artisan rconfig:redis-security-check

“The new password could not be verified against the live instance”

Section titled ““The new password could not be verified against the live instance””

The password was applied but a fresh connection with it failed. Run php artisan rconfig:redis-security-check. If Password required is yes and App can authenticate is no, follow the desync steps above.

App can authenticate reports no, or Horizon logs NOAUTH

Section titled “App can authenticate reports no, or Horizon logs NOAUTH”

Redis requires a password, so the dashboard check passes, but the application is not sending the right one and queued jobs fail. This happens when the password in .env is wrong, when a cached config still holds an old value, or when Horizon kept a connection opened before the change.

Terminal window
cd /var/www/html/rconfig
php artisan rconfig:redis-security-check # confirm App can authenticate: no
php artisan config:cache # only if your install caches config
php artisan horizon:terminate # Supervisor relaunches Horizon

If it still reports no, the value in .env does not match Redis. Follow the desync steps above.

If rConfig Pro, or anything else, uses the same Redis instance, it loses access as soon as a password is set. update.sh skips this step when it sees another application’s Horizon on the server and prints a warning instead. Choose one approach before you secure Redis:

  • Share the password. Run php artisan rconfig:redis-secure in rConfig V8 Core, copy REDIS_PASSWORD from its .env into the other application’s .env, then restart that application’s Horizon.
  • Separate the instances. Run a second Redis instance on another port for one of the applications, point its REDIS_PORT at it, and secure each one.