[v8] Cannot upgrade from 8.0.14 to 8.0.15

Hello. I’m trying to upgrade my erpnext from v8.0.14 to 8.0.15 and I got the following errors. My last upgrade worked smoothly without any error. But it seems this time there is some problem with the new update. Please take a look:

`root@vps108358:/home/frappe/frappe-bench# bench update --upgrade
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    remote: Counting objects: 11, done.
    remote: Compressing objects: 100% (11/11), done.
    remote: Total 11 (delta 3), reused 0 (delta 0), pack-reused 0
    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 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/python2.7/dist-packages/click/core.py”, line 722, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/.bench/bench/commands/update.py”, line 62, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force, reset=reset)
    File “/home/frappe/.bench/bench/commands/update.py”, line 78, in _update
    pull_all_apps(bench_path=bench_path, reset=reset)
    File “/home/frappe/.bench/bench/app.py”, line 170, in pull_all_apps
    remote=remote, branch=get_current_branch(app, bench_path=bench_path)), cwd=app_dir)
    File “/home/frappe/.bench/bench/utils.py”, line 130, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull upstream master`

Does user has permission to write in apps/frappe ?

Yes Im using root user

try this

cd apps/erpnext
chmod -R g+ws .git
chown -R myuser:mygroup .git

change myuser and mygroup to your user and group
then bench update should work

Hello sir,
I followed your steps but it is sill not working.

well i had an error in my last reply (and I’ve already edited)

cd apps/erpnext
chmod -R g+ws .git
chown -R myuser:mygroup .git

change myuser and mygroup to your user and group
then bench update should work

If the error exactly the same right now?

if this doesn’t work you could always do a git clone of erpnext and copy into apps/ and then bench update should work

Hello sir,
The error now is:

error: cannot open .git/FETCH_HEAD: Permission denied

this should work, are you sure about the user and group? I cannot help more.

Thank you very much sir, it’s perfectly working now. I thought the user must be root, because I was using root. But it must be “frappe:1001”. Now the system is up to date

As a point of note, you should sudo to the erpnext user and do all updates there. Don’t operate as root.

Thank you