Please Help! Issue when upgrade from ver 7 to Ver 8

Hi All,

I have an issue when I upgrade from V7 to V8, It will be really appreciated if anyone can help to solve it:

Backing up sites…
Patching sites…
Migrating site1.local
Executing frappe.patches.v8_0.rename_page_role_to_has_role #2017-03-16 in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/john/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/john/frappe-bench/apps/frappe/frappe/commands/site.py”, line 214, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/john/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/john/frappe-bench/apps/frappe/frappe/patches/v8_0/rename_page_role_to_has_role.py”, line 9, in execute
frappe.rename_doc(‘DocType’, ‘Page Role’, ‘Has Role’)
File “/home/john/frappe-bench/apps/frappe/frappe/init.py”, line 668, in rename_doc
return rename_doc(*args, **kwargs)
File “/home/john/frappe-bench/apps/frappe/frappe/model/rename_doc.py”, line 46, in rename_doc
update_link_field_values(link_fields, old, new, doctype)
File “/home/john/frappe-bench/apps/frappe/frappe/model/rename_doc.py”, line 160, in update_link_field_values
single_doc = frappe.get_doc(field[‘parent’])
File “/home/john/frappe-bench/apps/frappe/frappe/init.py”, line 606, in get_doc
return frappe.model.document.get_doc(arg1, arg2)
File “/home/john/frappe-bench/apps/frappe/frappe/model/document.py”, line 49, in get_doc
controller = get_controller(doctype)
File “/home/john/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 35, in get_controller
module = load_doctype_module(doctype, module_name)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 174, in load_doctype_module
app = get_module_app(module)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 197, in get_module_app
return frappe.local.module_app[scrub(module)]
KeyError: u’accounts’

Hi @John_Yao

Kindly run below query in mysql and share the output
1st Query:

select dt as parent, fieldname,
	(select issingle from tabDocType dt
		where dt.name = df.dt) as issingle
from `tabCustom Field` df
where
	df.options='Page Role' and df.fieldtype='Link'

2nd Query:

select ps.doc_type as parent, ps.field_name as fieldname,
			(select issingle from tabDocType dt
			where dt.name = ps.doc_type) as issingle
from `tabProperty Setter` ps
where
	ps.property_type='options' and
	ps.field_name is not null and
	ps.value='Page Role'

Hi rohit,

First query
MariaDB [1bd3e0294da19198]> select dt as parent, fieldname,
→ (select issingle from tabDocType dt
→ where dt.name = df.dt) as issingle
→ from tabCustom Field df
→ where
→ df.options=‘Page Role’ and df.fieldtype=‘Link’
→ \g
Empty set (0.00 sec)

second query
MariaDB [1bd3e0294da19198]> select ps.doc_type as parent, ps.field_name as fieldname,
→ (select issingle from tabDocType dt
→ where dt.name = ps.doc_type) as issingle
→ from tabProperty Setter ps
→ where
→ ps.property_type=‘options’ and
→ ps.field_name is not null and
→ ps.value=‘Page Role’
→ \g
Empty set (0.00 sec)

Anyone knows the issue? just now I tried to restore to a recent backup, but it lead to a internal server error. Luckily I’m using a backup droplet to do so.

Anyone know why this issue happened? Really hope there is a solution for this issue.

Hi All,

I have tried below:

[john@Full-20170605-1gb-sgp1-01 frappe-bench]$ bench --site site1.local console
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
Type “copyright”, “credits” or “license” for more information.

IPython 5.1.0 – An enhanced Interactive Python.
? → Introduction and overview of IPython’s features.
%quickref → Quick reference.
help → Python’s own help system.
object? → Details about ‘object’, use ‘object??’ for extra details.

In [1]: print(frappe.local.module_app)
{u’website’: u’frappe’, u’core’: u’frappe’, u’workflow’: u’frappe’, u’integrations’: u’frappe’, u’custom’: u’frappe’, u’printing’: u’frappe’, u’desk’: u’frappe’, u’geo’: u’frappe’, u’email’: u’frappe’}

Seems there is not u’account’ in the module list. But actually I do have account in my system now. So how to fix this issue?

check modules.txt of ERPNext

/frappe-bench/apps/erpnext/erpnext/modules.txt

Hi @hereabdulla ,

I Opened the file, it is like this:

Accounts
CRM
Buying
Projects
Selling
Setup
HR
Manufacturing
Stock
Support
Utilities
Shopping Cart
Hub Node
Portal
Maintenance
Schools

I have run git pull in both frappe and erpnext directory, and execute bench migrate, then I executed the bench update, it successfully upgrade to 8.1 as shown below:

But when I enter my login page, the login page is spoiled and I can not login as shown below:

The login UI is not shown at all, anyone know how to solve this?

@rohit_w

i seem to have a similar issue, please how do i fix ?

Executing erpnext.patches.v10_0.taxes_issue_with_pos in fforo.clouderp.ng (0c5dba9852058141)
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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/ubuntu/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/ubuntu/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/ubuntu/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/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/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/ubuntu/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/patches/v10_0/taxes_issue_with_pos.py”, line 10, in execute
doc = frappe.get_doc(‘Sales Invoice’, d.name)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 638, in get_doc
return frappe.model.document.get_doc(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 66, in get_doc
controller = get_controller(doctype)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 36, in get_controller
module = load_doctype_module(doctype, module_name)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 177, in load_doctype_module
app = get_module_app(module)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 200, in get_module_app
return frappe.local.module_app[scrub(module)]
KeyError: u’accounts’

Hi,

I suggest you to migrate through export current data, make compulsory changes, and import to another higher version installation with separate virtual server (which I always don’t have time to do, quite time consuming, especially my colleagues are generating data everyday). which is faster than upgrade. There are too many major version missed so a lot of major changes are not applied, even you successfully updated with a lot of errors, some hidden error may still exist, which will give you and your users a lot of headache, so your decision now is pretty important.

Last time I have successfully updated on a duplicated server with a lot of errors, read a lot of forum topic, spending of lot of time, but I can only see a working main page, I can not even login to the system, so I’m kind of give up. My version 7 is working pretty well now. If some day I feel I have to do a upgrade, I would like to pay frappe team to let them upgrade for me (if they accept), as my thanks to their effort also!

Tips: if you already upgraded on your current server and your erpnext is not working any more. You can do a few simple steps to restore, if your server have backup, just restore to any date before applying the upgrade, use the database backup generated by your upgrade (unzip it), use bench mysql enter your database and drop your current database, and restore the database backup will resume your system. I have done this many times :smile: :sweat:.

Notice: even you just updated frappe but not erpnext, an internal server error will occurred (for my case), which gave me a surprise, I thought frappe should downward compatible.

1 Like

Seems issue with packages, can you run the bench setup requirements command first and then run bench migrate command again