Bench update issue on production branch - 12/03

Hi there,

getting an error on bench update for production, it seems not renaming section break and column break correctly on custom fields.

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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    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/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/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/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/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/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/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/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 35, in migrate
    sync_fixtures()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/fixtures.py", line 24, in sync_fixtures
    ignore_links=True, overwrite=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 53, in import_doc
    frappe.modules.import_file.import_file_by_path(f, data_import=True, force=True, pre_process=pre_process, reset_permissions=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 132, in import_doc
    doc.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 233, in insert
    raise e
frappe.exceptions.DuplicateEntryError: (u'Custom Field', u'Item-section_break_0', IntegrityError(1062, u"Duplicate entry 'Item-section_break_0' for key 'PRIMARY'"))

Can someone double check and confirm?

Thx

2 Likes

Please Check Item Custom Field. There may be the duplicate section_break_0 field. please remove that.

Yes,in latest version 10.1.7 this same issue is coming for other Doctypes too, I can not create a new company, It always show that a Company already exists
error screenshot is

i’ve removed, but the update will re-generate it …it seems a bug in the field auto name

Any news on this? cant update production branch because of the issue …

Any hint appreciated …thx

Hi,

This is a bug, my PR is pending merge into master
https://github.com/frappe/frappe/pull/5171

If it’s urgent please comment lines 17 and 18 in,
frappe/frappe/custom/doctype/custom_field/custom_field.py

Or

Use the code change in PR

And run bench migrate

1 Like

:+1: thx

Thanks. This helped me out.

Thanks for posting this issue

Thanks @schilgod, still waiting for the hotfix [fix] Custom Field fieldname setting logic by schilgod · Pull Request #5198 · frappe/frappe · GitHub to be merged…

Hopefully today,

@rmehta FYA please, thanks

Nice work, waiting for the merge.