Error during bench update

Hi,
I am trying to update the system from 6.27.5. I am getting the following error :
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==2.0.0’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/bench-repo/bench/commands/update.py”, line 26, in update
deprecate_old_config(“.”)
File “/home/erpnext/bench-repo/bench/config/common_site_config.py”, line 122, in deprecate_old_config
put_config(common_site_config, bench_path)
File “/home/erpnext/bench-repo/bench/config/common_site_config.py”, line 38, in put_config
with open(config_path, ‘w’) as f:
IOError: [Errno 13] Permission denied: ‘./sites/common_site_config.json’

After little digging in code it seems that it is not getting the correct path for the file. Can somebody please guide me how to correct this issue?

regards,

Amit

Hi, how are you trying to update ERPNext?

in frappe-bench directory using “bench update”

-Amit

Can you try running chmod 755 on the frappe-bench folder and then run bench update again?

Tried but doesnot help.
If I try to change to code in bench-repo/bench/config/common_site_config to the absolute path instead of bench = “.”, it works but I don’t want to change the code. Moreover now it is complaining “permission denied: ./config.json”. Is there any environment variable/setting that is messed up?

-Amit