Bench update is not working for version 12

We are running erp on version 12 and now trying to upgrade to latest version 12.3 but we are getting an error. We have tried individual app git pull then build / migrate / clear cache all command but below error, we are getting.

Executing frappe.patches.v12_0.create_notification_settings_for_user in erp.abc.com (_7ccb36d7574ec6a5)
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 48, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/patches/v12_0/create_notification_settings_for_user.py”, line 11, in execute
create_notification_settings(user.name)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/desk/doctype/notification_settings/notification_settings.py”, line 38, in create_notification_settings
_doc.insert(ignore_permissions=True)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 224, in insert
self.set_new_name()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 392, in set_new_name
set_new_name(self)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/naming.py”, line 42, in set_new_name
set_name_from_naming_options(autoname, doc)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/naming.py”, line 73, in set_name_from_naming_options
_prompt_autoname(autoname, doc)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/naming.py”, line 278, in prompt_autoname
frappe.throw(
(“Name not set via prompt”))
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 364, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 350, in msgprint
_raise_exception()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Name not set via prompt

erpnext@erp:~/frappe-bench$ bench --site erp.abc.com reload-doctype “notification_settings”
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 279, in reload_doctype
frappe.reload_doctype(doctype, force=context.force)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 792, in reload_doctype
reload_doc(scrub(db.get_value(“DocType”, doctype, “module”)), “doctype”, scrub(doctype),
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 818, in scrub
return txt.replace(’ ‘,’
’).replace(’-’, '
’).lower()
AttributeError: ‘NoneType’ object has no attribute ‘replace’
erpnext@erp:~/frappe-bench$

Perhaps rebuild recompile the code may help?

frappe@erpnext:~/frappe-bench$ bench build
frappe@erpnext:~/frappe-bench$ find . -name '*.pyc' -delete

bench build is working but getting same error in bench migrate.

erpnext@erp:~/frappe-bench$ bench migrate
Migrating erp.abc.com
Executing frappe.patches.v12_0.update_auto_repeat_status_and_not_submittable in erp.abc.com (_7ccb36d7574ec6a5)
Success: Done in 0.052s
Executing frappe.patches.v12_0.copy_to_parent_for_tags in erp.abc.com (_7ccb36d7574ec6a5)
Success: Done in 0.014s
Executing frappe.patches.v12_0.create_notification_settings_for_user in erp.abc.com (_7ccb36d7574ec6a5)
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/erpnext/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py”, line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, line 48, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/patches/v12_0/create_notification_settings_for_user.py”, line 11, in execute
create_notification_settings(user.name)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/desk/doctype/notification_settings/notification_settings.py”, line 38, in create_notification_settings
_doc.insert(ignore_permissions=True)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 224, in insert
self.set_new_name()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/document.py”, line 392, in set_new_name
set_new_name(self)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/naming.py”, line 42, in set_new_name
set_name_from_naming_options(autoname, doc)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/naming.py”, line 73, in set_name_from_naming_options
_prompt_autoname(autoname, doc)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/model/naming.py”, line 278, in prompt_autoname
frappe.throw(
(“Name not set via prompt”))
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 364, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 350, in msgprint
_raise_exception()
File “/opt/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Name not set via prompt
erpnext@erp:~/frappe-bench$

“frappe.exceptions.ValidationError: Name not set via prompt”

Does each User have a name specified - the prompt suggests otherwise?

Thanks @clarkej based on your feedback I fixed db issue. After that few more db filed issues faced but I have created filed manually and sorted.

Excellent - if you could contribute a rough idea of what you learned or did - for example you had to poke some value into a table? That would inform others in the same boat and would be an aid if you ever need to recall the details too :wink:

Nothing big sir, in sales orter item and purchase order item table, blanket order filed was not there so I have created manually. After that it was working fine.

Thanks nonetheless to share your pointer will help others resolve such cases too so don’t discount that contribution!

1 Like