Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)

Infos:

  • Used Zammad version: 6.5.0-1753334673.cc7247b2.noble
  • Used Zammad installation type: package
  • Operating system: Ubuntu 24.04

Expected behavior:

  • Rail Server running
  • Websockets active

Actual behavior:

  • Nothing is listening on ports 3000 and 6042
  • The systemd services are active (running)

Steps to reproduce the behavior:

Not sure to be honest. I have installed Zammad last week. Started configuring everything. Haven’t looked at it until know and cannot get it back to work :confused:

Apparently, there is a problem connecting to Redis

$ sudo zammad run rails r "Setting.set('es_url', 'http://127.0.0.1:9200')"
There was an error trying to connect to Redis via redis://localhost:6379.
Please provide a Redis instance at localhost:6379 or set REDIS_URL to point to a different location.
#<Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)>
$ tail -f /var/log/redis/redis-server.log
# Configuration loaded
* monotonic clock: POSIX clock_gettime
* Running mode=standalone, port=6379.
# Server initialized
* Loading RDB produced by version 7.0.15
* RDB age 0 seconds
* RDB memory usage when created 0.84 Mb
* Done loading RDB, keys loaded: 0, keys expired: 0.
* DB loaded from disk: 0.000 seconds
* Ready to accept connections
^C

redis-cli -h 127.0.0.1 -p 6379 connects just fine though.

Not much going on in production.log except for repeating the following two lines over and over:

Using Zammad's file store as Rails cache store.
Using the File back end for Zammad's web socket session store.

I hope somebody has an idea how to fix this :hugs:

Connecting to localhost is not the same as connecting to 127.0.0.1

Is Redis both listening on IPv4 127.0.0.1 and IPv6 ::1 loopback addresses? Check with:

ss -tunapl|grep 6379

Is localhost configured as the hostname for both IPv4 and IPv6 loopback addresses? Check with:

host localhost

Also, what is the status of the Redis service? Check with:

systemctl status redis
4 Likes

Thank you very much. Your comment “connecting to localhost is not the same as connecting to 127.0.0.1” was spot on. localhost was set to 127.0.1.1 :man_shrugging: Redis itself was operating as intended.

1 Like