Bench update has an error today

I always update frappe using bench update but today. Update has an error

Already up-to-date.
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/chris/bench-repo/bench/", line 60, in cli
  File "/usr/local/lib/python2.7/dist-packages/click/", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/chris/bench-repo/bench/", line 240, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/chris/bench-repo/bench/", line 259, in update
  File "/home/chris/bench-repo/bench/", line 88, 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/chris/bench-repo/bench/", line 104, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull  upstream master

Is there something wrong with the repo?

The error seems to come from your local installation, not from the remote repository.

My guess would be:

  • access rights (you run bench update from another user so you don’t have permissions), or:
  • you accidentaly removed the .git directory from one of the app (like apps/erpnext/.git or apps/frappe/.git)


Guess 1 = I tried to run sudo bench update so that it would have all the access still the same problem.
Guess 2 = I check apps/expnext/.git and app/frappe/.git folder exist.

I think its not my local. I tried to manually git pull upstream master apps/erp/erpnext and apps/frappe/

chris@chris:~/frappe-bench/apps/frappe$ git pull  upstream master
 * branch            master     -> FETCH_HEAD
Already up-to-date.
chris@chris:~/frappe-bench/apps/frappe$ cd ..
chris@chris:~/frappe-bench/apps$ cd erpnext/
chris@chris:~/frappe-bench/apps/erpnext$ git pull  upstream master
 * branch            master     -> FETCH_HEAD
Already up-to-date

Any other ideas?

@NoumirPoutipou ok I found the problem. One of customized app has a .git which causes the problem bitbucket does not like git pull upstream master. Thanks for the help!

Git pull from your custom app folder first then run bench update

1 Like

@jof2jc thanks for the suggestion!