Bench update aborting with error

Hi,

I got these error when trying to update my test server, running on Ubuntu 16.04 at Google Cloud. There is nothing fancy on this server, it is barely ‘fresh install’. My current erpnext version is 7.0.28 & frappe is 7.0.22.

Any advise? Thank you in advance.

-Lucky

frappe@testserver:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
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
Updating 8c5fb22..ce5cebd
error: Your local changes to the following files would be overwritten by merge:
        frappe/__init__.py
        frappe/commands/scheduler.py
        frappe/core/doctype/communication/communication_list.js
        frappe/core/doctype/role/role.js
        frappe/core/page/data_import_tool/exporter.py
        frappe/custom/doctype/property_setter/property_setter.py
        frappe/docs/user/en/bench/guides/stop-production-and-start-development.md
        frappe/docs/user/en/bench/resources/bench-commands-cheatsheet.md
        frappe/model/delete_doc.py
        frappe/modules/patch_handler.py
        frappe/patches.txt
        frappe/public/js/frappe/list/doclistview.js
        frappe/public/js/frappe/model/meta.js
        frappe/public/js/frappe/ui/listing.js
        frappe/public/js/frappe/views/breadcrumbs.js
        frappe/public/js/frappe/views/reports/reportview.js
        frappe/utils/__init__.py
        frappe/website/router.py
Please, commit your changes or 
```stash them before you can merge.
Aborting
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    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 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/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/frappe/.bench/bench/commands/update.py", line 76, in _update
    pull_all_apps(bench_path=bench_path)
  File "/home/frappe/.bench/bench/app.py", line 148, 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

That’s odd. Did you modify some files in the code?

Nonetheless, just go into the frappe-bench/apps/frappe directory and run git reset --hard and try updating from the frappe-bench directory again. If you get a similar error for erpnext, then run the same git command above in the erpnext app folder. This will remove all the changes in the files.

1 Like

No, I did not change any source code. But running $ git reset --hard at ~/frappe-bench/apps/erpnext did solve the issue.

Thank you for your suggestion.

-Lucky