bench.utils.CommandFailedError: git pull upstream master

Hi @all
In branch develop this error not raising, I switched to master branch
when I run bench update I get this error

bench@mmerpdemo06:~/erpnext$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up to date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (5.3.0)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/frappe
 * branch                master     -> FETCH_HEAD
Already up to date.
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling frappe_io
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/frappe_io
 * branch            master     -> FETCH_HEAD
Already up to date.
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/erpnext
 * branch                  master     -> FETCH_HEAD
Already up to date.
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling foundation
INFO:bench.utils:git pull  upstream master
From https://github.com/erpnext/foundation
 * branch              master     -> FETCH_HEAD
Already up to date.
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext_shopify
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/erpnext_shopify
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/opt/bench/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/bench/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
  File "/opt/bench/bench-repo/bench/commands/update.py", line 73, in _update
    pull_all_apps(bench_path=bench_path, reset=reset)
  File "/opt/bench/bench-repo/bench/app.py", line 257, in pull_all_apps
    remote=remote, branch=get_current_branch(app, bench_path=bench_path)), cwd=app_dir)
  File "/opt/bench/bench-repo/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull  upstream master

I have no any local changes, I just installed the erpnext

bench@mmerpdemo06:~/erpnext$ cd apps/frappe
bench@mmerpdemo06:~/erpnext/apps/frappe$ git status
On branch master
Your branch is up to date with 'upstream/master'.

nothing to commit, working tree clean
bench@mmerpdemo06:~/erpnext/apps/frappe$ cd ..
bench@mmerpdemo06:~/erpnext/apps$ cd erpnext
bench@mmerpdemo06:~/erpnext/apps/erpnext$ git status
On branch master
Your branch is up to date with 'upstream/master'.

nothing to commit, working tree clean

and this is the log file

bench@mmerpdemo06:~/erpnext/logs$ sudo vim bench.log
[sudo] password for bench:
2018-10-07 04:04:51,924 INFO getting app erpnext
2018-10-07 04:04:51,986 INFO git clone https://github.com/frappe/erpnext  --depth 1 --origin upstream
2018-10-07 04:05:35,481 INFO installing erpnext
2018-10-07 04:05:35,482 INFO ./env/bin/pip install -q  -e ./apps/erpnext --no-cache-dir
2018-10-07 04:07:33,197 INFO getting app foundation
2018-10-07 04:07:33,203 INFO git clone https://github.com/erpnext/foundation --branch master --depth 1 --origin upstream
2018-10-07 04:18:56,541 INFO installing foundation
2018-10-07 04:18:56,541 INFO ./env/bin/pip install -q  -e ./apps/foundation --no-cache-dir
2018-10-07 04:29:57,196 INFO sudo /usr/bin/supervisorctl reread
2018-10-07 04:29:58,070 INFO sudo /usr/bin/supervisorctl update
2018-10-07 05:19:52,351 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-07 05:24:20,450 INFO getting app erpnext_shopify
2018-10-07 05:24:20,453 INFO git clone https://github.com/frappe/erpnext_shopify  --depth 1 --origin upstream
2018-10-07 05:24:28,286 INFO installing erpnext_shopify
2018-10-07 05:24:28,287 INFO ./env/bin/pip install -q  -e ./apps/erpnext_shopify --no-cache-dir
2018-10-07 05:25:40,646 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-07 05:27:37,096 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-07 07:36:11,351 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-07 07:49:20,326 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-07 08:11:42,651 INFO updating bench
2018-10-07 08:11:42,652 INFO git pull
2018-10-07 08:11:54,890 INFO ./env/bin/pip install Pillow
2018-10-07 08:12:02,870 INFO pulling frappe
2018-10-07 08:12:02,877 INFO git pull  upstream master
2018-10-07 08:12:05,870 INFO find . -name "*.pyc" -delete
2018-10-07 08:12:06,086 INFO pulling frappe_io
2018-10-07 08:12:06,092 INFO git pull  upstream master
2018-10-07 08:12:07,634 INFO find . -name "*.pyc" -delete
2018-10-07 08:12:07,655 INFO pulling erpnext
2018-10-07 08:12:07,661 INFO git pull  upstream master
2018-10-07 08:12:13,924 INFO find . -name "*.pyc" -delete
2018-10-07 08:12:14,088 INFO pulling foundation
2018-10-07 08:12:14,094 INFO git pull  upstream master
2018-10-07 08:12:15,506 INFO find . -name "*.pyc" -delete
2018-10-07 08:12:15,550 INFO pulling erpnext_shopify
2018-10-07 08:12:15,556 INFO git pull  upstream develop
2018-10-07 08:12:16,881 INFO find . -name "*.pyc" -delete
2018-10-07 08:12:16,890 INFO ./env/bin/pip install --upgrade pip
2018-10-07 08:12:19,791 INFO ./env/bin/pip install -q -r /opt/bench/bench-repo/requirements.txt
2018-10-07 08:12:25,221 INFO ./env/bin/pip install -q -r ./apps/foundation/requirements.txt
2018-10-07 08:12:26,959 INFO ./env/bin/pip install -q -r ./apps/frappe_io/requirements.txt
2018-10-07 08:12:28,908 INFO ./env/bin/pip install -q -r ./apps/frappe/requirements.txt
2018-10-07 08:12:30,309 INFO ./env/bin/pip install -q -r ./apps/erpnext_shopify/requirements.txt
2018-10-07 08:12:31,558 INFO ./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
2018-10-07 08:12:32,850 INFO yarn install
2018-10-07 08:15:02,953 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-08 04:00:46,949 INFO sudo supervisorctl restart erpnext-workers: erpnext-web:
2018-10-08 04:09:11,272 INFO git config --unset-all remote.upstream.fetch

You have seen this maybe check into that?

What branch is your erpnext_shopify app on? The error seems to suggest that it’s not on master.

2 Likes