Hi Pratik,
As per your suggestion, we have successfully migrated from CGI to WSGI using
https://github.com/webnotes/erpnext/wiki/Migrating-your-erpnext-instance-to-wsgi. But we are getting below error when following instruction from
https://github.com/frappe/frappe-bench#migrating-from-erpnext-version-3. When we ran ./scripts/install.sh migrate_3_to_4 /var/www/erp-prod, we got below error message half way through.
Executing frappe.patches.v4_0.update_custom_field_insert_after in erp-prod (sirius_erp_prod)
Traceback (most recent call last):
File "scripts/3to4.py", line 32, in <module>
migrate(args.site)
File "scripts/3to4.py", line 26, in migrate
latest()
File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 67, in new_fn
return fn(*args, **new_kwargs)
File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 417, in latest
frappe.modules.patch_handler.run_all()
File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
if not run_single(patchmodule = patch):
File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 50, in run_single
return execute_patch(patchmodule, method, methodargs)
File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 66, in execute_patch
frappe.get_attr(patchmodule + ".execute")()
File "/var/www/frappe-bench/apps/frappe/frappe/patches/v4_0/update_custom_field_insert_after.py", line 18, in execute
cf.save()
File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 194, in save
self.run_post_save_methods()
File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 414, in run_post_save_methods
self.run_method("on_update")
File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 387, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 463, in composer
return composed(self, method, *args, **kwargs)
File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 446, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 381, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/custom_field/custom_field.py", line 38, in on_update
validate_fields_for_doctype(self.dt)
File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 186, in validate_fields_for_doctype
validate_fields(frappe.get_meta(doctype).get("fields"))
File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 244, in validate_fields
check_unique_fieldname(d.fieldname)
File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 199, in check_unique_fieldname
frappe.throw(_("Fieldname {0} appears multiple times in rows {1}").format(fieldname, ", ".join(duplicates)))
File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 206, in throw
msgprint(msg, raise_exception=exc)
File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 203, in msgprint
_raise_exception()
File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 187, in _raise_exception
raise raise_exception, msg
frappe.exceptions.ValidationError: Fieldname cost_center appears multiple times in rows 17, 41
Could you please help in resolving this error? In our existing system, we have setup cost_center custom fields for following doctypes:
- Purchase Order Item
- Purchase Receipt Item
Kind regards,
Mayur Patel