Not able to update bench

Hi,

Everytime, I update I get this error and I did git stash 10 times in frappe, frappe/frappe and erpnext folder but still the error is coming.

Cannot proceed with update: You have local changes in app “frappe” that are not committed.

Here are your choices:

  1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
  2. Temporarily remove your changes with “git stash” or discard them completely
    with “bench update --reset” or for individual repositries “git reset --hard”
  3. If your changes are helpful for others, send in a pull request via GitHub and
    wait for them to be merged in the core.

Hi @ruchin78, we’re all having the same problem in here for a while:

There are some suggestions, which may work for you – for me they didn’t, but you should try it at least.

try bench update --upgrade --reset it worked for me.

This is working as well, because of the --reset but on the next run, you will have the same error or similiar:

Cannot proceed with update: You have local changes in app "erpnext" that are not committed.

Here are your choices:

1. Merge the erpnext app manually with "git pull" / "git pull --rebase" and fix conflicts.
1. Temporarily remove your changes with "git stash" or discard them completely
	with "bench update --reset" or for individual repositries "git reset --hard"
2. If your changes are helpful for others, send in a pull request via GitHub and
	wait for them to be merged in the core.

Please have a look at the post linked above.

Yes true, I am also facing same issue

Reposting from other post:

I am close to a solution. Actually, I found a solution already.

  1. Go to the directory, either frappe-bench/apps/erpnext or frappe-bench/apps/frappe
  2. Type git status
  3. Check the list of the untracked files. There might be files, which do or don’t belong there.
  4. Type git add --all to track those files
  5. Type git stash
  6. Run bench update
  7. It should run successfully, if not, start over with 1. and repeat for the other directory

On this point you’re already done, but you may want to apply your changes, which you stashed. So continue with 8. if you stashed things, which you consider important.

8 . While you’re still in the folder, either frappe-bench/apps/erpnext or frappe-bench/apps/frappe type git stash apply

Your changes will be applied again, but on the next run, you will run into the same issue like you had before.

So 1. - 7. was the solution we were looking for.

Maybe someone can tell, why “print formats” and “support/web forms” are breaking bench update. These are my files:

erpnext/accounts/print_format/nameofsomeguy/__init__.py
erpnext/accounts/print_format/nameofsomeguy/nameofsomeguy.json
erpnext/accounts/print_format/nameofsomeotherguy/__init__.py
erpnext/accounts/print_format/nameofsomeotherguy/nameofsomeotherguy.json
erpnext/support/web_form/contact/__init__.py
erpnext/support/web_form/contact/contact.js
erpnext/support/web_form/contact/contact.json
erpnext/support/web_form/contact/contact.py
4 Likes

Thanks, Steps 1-7 worked for me

1 Like

That work for me.
Thanks!

1 Like

After all these steps it works but at last i see this error

/home/sarwar/frappe-bench/apps/frappe/frappe/build.js:20
const app_paths = apps.map(app => p(apps_path, app, app)) // base_path of each
^
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Please help.

Backing up sites…
Patching sites…
Migrating hroms.erp2
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Syncing help database…

/home/sarwar/frappe-bench/apps/frappe/frappe/build.js:20
const app_paths = apps.map(app => p(apps_path, app, app)) // base_path of each
^
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

on my site. i need to continue below:

8.a git add --all
8.b bench update --patch