Updating. We will be back in a few moments

Hi Guys,

Check below the error i got while i was updating the erp

Please help because this error it is on the live environment.

Thank you

Running latest for erpnext.erpnext-vm

Executing erpnext.patches.v4_4.make_email_accounts in erpnext.erpnext-vm (erpnext)
Traceback (most recent call last):
File “/home/erpnext/frappe-bench/env/bin/frappe”, line 9, in
load_entry_point(‘frappe==4.0.0’, ‘console_scripts’, ‘frappe’)()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/cli.py”, line 39, in main
ret = run(fn, args)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/cli.py”, line 83, in run
out = globals().get(fn)(**args)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/cli.py”, line 67, in new_fn
return fn(*args, **new_kwargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/cli.py”, line 448, in latest
frappe.modules.patch_handler.run_all()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/erpnext/frappe-bench/apps/erpnext/erpnext/patches/v4_4/make_email_accounts.py”, line 49, in execute
account.insert()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 175, in insert
self.db_insert()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 242, in db_insert
), d.values())
File “/home/erpnext/frappe-bench/apps/frappe/frappe/database.py”, line 129, in sql
self._cursor.execute(query, values)
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
frappe.exceptions.NameError: (‘Email Account’, u’Support’, IntegrityError(1062, “Duplicate entry ‘Support’ for key ‘PRIMARY’”))
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/frappe/bench-repo/bench/cli.py”, line 29, in cli
return 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/frappe/bench-repo/bench/cli.py”, line 130, in update
patch_sites()
File “/home/frappe/bench-repo/bench/utils.py”, line 81, in patch_sites
exec_cmd(“{frappe} --latest all”.format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, ‘sites’))
File “/home/frappe/bench-repo/bench/utils.py”, line 59, 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 ‘/home/erpnext/frappe-bench/env/bin/frappe --latest all’ returned non-zero exit status 1

Hi Gents,

I ran bench update and automatically updated to version 5.

I don’t know why, but i tried to login and it is not loaded the website.

Can you help please?

@artemiout_a
Either your bench is very old or doesn’t update itself on bench update

You can revert back to version 4 by restoring a backup (for a fairly new version of bench, it runs backup on bench update)

bench switch-to-master
bench frappe --restore erpnext {select_latest_backup_file} -f
bench update --bench
bench update

to get {select_latest_backup_file},

cp /home/erpnext/frappe-bench/sites/erpnext/private/backups/{select_latest_backup_file}.sql.gz /tmp
cd /tmp
gunzip {select_latest_backup_file}.sql.gz
1 Like