Redis connection refused

I’m trying running erpnext on docker but I’m having issues with redis cache which cannot be accessed apparently. The point is that I can ping the same servers claimed to be inaccessible from within the containers and they clearly see each other.

I provide a quick asciicast of what’s happening. Sorry but cannot attach json files. Just download and run asciinema play asciicast-99657.json

Hope somebody can help :blush:

Ya, this makes the whole front-end unusable, as the redis server keeps crashing and corrupting rdb file :sweat:

Additionally you can check the asciicast here as well:

asciicast

All three redis instances running ps aux | grep redis and yet connection is reufsed:

redis 1 0.1 0.2 35356 4596 ? Ssl 20:28 0:00 redis-server *:6379

In response to bench update:

/bin/sh: redis-server: not found
Traceback (most recent call last):
  File "/usr/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/commands/update.py", line 31, in update
    patches.run(bench_path='.')
  File "/home/frappe/bench-repo/bench/patches/__init__.py", line 21, in run
    result = execute(bench_path)
  File "/home/frappe/bench-repo/bench/patches/v3/redis_bind_ip.py", line 10, in execute
    generate_config(bench_path)
  File "/home/frappe/bench-repo/bench/config/redis.py", line 34, in generate_config
    "redis_version": get_redis_version(),
  File "/home/frappe/bench-repo/bench/config/redis.py", line 54, in get_redis_version
    version_string = subprocess.check_output('redis-server --version', shell=True).strip()
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'redis-server --version' returned non-zero exit status 127

Damn :rage: Exposing ports inside Dockerfile, for some reason is not enough. You gotta tell again in your docker-compose file :dizzy_face:

Ports are not automatically exposed when running inside Docker, but rather explicitely by specifying -p / -P.

Fine, no big deal once you figure it out :sweat_smile: