[v7] switch-to-master

I having issues running update. Site is currently showing Updating. We will be back in a few moments…

Executing erpnext.patches.v6_20x.remove_customer_supplier_roles in site2.local (82e08c4a14)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 610, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 936, 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 936, 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 782, 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 416, in invoke
return callback(*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 163, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v6_20x/remove_customer_supplier_roles.py”, line 15, in execute
d.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 247, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 640, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 601, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 765, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 748, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 595, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 52, in validate
validate_fields(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 439, in validate_fields
check_link_table_options(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 287, in check_link_table_options
frappe.throw(
(“Options must be a valid DocType for field {0} in row {1}”).format(d.label, d.idx))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 284, in throw
msgprint(msg, raise_exception=exc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 277, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 262, in _raise_exception
raise raise_exception, encode(msg)
frappe.exceptions.ValidationError: Options must be a valid DocType for field Payments in row 80
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 61, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 91, in _update
patch_sites(bench=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 132, in patch_sites
run_frappe_cmd(‘–site’, ‘all’, ‘migrate’, bench=bench)
File “/home/frappe/bench-repo/bench/utils.py”, line 491, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (‘–site’, ‘all’, ‘migrate’)

It seem the issue has to do with migration for one of the site

root@erp:/home/frappe/frappe-bench# bench --site site2.local migrate
Migrating site2.local
Executing erpnext.patches.v6_20x.remove_customer_supplier_roles in site2.local(82e08c4a14)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, 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 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, 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 1060, 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 889, 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 534, 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 163, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v6_20x/remove_customer_supplier_roles.py”, line 15, in execute
d.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 247, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 640, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 601, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 765, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 748, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 595, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 52, in validate
validate_fields(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 439, in validate_fields
check_link_table_options(d)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 287, in check_link_table_options
frappe.throw(
(“Options must be a valid DocType for field {0} in row {1}”).format(d.label, d.idx))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 284, in throw
msgprint(msg, raise_exception=exc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 277, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 262, in _raise_exception
raise raise_exception, encode(msg)
frappe.exceptions.ValidationError: Options must be a valid DocType for field Payments in row 80

@kdevloper do you have any customizations?

@saurabh6790 any idea (seems linked to payments)

@rmehta I dont have any customization, I have stashed the css changes I made earlier.
But I want to ask, I have the backup of the sites, what bench process can I make using the backup data for a refresh installation? Will it actually work?

Issues After Changing From Develop to Master

I did not notice earlier that I was running my production site on develop branch, I made a switch to master, It is a multi-site setup (3 sites).
Running Bench Update I kept failing as stated above until I ran the code below.

ALTER TABLE tabDocType DROP COLUMN track_seen;
ALTER TABLE tabDocType DROP COLUMN quick_entry;
ALTER TABLE tabDocType DROP COLUMN beta;

After this bench update worked very fine. However, I see the error message below when I log into ERPNEXT
This error occur when I click Account Module eg http://site1.local/desk#modules/Accounts
http://site1.local/desk#modules/Stock

This is the error I get
Traceback (innermost last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 806, in call
return fn(*args, **newargs)
TypeError: get() takes exactly 1 argument (0 given)

Please can anybody help me out

@rmehta
I have Added a fresh site to the multisite everything works fine when you click on module no errors.
So I have narrowed down that the problem is NOT from the ERPNEXT File or FRAPPE which updates without error.
Please How can I repair the DB for existing site?

Hi @kdevloper
You can find the doctype name, comuln name, label, current option set using query "select parent , fieldname,label,options from tabDocField where fieldtype='Link’and label=‘Payments’ and options not in (select name from tabDocType) "

You can correct that options with valid doctype name

This is for error “frappe.exceptions.ValidationError: Options must be a valid DocType for field Payments in row 80”

Hope above can help you to repair your old DB.

@gangadhar_k
Thanks for your suggestion, I ran the query [quote=“gangadhar_k, post:7, topic:12850”]
"select parent , fieldname,label,options from tabDocField where fieldtype=‘Link’and label=‘Payments’ and options not in (select name from tabDocType) "
[/quote]
The result was empty rows.
I checked my web.error.log, this is what I found
site: site2.local
form: {‘cmd’: u’frappe.desk.moduleview.get’}

Traceback (innermost last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 806, in call
return fn(*args, **newargs)
TypeError: get() takes exactly 1 argument (0 given)

The problem is usually when I try to view module from Old restored(backup) site, I get this error, but for the New created site, there is no error