'Error Can't Open Config File' when I run bench start

Hey everyone,

When I run bench start in my vagrant vm, I get the error below.
This is causing me to get a error_socket_not_connected when I go to my localhost:8080
Any suggestions on how to fix it?

vagrant@vagrant-ubuntu-trusty-32:/vagrant/frappe-bench$ bench start
02:39:01 system | web.1 started (pid=12222)
02:39:01 system | async_worker.1 started (pid=12224)
02:39:01 system | redis_cache.1 started (pid=12227)
02:39:01 redis_cache.1 | [12239] 14 Mar 02:39:01.496 # Fatal error, can’t open config file ‘config/redis_cache.conf’
02:39:01 system | redis_cache.1 stopped (rc=1)
02:39:01 system | redis_celery.1 started (pid=12221)
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.480 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.481 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.481 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
02:39:01 redis_celery.1 | .
02:39:01 redis_celery.1 | .-__ ''-._ 02:39:01 redis_celery.1 | _.- . . ‘’-._ Redis 2.8.4 (00000000/0) 32 bit
02:39:01 redis_celery.1 | .- .-```. ```\/ _.,_ ''-._ 02:39:01 redis_celery.1 | ( ' , .-` | `, ) Running in stand alone mode 02:39:01 redis_celery.1 | |`-._`-...-` __...-.-.|'_.-'| Port: 6379 02:39:01 redis_celery.1 | | -. ._ / _.-' | PID: 12231 02:39:01 redis_celery.1 | -._ -._ -./ .-’ .-’
02:39:01 redis_celery.1 | |-._-.
-.__.-' _.-'_.-'| 02:39:01 redis_celery.1 | | -.
-._ _.-'_.-' | http://redis.io 02:39:01 redis_celery.1 | -._ -._-..-'.-’ .-’
02:39:01 redis_celery.1 | |-._-.
-.__.-' _.-'_.-'| 02:39:01 redis_celery.1 | | -.
-._ _.-'_.-' | 02:39:01 redis_celery.1 | -._ -._-.
.-‘_.-’ _.-’
02:39:01 redis_celery.1 | -._ -..-’ _.-’
02:39:01 redis_celery.1 | -._ _.-' 02:39:01 redis_celery.1 | -.
.-’
02:39:01 redis_celery.1 |
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.481 # Server started, Redis version 2.8.4
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.481 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
02:39:01 system | watch.1 started (pid=12223)
02:39:01 system | socketio.1 started (pid=12225)
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.482 * The server is now ready to accept connections on port 6379
02:39:01 system | redis_async_broker.1 started (pid=12250)
02:39:01 redis_async_broker.1 | [12252] 14 Mar 02:39:01.577 # Fatal error, can’t open config file ‘config/redis_async_broker.conf’
02:39:01 system | redis_async_broker.1 stopped (rc=1)
02:39:01 system | workerbeat.1 started (pid=12226)
02:39:01 system | worker.1 started (pid=12228)
02:39:01 system | longjob_worker.1 started (pid=12255)
02:39:01 system | sending SIGTERM to workerbeat.1 (pid 12226)
02:39:01 system | sending SIGTERM to watch.1 (pid 12223)
02:39:01 system | sending SIGTERM to redis_celery.1 (pid 12221)
02:39:01 system | sending SIGTERM to web.1 (pid 12222)
02:39:01 system | sending SIGTERM to async_worker.1 (pid 12224)
02:39:01 system | sending SIGTERM to socketio.1 (pid 12225)
02:39:01 system | sending SIGTERM to worker.1 (pid 12228)
02:39:01 system | sending SIGTERM to longjob_worker.1 (pid 12255)
02:39:01 redis_celery.1 | [12231 | signal handler] (1457923141) Received SIGTERM, scheduling shutdown…
02:39:01 system | workerbeat.1 stopped (rc=-15)
02:39:01 system | watch.1 stopped (rc=-15)
02:39:01 system | worker.1 stopped (rc=-15)
02:39:01 system | web.1 stopped (rc=-15)
02:39:01 system | async_worker.1 stopped (rc=-15)
02:39:01 system | longjob_worker.1 stopped (rc=-15)
02:39:01 system | socketio.1 stopped (rc=-15)
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.782 # User requested shutdown…
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.782 * Saving the final RDB snapshot before exiting.
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.788 * DB saved on disk
02:39:01 redis_celery.1 | [12231] 14 Mar 02:39:01.788 # Redis is now ready to exit, bye bye…
02:39:01 system | redis_celery.1 stopped (rc=-15)

Try running: bench setup redis-async-broker

That seems to get rid of some of the errors.

This is what was printed to the console after running that and then bench start

vagrant@vagrant-ubuntu-trusty-32:/vagrant/frappe-bench$ bench setup redis-async-broker
vagrant@vagrant-ubuntu-trusty-32:/vagrant/frappe-bench$ bench start
05:45:46 system | redis_async_broker.1 started (pid=2566)
05:45:46 system | redis_cache.1 started (pid=2567)
05:45:46 system | workerbeat.1 started (pid=2565)
05:45:46 system | redis_celery.1 started (pid=2561)
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.660 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.661 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.661 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
05:45:46 redis_celery.1 | .
05:45:46 redis_celery.1 | .-__ ''-._ 05:45:46 redis_celery.1 | _.- . . ‘’-._ Redis 2.8.4 (00000000/0) 32 bit
05:45:46 redis_celery.1 | .- .-```. ```\/ _.,_ ''-._ 05:45:46 redis_celery.1 | ( ' , .-` | `, ) Running in stand alone mode 05:45:46 redis_celery.1 | |`-._`-...-` __...-.-.|'_.-'| Port: 6379 05:45:46 redis_celery.1 | | -. ._ / _.-' | PID: 2571 05:45:46 redis_celery.1 | -._ -._ -./ .-’ .-’
05:45:46 redis_celery.1 | |-._-.
-.__.-' _.-'_.-'| 05:45:46 redis_celery.1 | | -.
-._ _.-'_.-' | http://redis.io 05:45:46 redis_celery.1 | -._ -._-..-'.-’ .-’
05:45:46 redis_celery.1 | |-._-.
-.__.-' _.-'_.-'| 05:45:46 redis_celery.1 | | -.
-._ _.-'_.-' | 05:45:46 redis_celery.1 | -._ -._-.
.-‘.-’ .-’
05:45:46 redis_celery.1 | -._ -..-’ _.-’
05:45:46 redis_celery.1 | -._ _.-' 05:45:46 redis_celery.1 | -.
.-’
05:45:46 redis_celery.1 |
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.661 # Server started, Redis version 2.8.4
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.661 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.669 * DB loaded from disk: 0.008 seconds
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.669 * The server is now ready to accept connections on port 6379
05:45:46 system | web.1 started (pid=2569)
05:45:46 system | longjob_worker.1 started (pid=2568)
05:45:46 system | watch.1 started (pid=2562)
05:45:46 redis_cache.1 | [2577] 14 Mar 05:45:46.748 # Fatal error, can’t open config file ‘config/redis_cache.conf’
05:45:46 system | redis_cache.1 stopped (rc=1)
05:45:46 system | socketio.1 started (pid=2564)
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.767 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.776 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
05:45:46 redis_async_broker.1 | .
05:45:46 redis_async_broker.1 | .-__ ''-._ 05:45:46 redis_async_broker.1 | _.- . . ‘’-.
Redis 2.8.4 (00000000/0) 32 bit
05:45:46 redis_async_broker.1 | .- .-```. ```\/ _.,_ ''-._ 05:45:46 redis_async_broker.1 | ( ' , .-` | `, ) Running in stand alone mode 05:45:46 redis_async_broker.1 | |`-._`-...-` __...-.-.
|’_.-'| Port: 12311 05:45:46 redis_async_broker.1 | | -._ ._ / _.-' | PID: 2581 05:45:46 redis_async_broker.1 | -._ -._ -./ .-’ .-’
05:45:46 redis_async_broker.1 | |-._-.
-.__.-' _.-'_.-'| 05:45:46 redis_async_broker.1 | | -.
-._ _.-'_.-' | http://redis.io 05:45:46 redis_async_broker.1 | -._ -._-..-'.-’ .-’
05:45:46 redis_async_broker.1 | |-._-.
-.__.-' _.-'_.-'| 05:45:46 redis_async_broker.1 | | -.
-._ _.-'_.-' | 05:45:46 redis_async_broker.1 | -._ -._-.
.-‘_.-’ _.-’
05:45:46 redis_async_broker.1 | -._ -..-’ _.-’
05:45:46 redis_async_broker.1 | -._ _.-' 05:45:46 redis_async_broker.1 | -.
.-’
05:45:46 redis_async_broker.1 |
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.776 # Server started, Redis version 2.8.4
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.776 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
05:45:46 system | async_worker.1 started (pid=2563)
05:45:46 system | worker.1 started (pid=2578)
05:45:46 system | sending SIGTERM to workerbeat.1 (pid 2565)
05:45:46 system | sending SIGTERM to watch.1 (pid 2562)
05:45:46 system | sending SIGTERM to redis_celery.1 (pid 2561)
05:45:46 system | sending SIGTERM to web.1 (pid 2569)
05:45:46 system | sending SIGTERM to async_worker.1 (pid 2563)
05:45:46 system | sending SIGTERM to socketio.1 (pid 2564)
05:45:46 system | sending SIGTERM to redis_async_broker.1 (pid 2566)
05:45:46 system | sending SIGTERM to worker.1 (pid 2578)
05:45:46 system | sending SIGTERM to longjob_worker.1 (pid 2568)
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.782 * The server is now ready to accept connections on port 12311
05:45:46 system | workerbeat.1 stopped (rc=-15)
05:45:46 redis_celery.1 | [2571 | signal handler] (1457934346) Received SIGTERM, scheduling shutdown…
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.905 # User requested shutdown…
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.905 * Saving the final RDB snapshot before exiting.
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.913 * DB saved on disk
05:45:46 redis_celery.1 | [2571] 14 Mar 05:45:46.913 # Redis is now ready to exit, bye bye…
05:45:46 system | redis_celery.1 stopped (rc=-15)
05:45:46 system | watch.1 stopped (rc=-15)
05:45:46 system | web.1 stopped (rc=-15)
05:45:46 system | async_worker.1 stopped (rc=-15)
05:45:46 system | socketio.1 stopped (rc=-15)
05:45:46 redis_async_broker.1 | [2581 | signal handler] (1457934346) Received SIGTERM, scheduling shutdown…
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.958 # User requested shutdown…
05:45:46 redis_async_broker.1 | [2581] 14 Mar 05:45:46.958 # Redis is now ready to exit, bye bye…
05:45:46 system | redis_async_broker.1 stopped (rc=-15)
05:45:46 system | worker.1 stopped (rc=-15)
05:45:46 system | longjob_worker.1 stopped (rc=-15)

This is an issue that happened to me also, with some configuration files. Now what is failing is the redis_cache file, so to set it up there is also a command: bench setup redis-cache

You can have a look at the commands to regenerate these files here if there is a further problem: Regenerate Production Config Files (ERPNext) · frappe/bench Wiki · GitHub

Done. Now the remaining issue is with socketio.
I ran bench setup socketio and go the following errors:

vagrant@vagrant-ubuntu-trusty-32:/vagrant/frappe-bench$ bench setup socketio
/vagrant/frappe-bench
├── cookie@0.2.3
├── redis@2.5.0-1
└─┬ socket.io@1.4.5
└─┬ socket.io-client@1.4.5
└── component-emitter@1.2.0

npm WARN enoent ENOENT: no such file or directory, open ‘/vagrant/frappe-bench/package.json’
npm WARN frappe-bench No description
npm WARN frappe-bench No repository field.
npm WARN frappe-bench No README data
npm WARN frappe-bench No license field.
npm ERR! Linux 3.13.0-79-generic
npm ERR! argv “/usr/bin/nodejs” “/usr/bin/npm” “install” “socket.io” “redis” “express” “superagent” “cookie”
npm ERR! node v5.8.0
npm ERR! npm v3.7.3
npm ERR! path …/mime/cli.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink ‘…/mime/cli.js’ → ‘/vagrant/frappe-bench/node_modules/.bin/mime’
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /vagrant/frappe-bench/npm-debug.log
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/vagrant/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/vagrant/bench-repo/bench/cli.py”, line 487, in _setup_socketio
setup_socketio()
File “/vagrant/bench-repo/bench/utils.py”, line 115, in setup_socketio
exec_cmd(“npm install socket.io redis express superagent cookie”, cwd=bench)
File “/vagrant/bench-repo/bench/utils.py”, line 105, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: npm install socket.io redis express superagent cookie

It seems the ‘frappe’ folder (and Frappe APP) is missing, which is critical and it is maybe an issue of the box, becuase this should be installed with it. Can you confirm it to me looking if there is a folder called ‘frappe’ on /vagrant/frappe-bench/apps?

You are right. I am missing the frappe folder. The only thing in /vagrant/frappe-bench/apps is erpnext.

Then frappe should be installed.
But I don’t know if it will produce a positive result. It is not logical that Erpnext was installed and Frappe not.

Did frappe get installed when you ran vagrant up?

No, I checked and Frappe is also missing.

Interesting. Well, I will see if I can get it to work.
Assuming I cannot, got any recommendations on how else I can get a dev environment running?

Could this error have anything to do with the version of virtual box I am using? I know v.5 was said to have some bugs.

Maybe you could install frappe and erpnext separately in another folder following these steps: GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

Unfortunately I cannot guess why this happens, maybe any member of the team who created the vagrant box can help you about it.

this command doesn’t work for me on ubuntu 14 LTS:

bench setup redis …

Error: No such command “redis-async-broker”.
What should i do ?

Can you tell me the files in the directory you are in?
Also, what commands do you see when you run bench setup?

This is the output of “bench setup”:

Setup bench

Options:
–help Show this message and exit.

Commands:
auto-update Add cronjob for bench auto update
backups Add cronjob for bench backups
config overwrite or make config.json
env Setup virtualenv for bench
nginx generate config for nginx
procfile Setup Procfile for bench start
production setup bench for production
redis generate config for redis cache
socketio Setup node deps for socketio server
sudoers Add commands to sudoers list for execution…
supervisor generate config for supervisor

I believe some changes were made to frappe-bench as the command you
mentioned is no longer a valid command. I no longer have it on my set up
either.

Does ERPNEXT run on your local host when you run bench start?