frappe_docker: Installing: /bin/sh: 1: redis-server: not found

Following the setup instructions in the README. Looks like the script is expecting to find Redis at a particular hostname that is not aliased in the Docker stack. At the bench init frappe-bench step:

# [... pip upgrade, git clone, NPM install etc]

Wrote css/frappe-web.css - 65.05 KB
Wrote js/frappe-web.min.js - 137.98 KB
Wrote js/dialog.min.js - 104.44 KB
Wrote css/desk.min.css - 291.98 KB
Wrote css/frappe-rtl.css - 32.37 KB
Wrote js/libs.min.js - 815.22 KB
Wrote js/desk.min.js - 510.13 KB
Wrote js/d3.min.js - 380.17 KB
Wrote css/module.min.css - 2.08 KB
Wrote css/form.min.css - 4.47 KB
Wrote js/form.min.js - 192.87 KB
Wrote css/list.min.css - 14.43 KB
Wrote js/list.min.js - 139.01 KB
Wrote css/report.min.css - 7.89 KB
Wrote js/report.min.js - 257.16 KB
Wrote js/web_form.min.js - 247.22 KB
Wrote css/web_form.css - 24.42 KB
Wrote js/print_format_v3.min.js - 23.39 KB
/bin/sh: 1: redis-server: not found
Traceback (most recent call last):
  File "/usr/local/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/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/commands/make.py", line 21, in init
    verbose=verbose, clone_from=clone_from, skip_bench_mkdir=skip_bench_mkdir, skip_redis_config_generation=skip_redis_config_generation)
  File "/home/frappe/bench-repo/bench/utils.py", line 78, in init
    redis.generate_config(path)
  File "/home/frappe/bench-repo/bench/config/redis.py", line 39, in generate_config
    "redis_version": get_redis_version(),
  File "/home/frappe/bench-repo/bench/config/redis.py", line 59, in get_redis_version
    version_string = subprocess.check_output('redis-server --version', shell=True).strip()
  File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'redis-server --version' returned non-zero exit status 127

# Just seeing what's available...
frappe@9761a4d8f053:~/frappe-bench$ ping redis
ping: unknown host redis

frappe@9761a4d8f053:~/frappe-bench$ ping redis-cache
PING redis-cache (192.168.48.4) 56(84) bytes of data.
64 bytes from redis-cache.frappedocker_default (192.168.48.4): icmp_seq=1 ttl=64 time=0.304 ms
64 bytes from redis-cache.frappedocker_default (192.168.48.4): icmp_seq=2 ttl=64 time=0.083 ms
^C
--- redis-cache ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.083/0.193/0.304/0.111 ms

Which of the 3 Redis instances is redis-server supposed to be?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 30 (18 by maintainers)

Commits related to this issue

Most upvoted comments

@carlos22 @sunhoww I started a Docker-Compose overhaul at https://github.com/emcniece/frappe_docker/tree/feat/docker-optimization

The documentation isn’t done yet, but try editing the docker-compose.yml and running docker-compose up -d.

Lots of the container configuration can be moved into environment variables - the MariaDB and Redis files can be eliminated and config can be specified in the docker-compose.yml file.

I have added an entrypoint.sh script here to take care of first-run setup as well, so we don’t have to spend time messing around and hitting these errors.

It’s in ~/frappe-bench of the frappe container. You would have to rename both files to the proper names. Just removing the _docker from the filenames would do.

You dont have to rename them, the click option skip-bench-mkdir will take care of this

The bench init command has been updated on the README, pls check it out @emcniece and thanks for bringing it to our notice. Issue seems resolved, I’ll close it if all concur?

@sunhoww indeed - and this is exactly what the README tells users, who (like myself) end up with the ~/frappe-bench/frappe-bench/ structure, which fails to install for many reasons.

Also, @vishalseshagiri the recent commit containing bench init --skip-bench-mkdir --skip-redis-config-generation frappe-bench needs a && cd frappe-bench at the end.