Error while updating to latest version

When I have tried to update in latest version, system want sudo password of frappe from me

[sudo] password for frappe:
Sorry, user frappe is not allowed to execute ‘/usr/bin/supervisorctl status’ as root on trademode.

After providing password I get this error :slight_smile

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, 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-repo/bench/commands/update.py”, line 61, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 97, in _update
restart_supervisor_processes(bench=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 303, in restart_supervisor_processes
supervisor_status = subprocess.check_output([‘sudo’, ‘supervisorctl’, ‘status’], cwd=bench)
File “/usr/lib/python2.7/subprocess.py”, line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command ‘[‘sudo’, ‘supervisorctl’, ‘status’]’ returned non-zero exit status 1

Please help

Can anyone help please ?

Your sudo password did not work?

sudo password of my root user ? . I don’t have password I,m using ssh_key

Now I,m getting his error while updating

Already up-to-date.
INFO:bench.app:pulling erpnext
remote: Counting objects: 25, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 25 (delta 11), reused 10 (delta 10), pack-reused 8
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, 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-repo/bench/commands/update.py”, line 61, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 77, in _update
pull_all_apps(bench=bench_path)
File “/home/frappe/bench-repo/bench/app.py”, line 94, in pull_all_apps
exec_cmd(“git pull {rebase} upstream {branch}”.format(rebase=rebase, branch=get_current_branch(app, bench=bench)), cwd=app_dir)
File “/home/frappe/bench-repo/bench/utils.py”, line 100, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull upstream master

This seems like permission issues, did you execute some commands as root user before?

If you execute “ll” in your frappe-bench folder you should see that your normal user is the owner of the folders and files under it.

Regards

Thanks a lot man for your replay … Here is my output of that command . I,m novice about command line . How can I solve that ?

drwxrwxr-x 8 frappe frappe 4096 May 27 08:06 ./
drwxr-xr-x 7 frappe frappe 4096 Jan 5 01:56 …/
drwxrwxr-x 4 frappe frappe 4096 Jan 5 01:55 apps/
drwxrwxr-x 3 frappe frappe 4096 May 27 08:06 config/
drwxrwxr-x 10 frappe frappe 4096 Jan 5 01:55 env/
drwxrwxr-x 2 frappe frappe 4096 Jan 5 06:00 logs/
drwxrwxr-x 7 frappe frappe 4096 Jan 5 01:56 node_modules/
-rw-r–r-- 1 frappe frappe 69 Jun 5 04:02 patches.txt
-rw-rw-r-- 1 frappe frappe 362 Jan 5 01:55 Procfile
drwxrwxr-x 4 frappe frappe 4096 May 24 05:43 sites/

Could you check the same in …/frappe-bench/apps/erpnext

Regards

Here is my complete output

root@trademode:/home/frappe/frappe-bench# ll
total 40
drwxrwxr-x 8 frappe frappe 4096 May 27 08:06 ./
drwxr-xr-x 7 frappe frappe 4096 Jan 5 01:56 …/
drwxrwxr-x 4 frappe frappe 4096 Jan 5 01:55 apps/
drwxrwxr-x 3 frappe frappe 4096 May 27 08:06 config/
drwxrwxr-x 10 frappe frappe 4096 Jan 5 01:55 env/
drwxrwxr-x 2 frappe frappe 4096 Jan 5 06:00 logs/
drwxrwxr-x 7 frappe frappe 4096 Jan 5 01:56 node_modules/
-rw-r–r-- 1 frappe frappe 69 Jun 5 04:02 patches.txt
-rw-rw-r-- 1 frappe frappe 362 Jan 5 01:55 Procfile
drwxrwxr-x 4 frappe frappe 4096 May 24 05:43 sites/
root@trademode:/home/frappe/frappe-bench# cd apps/erpnext/
root@trademode:/home/frappe/frappe-bench/apps/erpnext# ll
total 100
drwxrwxr-x 7 frappe frappe 4096 May 27 08:22 ./
drwxrwxr-x 4 frappe frappe 4096 Jan 5 01:55 …/
-rw-rw-r-- 1 frappe frappe 200 Jan 5 01:56 attributions.md
-rw-rw-r-- 1 frappe frappe 3035 Jan 5 01:56 CONTRIBUTING.md
drwxrwxr-x 26 frappe frappe 4096 Jun 2 02:29 erpnext/
drwxrwxr-x 2 frappe frappe 4096 Jan 5 01:56 erpnext.egg-info/
drwxrwxr-x 8 frappe frappe 4096 Jun 2 02:29 .git/
-rw-r–r-- 1 frappe frappe 112 Apr 5 03:53 .gitignore
-rw-rw-r-- 1 frappe frappe 28902 Jan 5 01:56 license.txt
-rw-rw-r-- 1 frappe frappe 532 Jan 5 01:56 MANIFEST.in
-rw-r–r-- 1 frappe frappe 4588 Jan 26 05:57 README.md
-rw-rw-r-- 1 frappe frappe 17 Jan 5 01:56 requirements.txt
-rw-r–r-- 1 frappe frappe 509 May 27 08:22 setup.py
-rw-rw-r-- 1 frappe frappe 1708 Jan 5 01:56 sponsors.md
drwxrwxr-x 3 frappe frappe 4096 Jan 5 01:56 test_sites/
drwxr-xr-x 2 frappe frappe 4096 May 27 08:22 travis/
-rw-r–r-- 1 frappe frappe 1266 May 27 08:22 .travis.yml
root@trademode:/home/frappe/frappe-bench/apps/erpnext#

Permissions seem to be ok at both levels, if this is just a dev setup with no important data I would suggest to create a new site and test if it’s working.

I see that you are logged as root and I think that is not advisable as it can mess up the permission, only the installation of bench should be done as root, from then on you should use frappe user. This can be cause of your problem but it’s difficult to determine the root cause of your problem