ERPNext Update Error

Hi Guys,

Switched from Development to Master and tried to update, but get the following error on all vm instances -

Already up-to-date.
fatal: Couldn’t find remote ref v5.0
Unexpected end of command stream
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext/bench-repo/bench/cli.py”, line 56, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/bench-repo/bench/cli.py”, line 236, in update
pull_all_apps()
File “/home/erpnext/bench-repo/bench/app.py”, line 91, in pull_all_apps
exec_cmd(“git pull {rebase} upstream {branch}”.format(rebase=rebase, branch=get_current_branch(app_dir)), cwd=app_dir)
File “/home/erpnext/bench-repo/bench/utils.py”, line 76, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘git pull upstream v5.0’ returned non-zero exit status 1
erpnext@ReadMeBooks-V5-BetaTest:~$ bench update
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
132edab…9b3d42b master → origin/master
Updating 132edab…9b3d42b
Fast-forward
install_scripts/setup_frappe.sh | 12 ++±--------
1 file changed, 3 insertions(+), 9 deletions(-)
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 78 (delta 39), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (78/78), done.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
4ca501e…fa1daaf master → upstream/master
4ca501e…fa1daaf develop → upstream/develop

  • [new tag] v5.0.6 → v5.0.6
    fatal: Couldn’t find remote ref v5.0
    Unexpected end of command stream
    Error: None
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext/bench-repo/bench/cli.py”, line 56, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext/bench-repo/bench/cli.py”, line 236, in update
    pull_all_apps()
    File “/home/erpnext/bench-repo/bench/app.py”, line 91, in pull_all_apps
    exec_cmd(“git pull {rebase} upstream {branch}”.format(rebase=rebase, branch=get_current_branch(app_dir)), cwd=app_dir)
    File “/home/erpnext/bench-repo/bench/utils.py”, line 76, in exec_cmd
    subprocess.check_call(cmd, cwd=cwd, shell=True)
    File “/usr/lib/python2.7/subprocess.py”, line 511, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘git pull upstream v5.0’ returned non-zero exit status 1

Does,

bench switch-to-master
bench update

work?

Hi.
I am already on master.

erpnext@ReadMeBooks-V5-BetaTest:~$ bench switch-to-master
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 35 (delta 11), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (35/35), done.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
fa1daaf…b837efa develop → upstream/develop
Already on ‘master’
Your branch is behind ‘upstream/master’ by 13 commits, and can be fast-forwarded.
Updating 4ca501e…fa1daaf
Fast-forward
frappe/version.py | 2 ±
frappe/boot.py | 2 ±
frappe/desk/query_report.py | 7 ++++±-
frappe/email/doctype/email_account/email_account.py | 12 ++++++++±–
frappe/hooks.py | 2 ±
frappe/public/js/frappe/form/formatters.js | 15 +++++++++++±–
frappe/public/js/frappe/form/link_selector.js | 9 +++++±–
frappe/public/js/frappe/request.js | 40 +++++++++++++++++++++++++++±-----------
frappe/utils/file_manager.py | 2 ±
setup.py | 2 ±
10 files changed, 65 insertions(+), 28 deletions(-)
remote: Counting objects: 191, done.
remote: Compressing objects: 100% (181/181), done.
remote: Total 191 (delta 92), reused 1 (delta 0), pack-reused 10
Receiving objects: 100% (191/191), 90.86 KiB | 156 KiB/s, done.
Resolving deltas: 100% (92/92), done.
From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
521aa2e…1686876 develop → upstream/develop
84e6580…1686876 master → upstream/master

  • [new tag] v5.0.7 → v5.0.7
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • [new tag] v5.0.6 → v5.0.6
    error: Your local changes to the following files would be overwritten by checkout:
    erpnext/hooks.py
    Please, commit your changes or stash them before you can switch branches.
    Aborting
    Error: None
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext/bench-repo/bench/cli.py”, line 56, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext/bench-repo/bench/cli.py”, line 297, in _switch_to_master
    switch_to_master(upgrade=upgrade)
    File “/home/erpnext/bench-repo/bench/app.py”, line 171, in switch_to_master
    switch_branch(‘master’, apps=apps, bench=bench, upgrade=upgrade)
    File “/home/erpnext/bench-repo/bench/app.py”, line 158, in switch_branch
    exec_cmd(“git checkout {branch}”.format(branch=branch), cwd=app_dir)
    File “/home/erpnext/bench-repo/bench/utils.py”, line 76, in exec_cmd
    subprocess.check_call(cmd, cwd=cwd, shell=True)
    File “/usr/lib/python2.7/subprocess.py”, line 511, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘git checkout master’ returned non-zero exit status 1
    erpnext@ReadMeBooks-V5-BetaTest:~$ bench update
    remote: Counting objects: 4, done.
    remote: Compressing objects: 100% (4/4), done.
    remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (4/4), done.
    From GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
    9b3d42b…2e25af2 master → origin/master
    Updating 9b3d42b…2e25af2
    Fast-forward
    bench/release.py | 11 +++++++++±
    1 file changed, 10 insertions(+), 1 deletion(-)
    fatal: Couldn’t find remote ref v5.0
    Unexpected end of command stream
    Error: None
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext/bench-repo/bench/cli.py”, line 56, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext/bench-repo/bench/cli.py”, line 236, in update
    pull_all_apps()
    File “/home/erpnext/bench-repo/bench/app.py”, line 91, in pull_all_apps
    exec_cmd(“git pull {rebase} upstream {branch}”.format(rebase=rebase, branch=get_current_branch(app_dir)), cwd=app_dir)
    File “/home/erpnext/bench-repo/bench/utils.py”, line 76, in exec_cmd
    subprocess.check_call(cmd, cwd=cwd, shell=True)
    File “/usr/lib/python2.7/subprocess.py”, line 511, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘git pull upstream v5.0’ returned non-zero exit status 1

Try,

cd apps/frappe
git reset --hard
cd -
cd apps/erpnext
git reset --hard
cd -
bench switch-to-master
1 Like

This worked.
Thanks pdvyas!

root@ikhlas1:/home/ikhlas1/bench# bench update
You asked me to pull without telling me which branch you
want to merge with, and ‘branch.v0.93.merge’ in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. ‘git pull ’).
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch “v0.93”]
remote =
merge =

[remote "<nickname>"]
url = <url>
fetch = <refspec>

See git-config(1) for details.
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/ikhlas1/bench-repo/bench/cli.py”, line 56, in cli
bench()
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/ikhlas1/bench-repo/bench/cli.py”, line 210, in update
update_bench()
File “/home/ikhlas1/bench-repo/bench/utils.py”, line 188, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/ikhlas1/bench-repo/bench/utils.py”, line 80, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘git pull’ returned non-zero exit status 1
root@ikhlas1:/home/ikhlas1/bench# cd apps/frappe
root@ikhlas1:/home/ikhlas1/bench/apps/frappe# git reset --hard
HEAD is now at 4cc5088 Merge pull request #949 from anandpdoshi/anand-dec-15
root@ikhlas1:/home/ikhlas1/bench/apps/frappe# cd …
root@ikhlas1:/home/ikhlas1/bench/apps# cd erpnext
root@ikhlas1:/home/ikhlas1/bench/apps/erpnext# git reset --hard
fatal: Not a git repository (or any of the parent directories): .git
root@ikhlas1:/home/ikhlas1/bench/apps/erpnext# bench switch-to-master
You should not run this command as root
root@ikhlas1:/home/ikhlas1/bench/apps/erpnext# cd
root@ikhlas1:~# exit
exit
ikhlas1@ikhlas1:~$ cd bhench
bash: cd: bhench: No such file or directory
ikhlas1@ikhlas1:~$ cd bench
ikhlas1@ikhlas1:~/bench$ cd apps/frappe
ikhlas1@ikhlas1:~/bench/apps/frappe$ git reset --hard
HEAD is now at 4cc5088 Merge pull request #949 from anandpdoshi/anand-dec-15
ikhlas1@ikhlas1:~/bench/apps/frappe$ git pull
Updating 4cc5088…0ce600b
error: The following untracked working tree files would be overwritten by merge:
frappe/core/doctype/report/test_records.json
frappe/core/doctype/report/test_report.py
Please move or remove them before you can merge.
Aborting
ikhlas1@ikhlas1:~/bench/apps/frappe$ cd …/erpnext
ikhlas1@ikhlas1:~/bench/apps/erpnext$ git pull
fatal: Not a git repository (or any of the parent directories): .git
ikhlas1@ikhlas1:~/bench/apps/erpnext$
ikhlas1@ikhlas1:~/bench/apps/erpnext$ git reset --hard
fatal: Not a git repository (or any of the parent directories): .git
ikhlas1@ikhlas1:~/bench/apps/erpnext$ git reset
fatal: Not a git repository (or any of the parent directories): .git
ikhlas1@ikhlas1:~/bench/apps/erpnext$ bench switch-to-master
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/ikhlas1/bench-repo/bench/cli.py”, line 56, in cli
bench()
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/ikhlas1/bench-repo/bench/cli.py”, line 297, in _switch_to_master
switch_to_master(upgrade=upgrade)
File “/home/ikhlas1/bench-repo/bench/app.py”, line 171, in switch_to_master
switch_branch(‘master’, apps=apps, bench=bench, upgrade=upgrade)
File “/home/ikhlas1/bench-repo/bench/app.py”, line 145, in switch_branch
version_upgrade = is_version_upgrade(bench=bench, branch=branch)
File “/home/ikhlas1/bench-repo/bench/app.py”, line 97, in is_version_upgrade
fetch_upstream(frappe_dir)
File “/home/ikhlas1/bench-repo/bench/app.py”, line 123, in fetch_upstream
return exec_cmd(“git fetch upstream”, cwd=repo_dir)
File “/home/ikhlas1/bench-repo/bench/utils.py”, line 80, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/lib/python2.7/subprocess.py”, line 506, in check_call
retcode = call(*popenargs, **kwargs)
File “/usr/lib/python2.7/subprocess.py”, line 493, in call
return Popen(*popenargs, **kwargs).wait()
File “/usr/lib/python2.7/subprocess.py”, line 679, in init
errread, errwrite)
File “/usr/lib/python2.7/subprocess.py”, line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory: ‘./apps/frappe’
ikhlas1@ikhlas1:~/bench/apps/erpnext$ cd …/…/
ikhlas1@ikhlas1:~/bench$ bench switch-to-master
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/ikhlas1/bench-repo/bench/cli.py”, line 56, in cli
bench()
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/ikhlas1/bench-repo/bench/cli.py”, line 297, in _switch_to_master
switch_to_master(upgrade=upgrade)
File “/home/ikhlas1/bench-repo/bench/app.py”, line 171, in switch_to_master
switch_branch(‘master’, apps=apps, bench=bench, upgrade=upgrade)
File “/home/ikhlas1/bench-repo/bench/app.py”, line 147, in switch_branch
raise MajorVersionUpgradeException(“Switching to {0} will cause upgrade from {1} to {2}. Pass --upgrade to confirm”.format(branch, version_upgrade[0], version_upgrade[1]), version_upgrade[0], version_upgrade[1])
bench.app.MajorVersionUpgradeException: Switching to master will cause upgrade from 4 to 6. Pass --upgrade to confirm
ikhlas1@ikhlas1:~/bench$