Bench Update Error in V7

aafpl@ubuntu:/home/frappe/frappe-bench$ sudo bench update
[sudo] password for aafpl:
INFO:bench.utils:updating bench
Already up-to-date.
remote: Counting objects: 66, done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 66 (delta 51), reused 43 (delta 28), pack-reused 0
Unpacking objects: 100% (66/66), done.
From https://github.com/frappe/frappe
3b8f3a5…bab65fd master -> upstream/master

  • [new tag] v7.0.9 -> v7.0.9
  • [new tag] v7.0.8 -> v7.0.8
    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 3b8f3a5…bab65fd
    error: Your local changes to the following files would be overwritten by merge:
    frappe/init.py
    frappe/email/smtp.py
    frappe/model/base_document.py
    frappe/public/css/desk.css
    frappe/public/css/form.css
    frappe/public/css/page.css
    frappe/public/js/frappe/form/formatters.js
    frappe/public/less/desk.less
    frappe/public/less/form.less
    frappe/public/less/page.less
    frappe/website/website_generator.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’, ‘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 90, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull upstream master

Seems you have did some local changes, either commit the changes or stash them.

Thanks, Rohit

we have done no changes, what should be the solution for this ??

System is showing there are changes in some files in frappe repository.

If you are sure that you do not need those changes, you can reset the repository using git reset --hard HEAD

aafpl@ubuntu:/home/frappe/frappe-bench$ sudo git reset --hard HEAD
[sudo] password for aafpl:
fatal: Not a git repository (or any of the parent directories): .git

Same problem here.

I can’t find what directory I need to be in to run git commands

Please run the command from this directory /home/frappe/frappe-bench/apps/frappe.

Getting this when I run bench update

I didn’t change anything (that I know of) so I don’t care to keep the changes.

I ran git status on apps/frappe AND apps/erpnext. Both say “your branch is up-to-date with ‘upstream master’”

How do I get rid of these changes so I can update?

Run the git reset --hard HEAD command for bench repo as well.

1 Like

Thank you, but where is the bench repo? Can’t find it.

EDIT: found it at /.bench

Thank you for your help!

Great … Its working now.

1 Like

Thank you so much for your help.