Update ERPNext to latest version 13

I am using ERPNext: v13.36.3 and Frappe Framework: v13.37.0 in AWS EC2.
I want to update ERPNext to the latest version 13.
when i run “bench update --patch” in frappe-bench, i get the following error:

ERROR: Command 'basename $(git symbolic-ref -q HEAD)' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/opt/bitnami/erpnext/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/opt/bitnami/erpnext/bench/bench/cli.py", line 127, in cli
    bench_command()
  File "/opt/bitnami/erpnext/venv/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/bitnami/erpnext/venv/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/bitnami/erpnext/venv/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bitnami/erpnext/venv/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/bitnami/erpnext/venv/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/bitnami/erpnext/bench/bench/commands/update.py", line 59, in update
    update(
  File "/opt/bitnami/erpnext/bench/bench/utils/bench.py", line 407, in update
    validate_branch()
  File "/opt/bitnami/erpnext/bench/bench/utils/bench.py", line 601, in validate_branch
    branch = get_current_branch(app)
  File "/opt/bitnami/erpnext/bench/bench/utils/app.py", line 175, in get_current_branch
    return get_cmd_output("basename $(git symbolic-ref -q HEAD)", cwd=repo_dir)
  File "/opt/bitnami/erpnext/bench/bench/utils/__init__.py", line 214, in get_cmd_output
    output = subprocess.check_output(
  File "/opt/bitnami/python/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/opt/bitnami/python/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'basename $(git symbolic-ref -q HEAD)' returned non-zero exit status 1.

How to solve the problem?

Hi,

Was this the attempt to update or has the instance been updated successfully in the past?

1 Like

Have a look here
https://discuss.frappe.io/t/v7-bench-update-non-zero-exit-error/14885/7

You are using python 3.8… maybe update that to 3.10+

Last thing…try
bench update --reset

1 Like

this is the first attempt.

I installed Python-3.11.3
Now my site crashed and i am seeing only below error in my site:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at you@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

After installing python 3.11 did the site work as expected?

Did this error happen after an update etc?

After installing python 3.11.3 the site didn’t work.
it happened after the update.

If you have a backup of the site it may be easier to reinstall version 13 and restore it. If that isn’t possible then check that the EC2 has sufficient resources to operate ERPNext and check your git status for the apps.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.