Bench Start Error in Development - Error: No such commands watch serve worker schedule, frappe commands!?

Hi All,

I encountered an error after I run bench start.
My installation is switch from production to development, I strictly followed the steps on Github to switch from production to develop.
My installation is on AWS EC2 fresh instance.
The error code is as below:
frappe@ip-172-31-23-138:~/frappe-bench$ bench start
05:42:01 system | worker_long.1 started (pid=4728)
05:42:01 system | watch.1 started (pid=4727)
05:42:01 system | redis_socketio.1 started (pid=4734)
05:42:01 system | web.1 started (pid=4729)
05:42:01 system | redis_queue.1 started (pid=4732)
05:42:01 system | schedule.1 started (pid=4730)
05:42:01 system | worker_default.1 started (pid=4735)
05:42:01 redis_queue.1 | 4749:C 16 Nov 05:42:01.270 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
05:42:01 redis_socketio.1 | 4744:C 16 Nov 05:42:01.274 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
05:42:01 redis_socketio.1 | 4744:C 16 Nov 05:42:01.276 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=4744, just started
05:42:01 redis_socketio.1 | 4744:C 16 Nov 05:42:01.276 # Configuration loaded
05:42:01 redis_socketio.1 | 4744:M 16 Nov 05:42:01.277 * Increased maximum number of open files to 10032 (it was originally set to 1024).
05:42:01 system | socketio.1 started (pid=4739)
05:42:01 system | redis_cache.1 started (pid=4731)
05:42:01 redis_cache.1 | 4750:C 16 Nov 05:42:01.282 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
05:42:01 redis_queue.1 | 4749:C 16 Nov 05:42:01.282 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=4749, just started
05:42:01 redis_queue.1 | 4749:C 16 Nov 05:42:01.282 # Configuration loaded
05:42:01 redis_queue.1 | 4749:M 16 Nov 05:42:01.283 * Increased maximum number of open files to 10032 (it was originally set to 1024).
05:42:01 redis_queue.1 | 4749:M 16 Nov 05:42:01.284 * Running mode=standalone, port=11000.
05:42:01 redis_queue.1 | 4749:M 16 Nov 05:42:01.284 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
05:42:01 redis_queue.1 | 4749:M 16 Nov 05:42:01.284 # Server initialized
05:42:01 redis_queue.1 | 4749:M 16 Nov 05:42:01.285 * Ready to accept connections
05:42:01 system | worker_short.1 started (pid=4751)
05:42:01 redis_socketio.1 | 4744:M 16 Nov 05:42:01.305 * Running mode=standalone, port=12000.
05:42:01 redis_socketio.1 | 4744:M 16 Nov 05:42:01.305 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
05:42:01 redis_socketio.1 | 4744:M 16 Nov 05:42:01.305 # Server initialized
05:42:01 redis_socketio.1 | 4744:M 16 Nov 05:42:01.306 * Ready to accept connections
05:42:01 redis_cache.1 | 4750:C 16 Nov 05:42:01.308 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=4750, just started
05:42:01 redis_cache.1 | 4750:C 16 Nov 05:42:01.308 # Configuration loaded
05:42:01 redis_cache.1 | 4750:M 16 Nov 05:42:01.309 * Increased maximum number of open files to 10032 (it was originally set to 1024).
05:42:01 redis_cache.1 | 4750:M 16 Nov 05:42:01.310 * Running mode=standalone, port=13000.
05:42:01 redis_cache.1 | 4750:M 16 Nov 05:42:01.310 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
05:42:01 redis_cache.1 | 4750:M 16 Nov 05:42:01.310 # Server initialized
05:42:01 redis_cache.1 | 4750:M 16 Nov 05:42:01.311 * Ready to accept connections
05:42:03 socketio.1 | listening on *: 9000
05:42:03 watch.1 | Usage: bench [OPTIONS] COMMAND [ARGS]…
05:42:03 watch.1 | Try “bench --help” for help.
05:42:03 watch.1 |
05:42:03 watch.1 | Error: No such command “watch”.
05:42:03 web.1 | Usage: bench [OPTIONS] COMMAND [ARGS]…
05:42:03 web.1 | Try “bench --help” for help.
05:42:03 web.1 |
05:42:03 web.1 | Error: No such command “serve”.
05:42:03 worker_short.1 | Usage: bench [OPTIONS] COMMAND [ARGS]…
05:42:03 worker_short.1 | Try “bench --help” for help.
05:42:03 worker_short.1 |
05:42:03 worker_short.1 | Error: No such command “worker”.
05:42:03 schedule.1 | Usage: bench [OPTIONS] COMMAND [ARGS]…
05:42:03 schedule.1 | Try “bench --help” for help.
05:42:03 schedule.1 |
05:42:03 schedule.1 | Error: No such command “schedule”.
05:42:03 worker_default.1 | Usage: bench [OPTIONS] COMMAND [ARGS]…
05:42:03 worker_default.1 | Try “bench --help” for help.
05:42:03 worker_default.1 |
05:42:03 worker_default.1 | Error: No such command “worker”.
05:42:03 worker_long.1 | Usage: bench [OPTIONS] COMMAND [ARGS]…
05:42:03 worker_long.1 | Try “bench --help” for help.
05:42:03 worker_long.1 |
05:42:03 worker_long.1 | Error: No such command “worker”.
05:42:03 system | watch.1 stopped (rc=2)
05:42:03 system | sending SIGTERM to redis_socketio.1 (pid 4734)
05:42:03 system | sending SIGTERM to worker_long.1 (pid 4728)
05:42:03 system | sending SIGTERM to redis_queue.1 (pid 4732)
05:42:03 system | sending SIGTERM to web.1 (pid 4729)
05:42:03 system | sending SIGTERM to schedule.1 (pid 4730)
05:42:03 system | sending SIGTERM to worker_default.1 (pid 4735)
05:42:03 system | sending SIGTERM to socketio.1 (pid 4739)
05:42:03 system | sending SIGTERM to redis_cache.1 (pid 4731)
05:42:03 system | sending SIGTERM to worker_short.1 (pid 4751)
05:42:03 redis_socketio.1 | 4744:signal-handler (1542346923) Received SIGTERM scheduling shutdown…
05:42:03 redis_queue.1 | 4749:signal-handler (1542346923) Received SIGTERM scheduling shutdown…
05:42:03 redis_cache.1 | 4750:signal-handler (1542346923) Received SIGTERM scheduling shutdown…
05:42:03 system | socketio.1 stopped (rc=-15)
05:42:03 system | worker_short.1 stopped (rc=-15)
05:42:03 system | worker_default.1 stopped (rc=-15)
05:42:03 system | web.1 stopped (rc=-15)
05:42:03 system | worker_long.1 stopped (rc=-15)
05:42:03 system | schedule.1 stopped (rc=-15)
05:42:03 redis_queue.1 | 4749:M 16 Nov 05:42:03.590 # User requested shutdown…
05:42:03 redis_queue.1 | 4749:M 16 Nov 05:42:03.590 * Removing the pid file.
05:42:03 redis_queue.1 | 4749:M 16 Nov 05:42:03.590 # Redis is now ready to exit, bye bye…
05:42:03 system | redis_queue.1 stopped (rc=-15)
05:42:03 redis_socketio.1 | 4744:M 16 Nov 05:42:03.611 # User requested shutdown…
05:42:03 redis_socketio.1 | 4744:M 16 Nov 05:42:03.611 * Removing the pid file.
05:42:03 redis_socketio.1 | 4744:M 16 Nov 05:42:03.611 # Redis is now ready to exit, bye bye…
05:42:03 system | redis_socketio.1 stopped (rc=-15)
05:42:03 redis_cache.1 | 4750:M 16 Nov 05:42:03.616 # User requested shutdown…
05:42:03 redis_cache.1 | 4750:M 16 Nov 05:42:03.616 * Removing the pid file.
05:42:03 redis_cache.1 | 4750:M 16 Nov 05:42:03.617 # Redis is now ready to exit, bye bye…
05:42:03 system | redis_cache.1 stopped (rc=-15)

Hopefully the masters can give me some advice as I want to build some application on frappe.
Cheers!
John

Hi Whats the development ram capacity of the server your trying

@Akkash,

It is 1GB. but I have 1GB Swap memory on:

frappe@ip-172-31-23-138:~/frappe-bench$ sudo swapon -s
[sudo] password for frappe:
Filename                                Type            Size    Used    Priority
/extraswap                              file            1048572 256     -2

Try this…

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

and then

bench start

I found just rerun ‘bench update’ to solve the missing frappe commands problem!?

2 Likes

I had the exact same problem: Error: No such command “worker”.

Solved it by just running bench set-default-site SITENAME

I had shut down and restarted the instance. Maybe that config gets reset in some way. bench start worked as normal after that.

1 Like

Here’s another ‘Error: No such command’ case and fix just now:

frappe@erpnext:~/frappe-bench$ bench update
INFO:bench.utils:Updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:Bench Updated!
INFO:bench.utils:./env/bin/pip install Pillow
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (4.0.0)
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow) (0.44)
WARNING: You are using pip version 19.1.1, however version 19.3.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
Backing up sites…
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 66, in get_app_commands
app_command_module = importlib.import_module(app + ‘.commands’)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 82, in
commands = get_commands()
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 78, in get_commands
from .utils import commands as utils_commands
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 300, in
@click.option(‘–type’, ‘import_type’, type=click.Choice([‘Insert’, ‘Update’], case_sensitive=False), default=‘Insert’, help=“Insert New Records or Update Existing Records”)
TypeError: init() got an unexpected keyword argument ‘case_sensitive’
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 66, in get_app_commands
app_command_module = importlib.import_module(app + ‘.commands’)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/commands/init.py”, line 7, in
from frappe.commands import pass_context, get_site
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 82, in
commands = get_commands()
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 78, in get_commands
from .utils import commands as utils_commands
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 300, in
@click.option(‘–type’, ‘import_type’, type=click.Choice([‘Insert’, ‘Update’], case_sensitive=False), default=‘Insert’, help=“Insert New Records or Update Existing Records”)
TypeError: init() got an unexpected keyword argument ‘case_sensitive’
Usage: bench frappe [OPTIONS] COMMAND [ARGS]…

Error: No such command “backup”.

So run bench help that raises a traceback to confirm some missing commands:

frappe@erpnext:~/frappe-bench$ bench --help
Usage: [OPTIONS] COMMAND [ARGS]…

Bench manager for Frappe

Options:
–version
–help Show this message and exit.

Commands:
backup backup site
backup-all-sites backup all sites
config change bench configuration
disable-production Disables production environment for the…
download-translations Download latest translations
exclude-app Exclude app from updating
get-app clone an app from the internet and set it up…
include-app Include app from updating
init Create a New Bench Instance.
install Install system dependancies
migrate-env Migrate Virtual Environment to desired Python…
new-app start a new app
prepare-beta-release Prepare major beta release from develop…
release Release app (internal to the Frappe team)
remote-reset-url Reset app remote url to frappe official
remote-set-url Set app remote url
remote-urls Show apps remote url
remove-app completely remove app from bench
renew-lets-encrypt Renew Let’s Encrypt certificate
restart Restart supervisor processes or systemd units
retry-upgrade
set-default-site Set default site for bench
set-mariadb-host Set MariaDB host for bench
set-nginx-port Set nginx port for site
set-redis-cache-host Set Redis cache host for bench Eg: bench…
set-redis-queue-host Set Redis queue host for bench Eg: bench…
set-redis-socketio-host Set Redis socketio host for bench Eg: bench…
set-ssl-certificate Set ssl certificate path for site
set-ssl-key Set ssl certificate private key path for site
set-url-root Set url root for site
setup Setup bench
shell
src Prints bench source folder path, which can be…
start Start Frappe development processes
switch-to-branch Switch all apps to specified branch, or…
switch-to-develop Switch frappe and erpnext to develop branch
switch-to-master Switch frappe and erpnext to master branch
update Update bench
()
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 31, in cli
print(get_frappe_help())
File “/home/frappe/bench-repo/bench/cli.py”, line 113, in get_frappe_help
return “Framework commands:\n” + out.split(‘Commands:’)[1]

The problem and fix involved click, reference here TypeError: __init__() got an unexpected keyword argument 'case_sensitive' · Issue #335 · bentoml/BentoML · GitHub

frappe@erpnext:~/frappe-bench$ which pip
frappe@erpnext:~/frappe-bench$ pip
-bash: pip: command not found
frappe@erpnext:~/frappe-bench$ source env/bin/activate
(env) frappe@erpnext:~/frappe-bench$ pip install -U click

bench update then ran as expected

edit: switch to use blockquote to list console session output

I have faced a similar issue but I found nothing on the discussion forum, So I’m replying to this old conversation now. just in case someone else faces such issue.

I found out that VS Code has installed black package using frappe env’s pip command. So, I had to manually uninstall the package using ~/frappe-bench/env/bin/pip uninstall black.

Then to make sure all packages are properly set up, I ran bench setup requirements --python.

2 Likes