Bench Update Failure Issues (Python 2.7)

I ran my typical bench update and seem to have run in to a hurdle with some older python 2.7 dependencies. PIP upgrades fail when run manually as well.

I tried running bench update --patch to see if this would clear us to try again but no luck.

I seem to recall that we have a similar issue when we update from V11 to V12. I don’t recall how we progressed beyond this issue. Does anyone have a permanent solution?

Error output reads as follows:

Exception:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/local/lib/python2.7/dist-packages/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py”, line 784, in install
**kwargs
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py”, line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py”, line 1064, in move_wheel_files
isolated=self.isolated,
File “/usr/local/lib/python2.7/dist-packages/pip/wheel.py”, line 247, in move_wheel_files
prefix=prefix,
File “/usr/local/lib/python2.7/dist-packages/pip/locations.py”, line 153, in distutils_scheme
i.finalize_options()
File “/usr/lib/python2.7/distutils/command/install.py”, line 357, in finalize_options
self.create_home_path()
File “/usr/lib/python2.7/distutils/command/install.py”, line 593, in create_home_path
os.makedirs(path, 0700)
File “/usr/lib/python2.7/os.py”, line 150, in makedirs
makedirs(head, mode)
File “/usr/lib/python2.7/os.py”, line 150, in makedirs
makedirs(head, mode)
File “/usr/lib/python2.7/os.py”, line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: ‘/home/frappe/.local/lib’
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 42, in cli
bench_command()
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 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 “/home/frappe/.bench/bench/commands/update.py”, line 68, in update
_update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
File “/home/frappe/.bench/bench/commands/update.py”, line 91, in _update
update_requirements(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 480, in update_requirements
update_bench_requirements()
File “/home/frappe/.bench/bench/utils.py”, line 466, in update_bench_requirements
install_requirements(bench_req_file, user=True)
File “/home/frappe/.bench/bench/utils.py”, line 557, in install_requirements
exec_cmd(“{python} -m pip install {user_flag} -q -U -r {req_file}”.format(python=python, user_flag=user_flag, req_file=req_file))
File “/home/frappe/.bench/bench/utils.py”, line 194, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: /usr/bin/python -m pip install --user -q -U -r /home/frappe/.bench/requirements.txt
frappe@av8-erpnext-2018-1564441790819-s-1vcpu-2gb-sfo2-01:~/frappe-bench$ bench update --patch bench update
Usage: bench update [OPTIONS]

It may help to say the operating environment and when you last updated successfully.

I might try: bench migrate-env python3 and bench update requirements and try the update again.

1 Like

Sorry, we are running Ubuntu 16.04 on DigitalOcean. Currently, we are at ERPNext version 12.1.8 and Frappe version 12.0.18.

We had this similar issue when we last updated from version 11 to 12. Unfortunately I don’t recall what we did in order to get past this step but I was able to get past this once before about 4 months ago when we updated to v12.

It seems that there are some issues with the bench update still seeing some python 2.7 dependencies. I ran bench migrate-env python3 and it was successful. However when I ran bench update --requirements it fails.

Can you share the output of that command?

Sorry, I need to clairify:

When I run bench migrate-env python3 doesn’t complete, but running bench migrate-env python3.5 is successful.

When I run bench update --requirements it does complete.

However, when I run bench update it still fails. This is the output:

Exception:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/local/lib/python2.7/dist-packages/pip/commands/install.py”, line 342, in run
prefix=options.prefix_path,
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py”, line 784, in install
**kwargs
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py”, line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py”, line 1064, in move_wheel_files
isolated=self.isolated,
File “/usr/local/lib/python2.7/dist-packages/pip/wheel.py”, line 247, in move_wheel_files
prefix=prefix,
File “/usr/local/lib/python2.7/dist-packages/pip/locations.py”, line 153, in distutils_scheme
i.finalize_options()
File “/usr/local/lib/python2.7/dist-packages/setuptools/command/install.py”, line 38, in finalize_options
orig.install.finalize_options(self)
File “/usr/lib/python2.7/distutils/command/install.py”, line 357, in finalize_options
self.create_home_path()
File “/usr/lib/python2.7/distutils/command/install.py”, line 593, in create_home_path
os.makedirs(path, 0700)
File “/usr/lib/python2.7/os.py”, line 150, in makedirs
makedirs(head, mode)
File “/usr/lib/python2.7/os.py”, line 150, in makedirs
makedirs(head, mode)
File “/usr/lib/python2.7/os.py”, line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: ‘/home/frappe/.local/lib’
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 42, in cli
bench_command()
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 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 “/home/frappe/.bench/bench/commands/update.py”, line 68, in update
_update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
File “/home/frappe/.bench/bench/commands/update.py”, line 91, in _update
update_requirements(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 480, in update_requirements
update_bench_requirements()
File “/home/frappe/.bench/bench/utils.py”, line 466, in update_bench_requirements
install_requirements(bench_req_file, user=True)
File “/home/frappe/.bench/bench/utils.py”, line 557, in install_requirements
exec_cmd(“{python} -m pip install {user_flag} -q -U -r {req_file}”.format(python=python, user_flag=user_flag, req_file=req_file))
File “/home/frappe/.bench/bench/utils.py”, line 194, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: /usr/bin/python -m pip install --user -q -U -r /home/frappe/.bench/requirements.txt