ERPNext Update Failed git pull problem

I just try to update ERPNext

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
fatal: refusing to merge unrelated histories
Traceback (most recent call last):
File “/opt/bitnami/apps/erpnext/htdocs/venv/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/cli.py”, line 40, in cli
bench_command()
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/commands/update.py”, line 34, in update
update_bench()
File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/utils.py”, line 254, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/utils.py”, line 153, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

I think I just destroyed whole ERP system haha hahaha :frowning:

Do a web search for this message, you should be able to figure out why this fails.

1 Like

Firstly, Thank you so much for helping.

Secondly, I searched in web actualy somewhere in web someone says use “git --hard reset” then “git pull” but this didn’t work. I still can’t figure out why.

I need ask another question. The directory structure is different because of bitnami. Can it be problem for future? Thanks.

I don’t think that bitnami name gives issues.

Do go ahead and try “bench update --reset”.

I faced several times of requiring to do “bench update --reset” till I figured out that I was making changes to the core DocTypes and not making changes via Customize Form or Permissions Manager.

1 Like
  • [new tag] v2.1 → v2.1
  • [new tag] v3.0 → v3.0
  • [new tag] v4.0 → v4.0
    fatal: refusing to merge unrelated histories
    Traceback (most recent call last):
    File “/opt/bitnami/apps/erpnext/htdocs/venv/bin/bench”, line 11, in
    load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
    File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/cli.py”, line 40, in cli
    bench_command()
    File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 764, in call
    return self.main(*args, **kwargs)
    File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 717, in main
    rv = self.invoke(ctx)
    File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
    return callback(*args, **kwargs)
    File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/commands/update.py”, line 34, in update
    update_bench()
    File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/utils.py”, line 254, in update_bench
    exec_cmd(“git pull”, cwd=cwd)
    File “/opt/bitnami/apps/erpnext/htdocs/bench/bench/utils.py”, line 153, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull

Firstly even I switched to root user bench says Permission Denied :frowning: .
After I type “sudo chmod -R 777 *” and switch to root it worked but this time again there is an error that I pasted above. Thanks anyway for helping

I write this command in frappe-bench directory

"cd ./env/src/pdfkit && git reset --hard && cd …/…/… && cd ./apps/erpnext && git reset --hard && cd …/… && cd ./apps/frappe && git reset --hard && cd …/…
"

And I try again “bench update --reset”

But again it raises git pull error.

Please help.

Is there anyway to add “–allow-unrelated-histories” to bench update command?

Okay forgot it. I just transfer my settings, users,projects and task to new v11 ERPNext setup(without bitnami) how can I do this? My old ERPNext is bitnami and v10. Please help.