Cannot update the ERPnext

Cannot update Bench

abc@abc-com:~$ bench update
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 32, in update
patches.run(bench_path=‘.’)
File “/home/frappe/.bench/bench/patches/init.py”, line 21, in run
result = execute(bench_path)
File “/home/frappe/.bench/bench/patches/v3/celery_to_rq.py”, line 7, in execute
frappe_branch = get_current_branch(‘frappe’, bench_path)
File “/home/frappe/.bench/bench/app.py”, line 281, in get_current_branch
return get_cmd_output(“basename $(git symbolic-ref -q HEAD)”, cwd=repo_dir)
File “/home/frappe/.bench/bench/utils.py”, line 367, in get_cmd_output
output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=subprocess.PIPE).strip()
File “/usr/lib/python3.6/subprocess.py”, line 356, in check_output
**kwargs).stdout
File “/usr/lib/python3.6/subprocess.py”, line 423, in run
with Popen(*popenargs, **kwargs) as process:
File “/usr/lib/python3.6/subprocess.py”, line 729, in init
restore_signals, start_new_session)
File “/usr/lib/python3.6/subprocess.py”, line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘./apps/frappe’: ‘./apps/frappe’

Execute the command from your frappe-bench directory.

1 Like

I had to navigate to the frappe-bench directory and change the default user to bench default user by

sudo su - [user]

and then use the command

bench update

All bench commands are supposed to be run in the frappe-bench directory by the frappe user.

1 Like