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/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 94, in <module>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 18, in main
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/", 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/", 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/", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 35, in migrate
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 24, in sync_fixtures
    ignore_links=True, overwrite=True)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/", 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/", line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 132, in import_doc
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", 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?



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


This is a bug, my PR is pending merge into master

If it’s urgent please comment lines 17 and 18 in,


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.