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/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, 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/core.py”, 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/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v9_0/student_admission_childtable_migrate.py”, line 9, in execute
frappe.reload_doctype(‘Student Admission’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, 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/init.py”, line 708, in scrub
return txt.replace(’ ‘,’
‘).replace(’-', '
').lower()
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.