AttributeError: 'NoneType' object has no attribute 'replace'

Hello. I’m happy with ERPNext which we use for production use on a local server.
Anyway we didn’t follow up with updates for a while. We were using version v7.
Recently we took a backup of SQL database. Unfortunately the machine where the ERP was running got stuck and we have no way to access to it.
I’m recently getting mad because we install Erpnext on a fresh new server on Amazon EC2, we then restored the backup we took on V7 and tried to follow and read everything about to not commit mistakes.
Unfortunately after bench migrate command we get this error.
We tried on different machines, I’ve read all the forum looking for help.
I’m not able to solve this.
Please, can you kindly help us?
Thank you

Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 94, in
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 24, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 31, in migrate
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v9_0/”, line 9, in execute
frappe.reload_doctype(‘Student Admission’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 682, in reload_doctype
reload_doc(scrub(db.get_value(“DocType”, doctype, “module”)), “doctype”, scrub(doctype),
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 708, in scrub
return txt.replace(’ ‘,’
‘).replace(’-', '
AttributeError: ‘NoneType’ object has no attribute ‘replace’

If you have installed latest version of ERPNext then you would have to upgrade using bench update first.

1 Like

Hello. Thanks for reply.
I already tried to do bench update but it gives me same error at the end of operation.
For every attempt I do, I always get this error.
I was hoping to bypass this in some way.
I think the best would be some like “updated with error”, but I instead get that it’s not possible to access the frontend.