Unable to update Bench

I have faced this earlier and again stuck with same issue. Though i was able to update when I setup a fresh new server but suddenly now it has stopped working. I get following error when I try to update bench:

INFO:bench.utils:updating bench
Already up-to-date.
From https://github.com/frappe/frappe
   b2ca70a..1315cfe  develop    -> upstream/develop
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
Updating a1e9b4d..7b905cc

Please note, I log-in with a user (not frappe user) with sudo privileges and when I use the command bench update it throws “Permission Denied” error. So I have been using sudo bench update since beginning of the server setup and it was working fine. I didn’t changed anything on the server but suddenly the pull request from GitHub seems to have stopped working.

Any suggestion to resolve would be highly appreciated!


Here is the traceback:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __ca                                                                                        ll__
    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 inv                                                                                        oke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invo                                                                                        ke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invo                                                                                        ke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, n                                                                                        o_backup, upgrade, force=force)
  File "/home/frappe/.bench/bench/commands/update.py", line 76, in _update
  File "/home/frappe/.bench/bench/app.py", line 140, in pull_all_apps
    remote=remote, branch=get_current_branch(app, bench_path=bench_path)), cwd=a                                                                                        pp_dir)
  File "/home/frappe/.bench/bench/utils.py", line 127, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull  upstream master

looks like you have made changes in the frappe apps, first commit your changes and the try bench update

Thanks, Makarand

Hi @makarand_b

I did not make any change intentionally. I just update the server from a shell script and backup my files on AWS-S3. I am not sure what I would have changed other than setting up the company details and products etc in ERPNext.

Can you please elaborate “Commit your changes”. How to find what has changed and how to commit those changes from terminal? I am on DigitalOcean (Ubuntu 14.04.5) x64.

Sorry for this repeat thread. Found answer in this thread