Error on bench update --upgrade

I run bench update --upgrade but this error appears:

INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
You are using pip version 8.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe
 * branch            develop    -> FETCH_HEAD
Updating baea1f6..6724c0c
error: Your local changes to the following files would be overwritten by merge:
	frappe/docs/user/en/guides/app-development/using-html-templates-in-javascript.md
	frappe/docs/user/en/guides/basics/apps.md
	frappe/docs/user/en/guides/basics/site_config.md
	frappe/docs/user/en/guides/deployment/checking-problems-in-bench.md
	frappe/docs/user/en/guides/deployment/configuring-https.md
	frappe/docs/user/en/guides/deployment/email-notifications-for-failed-background-jobs.md
	frappe/docs/user/en/guides/deployment/how-to-change-host-name-from-localhost.md
	frappe/docs/user/en/guides/deployment/how-to-enable-social-logins.md
	frappe/docs/user/en/guides/deployment/index.txt
	frappe/docs/user/en/index.txt
	frappe/docs/user/en/tutorial/index.md
	frappe/handler.py
	frappe/installer.py
	frappe/public/js/lib/flot/excanvas.js
	frappe/public/js/lib/flot/excanvas.min.js
	frappe/public/js/lib/flot/jquery.colorhelpers.js
	frappe/public/js/lib/flot/jquery.flot.crosshair.js
	frappe/public/js/lib/flot/jquery.flot.fillbetween.js
	frappe/public/js/lib/flot/jquery.flot.image.js
	frappe/public/js/lib/flot/jquery.flot.js
	frappe/public/js/lib/flot/jquery.flot.navigate.js
	frappe/public/js/lib/flot/jquery.flot.pie.js
	frappe/public/js/lib/flot/jquery.flot.resize.js
	frappe/public/js/lib/flot/jquery.flot.selection.js
	frappe/public/js/lib/flot/jquery.flot.stack.js
	frappe/public/js/lib/flot/jquery.flot.symbol.js
	frappe/public/js/lib/flot/jquery.flot.threshold.js
	frappe/public/js/lib/fullcalendar/fullcalendar.min.css
	frappe/public/js/lib/fullcalendar/fullcalendar.min.js
	frappe/public/js/lib/fullcalendar/fullcalendar.print.css
	frappe/public/js/lib/fullcalendar/gcal.js
	frappe/public/js/lib/jquery/jquery-ui.min.js
	frappe/public/js/lib/shepherd.min.js
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/forge/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/forge/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/forge/bench-repo/bench/commands/update.py", line 76, in _update
    pull_all_apps(bench_path=bench_path)
  File "/home/forge/bench-repo/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/forge/bench-repo/bench/utils.py", line 90, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull  upstream develop

How to fix this?

i have a similar error:

$ bench update
INFO:bench.utils:updating bench
Updating 29a8b72…0f0a01e
error: Your local changes to the following files would be overwritten by merge:
bench/config/production_setup.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
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/Library/Python/2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/Library/Python/2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/Library/Python/2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Library/Python/2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/Developers/bench-repo/bench/commands/update.py”, line 34, in update
update_bench()
File “/Developers/bench-repo/bench/utils.py”, line 200, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/Developers/bench-repo/bench/utils.py”, line 100, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

but i remplace the production_setup.py with the GitHub, but still have the same error, any one can help ??

note: i guess this is to upgrade to the V7

Guys, have you tried searching the forum first? There is a whole bunch of the threads with the very same issue along with explanations and solutions.

1 Like

The simple answer to fixing this is to go into the folder of the app that’s causing issues (typically apps/erpnext or apps/frappe), and type git reset --hard. It looks as though you’ve made changes to the source files of Frappe/ERPNext, and you need to discard them.

EDIT: If you’ve made customizations to Frappe/ERPNext, don’t do it directly in the source code. Create a custom app and make the changes there.

@Ben_Cornwell_Mott, i never touch the source code. So far I just add some custom fields using ERPN interface. Thats all.

Not sure why you’re getting the issue then, but the git reset --hard should fix it, no?