Update to 13.10 failed now site is not accessible

Hi all

I did a minor update to 13.10 The update fails and I now have a message “Your system is being updated. Please refresh again after a few moments.”
Changing maintenance mode in settings to 0 doesn’t work.

I have the below traceback.

Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 27, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 306, in migrate
migrate(
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 67, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/add_custom_field_for_south_africa.py”, line 14, in execute
add_permissions()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/south_africa/setup.py”, line 34, in add_permissions
add_permission(doctype, ‘All’, 0)
File “/home/frappe/frappe-bench/apps/frappe/frappe/permissions.py”, line 509, in add_permission
validate_permissions_for_doctype(doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 1074, in validate_permissions_for_doctype
doctype = frappe.get_doc(“DocType”, doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 855, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 75, in get_doc
return controller(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 113, in init
self.load_from_db()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 156, in load_from_db
frappe.throw(
(“{0} {1} not found”).format(
(self.doctype), self.name), frappe.DoesNotExistError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 437, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 416, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 370, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: DocType South Africa VAT Settings not found

Does anyone have any ideas?

I think it has to do with the “feat(regional): South Africa VAT Audit Report” being added in this release.

Hi,

Was this the first attempt at updating ERPNext or has it been successfully updated before? What was the command that was used to update? Does bench update --reset complete?

Hi

It has been updated many times without any issues before. I just run bench update and off it goes. bench update --reset also fails to complete.

Regards

Try this

(replace site name with your site’s name)

$ bench --site sitename reload-doc regional doctype south_africa_vat_settings
$ bench --site sitename reload-doc accounts doctype south_africa_vat_account

Then reattempt updating. Fix for this will be released soon.

1 Like

Hi

I now have the below error

Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 306, in migrate
migrate(
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 67, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/add_custom_field_for_south_africa.py”, line 14, in execute
add_permissions()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/regional/south_africa/setup.py”, line 42, in add_permissions
frappe.get_doc(dict(
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 232, in insert
self._validate_links()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 828, in validate_links
frappe.throw(
(“Could not find {0}”).format(msg),
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 437, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 416, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 370, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.LinkValidationError: Could not find Report: VAT Audit Report

Thanks.

Problem solved. Seems I needed to use @ankush syntax with @EugeneP commands. Weird, but all good now.

bench --force --site sitename reload-doc regional doctype south_africa_vat_settings
bench --force --site sitename reload-doc accounts doctype south_africa_vat_account
bench migrate --skip-failing 
bench update --reset

Thanks for the assistance.