Bench update shows error - Need help

Hi ,

I ran bench update , before doing that I ran git stash and I am getting this error , please help

Updating frappe                     : [========================================]
Updating erpnext                    : [=============================           ]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/ommi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ommi/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/ommi/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/ommi/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/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ommi/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/ommi/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/commands/site.py", line 182, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.model.sync.sync_all(verbose=verbose)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/sync.py", line 19, in sync_all
    sync_for(app, force, verbose=verbose)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/sync.py", line 43, in sync_for
    import_file_by_path(doc_path, force=force)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 114, in import_doc
    frappe.delete_doc(doc.doctype, doc.name, force=1, ignore_doctypes=ignore, for_reload=True)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/__init__.py", line 613, in delete_doc
    ignore_permissions, flags)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 52, in delete_doc
    doc.run_method("before_reload")
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 606, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 771, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 754, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 600, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 185, in before_reload
    self.preserve_naming_series_options_in_property_setter()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 202, in preserve_naming_series_options_in_property_setter
    make_property_setter(self.name, "naming_series", "options", naming_series[0].options, "Text", validate_fields_for_doctype=False)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 70, in make_property_setter
    property_setter.insert()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 205, in insert
    self.db_insert()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/base_document.py", line 284, in db_insert
    ), d.values())
  File "/home/ommi/frappe-bench/apps/frappe/frappe/database.py", line 137, in sql
    self._cursor.execute(query, values)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
frappe.exceptions.DuplicateEntryError: (u'Property Setter', u'Item-naming_series-options', IntegrityError(1062, "Duplicate entry 'Item-naming_series-options' for key 'PRIMARY'"))
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
  File "/home/ommi/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ommi/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/ommi/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/ommi/bench-repo/bench/utils.py", line 122, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/ommi/bench-repo/bench/utils.py", line 451, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')
ommi@ommi:~/frappe-bench/apps/erpnext/erpnext$

I tried

git fetch origin
git reset --hard origin/develop

in bench repo folder and ran ran bench update from frappe-bench folder

now I am getting

    Migrating site1.local
    Updating frappe                     : [========================================]
    Updating erpnext                    : [=============================           ]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/ommi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
        main()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
        click.Group(commands=commands)(prog_name='bench')
      File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
        return self.main(*args, **kwargs)
      File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
        rv = self.invoke(ctx)
      File "/home/ommi/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/ommi/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/ommi/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/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
        return callback(*args, **kwargs)
      File "/home/ommi/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/ommi/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
        ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/commands/site.py", line 182, in migrate
        migrate(context.verbose, rebuild_website=rebuild_website)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
        frappe.model.sync.sync_all(verbose=verbose)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/sync.py", line 19, in sync_all
        sync_for(app, force, verbose=verbose)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/sync.py", line 43, in sync_for
        import_file_by_path(doc_path, force=force)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 54, in import_file_by_path
        import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 114, in import_doc
        frappe.delete_doc(doc.doctype, doc.name, force=1, ignore_doctypes=ignore, for_reload=True)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/__init__.py", line 613, in delete_doc
        ignore_permissions, flags)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 52, in delete_doc
        doc.run_method("before_reload")
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 606, in run_method
        return Document.hook(fn)(self, *args, **kwargs)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 771, in composer
        return composed(self, method, *args, **kwargs)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 754, in runner
        add_to_return_value(self, fn(self, *args, **kwargs))
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 600, in <lambda>
        fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 185, in before_reload
        self.preserve_naming_series_options_in_property_setter()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 202, in preserve_naming_series_options_in_property_setter
        make_property_setter(self.name, "naming_series", "options", naming_series[0].options, "Text", validate_fields_for_doctype=False)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 70, in make_property_setter
        property_setter.insert()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 205, in insert
        self.db_insert()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/base_document.py", line 284, in db_insert
        ), d.values())
      File "/home/ommi/frappe-bench/apps/frappe/frappe/database.py", line 137, in sql
        self._cursor.execute(query, values)
      File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
        self.errorhandler(self, exc, value)
      File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
        raise errorclass, errorvalue
    frappe.exceptions.DuplicateEntryError: (u'Property Setter', u'Item-naming_series-options', IntegrityError(1062, "Duplicate entry 'Item-naming_series-options' for key 'PRIMARY'"))
    Traceback (most recent call last):
      File "/usr/local/bin/bench", line 9, in <module>
        load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
      File "/home/ommi/bench-repo/bench/cli.py", line 40, in cli
        bench_command()
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
        return self.main(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
        rv = self.invoke(ctx)
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
        return callback(*args, **kwargs)
      File "/home/ommi/bench-repo/bench/commands/update.py", line 60, in update
        _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
      File "/home/ommi/bench-repo/bench/commands/update.py", line 90, in _update
        patch_sites(bench_path=bench_path)
      File "/home/ommi/bench-repo/bench/utils.py", line 122, in patch_sites
        run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
      File "/home/ommi/bench-repo/bench/utils.py", line 451, in run_frappe_cmd
        raise CommandFailedError(args)
    bench.utils.CommandFailedError: ('--site', 'all', 'migrate')
    ommi@ommi:~/frappe-bench$ 

Please help

Running bench migrate gives me this error , please help

ommi@ommi:~/frappe-bench$ bench migrate
Migrating site1.local
Updating frappe                     : [========================================]
Updating erpnext                    : [=============================           ]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/ommi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/ommi/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/ommi/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/ommi/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/ommi/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/ommi/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/ommi/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/commands/site.py", line 182, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/migrate.py", line 29, in migrate
    frappe.model.sync.sync_all(verbose=verbose)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/sync.py", line 19, in sync_all
    sync_for(app, force, verbose=verbose)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/sync.py", line 43, in sync_for
    import_file_by_path(doc_path, force=force)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 114, in import_doc
    frappe.delete_doc(doc.doctype, doc.name, force=1, ignore_doctypes=ignore, for_reload=True)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/__init__.py", line 613, in delete_doc
    ignore_permissions, flags)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/delete_doc.py", line 52, in delete_doc
    doc.run_method("before_reload")
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 606, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 771, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 754, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 600, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 185, in before_reload
    self.preserve_naming_series_options_in_property_setter()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 202, in preserve_naming_series_options_in_property_setter
    make_property_setter(self.name, "naming_series", "options", naming_series[0].options, "Text", validate_fields_for_doctype=False)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 70, in make_property_setter
    property_setter.insert()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 205, in insert
    self.db_insert()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/base_document.py", line 284, in db_insert
    ), d.values())
  File "/home/ommi/frappe-bench/apps/frappe/frappe/database.py", line 137, in sql
    self._cursor.execute(query, values)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
frappe.exceptions.DuplicateEntryError: (u'Property Setter', u'Item-naming_series-options', IntegrityError(1062, "Duplicate entry 'Item-naming_series-options' for key 'PRIMARY'"))
ommi@ommi:~/frappe-bench$

If you can access your frappe account (I am assuming its a test environment) then login via Admin or System Manger and goto “Property Setter” remove the entry with name Item-naming_series_options as the below error is showing that only.

frappe.exceptions.DuplicateEntryError: (u'Property Setter', u'Item-naming_series-options', IntegrityError(1062, "Duplicate entry 'Item-naming_series-options' for key 'PRIMARY'"))

If in case you are stuck UPDATING and cannot access the FRAPPE/ERPNext account, then goto terminal

Goto frappe-bench folder in the terminal and run

bench --site name_of_site mysql
DELETE FROM `tabProperty Setter` WHERE name = 'Item-naming_series-options';

I think it should resolve the issue and should not give this error on bench update. Btw its nothing to do with bench but your database has duplicate items.

6 Likes

Sir @adityaduggal. Thanks a lot for the immense help . I am not able to login so I did running commands in the terminal but it gives me this error , please help

ommi@ommi:~$ bench --site site1.local mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1527
Server version: 10.0.26-MariaDB-1~trusty mariadb.org binary distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [1bd3e0294d]> DELETE FROM `tabProperty Setter` WHERE name = `Item-naming_series-options`;
ERROR 1054 (42S22): Unknown column 'Item-naming_series-options' in 'where clause'
MariaDB [1bd3e0294d]>

@srinivasragav There was a small typo in my previous reply I have edited the same and now you can try again to run that mysql query.

1 Like

Sir @adityaduggal . You are awesome It did the trick , now I could login .

Thanks a lot for the immense help.

1 Like

Thanks but this was just a method to get the update to work, why it was giving the error is something I even don’t know anyhow good you were able to login.

1 Like

Sir @adityaduggal update ran successfully but if I click on item link field it shows this error. I am posting it here since the thread was closed .Please help

    Traceback (most recent call last):
      File "/home/ommi/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
        response = frappe.handler.handle()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
        execute_cmd(cmd)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
        ret = frappe.call(method, **frappe.form_dict)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/__init__.py", line 876, in call
        return fn(*args, **newargs)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/desk/search.py", line 12, in search_link
        search_widget(doctype, txt, query, searchfield=searchfield, page_len=page_len, filters=filters)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/desk/search.py", line 91, in search_widget
        as_list=not as_dict)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/__init__.py", line 1055, in get_list
        return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/db_query.py", line 79, in execute
        result = self.build_and_run()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/db_query.py", line 91, in build_and_run
        args = self.prepare_args()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/db_query.py", line 108, in prepare_args
        self.set_optional_columns()
      File "/home/ommi/frappe-bench/apps/frappe/frappe/model/db_query.py", line 206, in set_optional_columns
        columns = frappe.db.get_table_columns(self.doctype)
      File "/home/ommi/frappe-bench/apps/frappe/frappe/database.py", line 767, in get_table_columns
        return [r[0] for r in self.sql("DESC `tab%s`" % doctype)]
      File "/home/ommi/frappe-bench/apps/frappe/frappe/database.py", line 148, in sql
        self._cursor.execute(query)
      File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
        self.errorhandler(self, exc, value)
      File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
        raise errorclass, errorvalue
    ProgrammingError: (1146, "Table '1bd3e0294d.tabIte' doesn't exist")

@srinivasragav Can you edit your previous post and paste the entire output of the error since it seems to be truncated. I have tried the exact same thing on my test account but I don’t seem to be facing any issue.

This line at the end does not make any sense and hence I was saying its truncated:

ProgrammingError: (1146, "Table '1bd3e0294d.tabIte' doesn't exist")

1 Like

Sir now I am getting a different error , if I try to open item doc I am getting this error

Traceback (most recent call last):
  File "/home/ommi/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/ommi/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/__init__.py", line 876, in call
    return fn(*args, **newargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/rename_doc.py", line 57, in rename_doc
    new_doc.run_method("after_rename", old, new, merge)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 606, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 771, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 754, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/ommi/frappe-bench/apps/frappe/frappe/model/document.py", line 600, in 
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/ommi/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 180, in after_rename
    frappe.db.sql("rename table `tab%s` to `tab%s`" % (old, new))
  File "/home/ommi/frappe-bench/apps/frappe/frappe/database.py", line 148, in sql
    self._cursor.execute(query)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/ommi/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1050, "Table 'tabItem' already exists")

Please help

I think you have 2 item tables as per this last message but this can’t be true, something is else is happening which I am not at all qualified to comment upon. Do you have any custom code running on item table?

1 Like

No Sir @adityaduggal I dont have any such scripts running . Please help , now if that is the case how to delete one table so that I could run with the other table.

Goto the mysql with bench --site sitename mysql and then paste the FULL output of SHOW TABLES;

Also paste the output of the command

SELECT name FROM `tabItem`
1 Like

Sir @adityaduggal many thanks for the immense help and for your continued support sir ,

MariaDB [1bd3e0294d]> SHOW TABLES;
+----------------------------------------+
| Tables_in_1bd3e0294d                   |
+----------------------------------------+
| __Auth                                 |
| __ListSettings                         |
| tabAbout Us Team Member                |
| tabAccount                             |
| tabActivity Cost                       |
| tabActivity Type                       |
| tabAddress                             |
| tabAddress Template                    |
| tabAppraisal                           |
| tabAppraisal Goal                      |
| tabAppraisal Template                  |
| tabAppraisal Template Goal             |
| tabArticles and Magazines              |
| tabAsset                               |
| tabAsset Category                      |
| tabAsset Category Account              |
| tabAsset Movement                      |
| tabAttendance                          |
| tabAuthorization Rule                  |
| tabBOM                                 |
| tabBOM Explosion Item                  |
| tabBOM Item                            |
| tabBOM Operation                       |
| tabBank Reconciliation Detail          |
| tabBatch                               |
| tabBin                                 |
| tabBlock Module                        |
| tabBlog Category                       |
| tabBlog Post                           |
| tabBlogger                             |
| tabBooks                               |
| tabBran                                |
| tabBranch                              |
| tabBrand                               |
| tabBudget                              |
| tabBudget Account                      |
| tabBudget Detail                       |
| tabC-Form                              |
| tabC-Form Invoice Detail               |
| tabCampaign                            |
| tabCheque Print Template               |
| tabCommunication                       |
| tabCompany                             |
| tabCompany History                     |
| tabContact                             |
| tabCooling medium                      |
| tabCost Center                         |
| tabCountry                             |
| tabCurrency                            |
| tabCurrency Exchange                   |
| tabCust                                |
| tabCustom Field                        |
| tabCustom Script                       |
| tabCustome                             |
| tabCustomer                            |
| tabCustomer Group                      |
| tabCustomer Parts                      |
| tabCustomer TC                         |
| tabCustomer TDC                        |
| tabCustomer Tc                         |
| tabCustomer t                          |
| tabCustomerParts                       |
| tabCustomize Form Field                |
| tabDeduction Type                      |
| tabDefaultValue                        |
| tabDelivery Note                       |
| tabDelivery Note Item                  |
| tabDepartment                          |
| tabDependent Task                      |
| tabDepreciation Schedule               |
| tabDesignation                         |
| tabDesktop Icon                        |
| tabDie Sinks                           |
| tabDie detail                          |
| tabDie details                         |
| tabDie detailz                         |
| tabDie info                            |
| tabDie master                          |
| tabDocField                            |
| tabDocPerm                             |
| tabDocShare                            |
| tabDocType                             |
| tabEarning Type                        |
| tabEmail Account                       |
| tabEmail Alert                         |
| tabEmail Alert Recipient               |
| tabEmail Digest                        |
| tabEmail Group                         |
| tabEmail Group Member                  |
| tabEmail Queue                         |
| tabEmail Unsubscribe                   |
| tabEmployee                            |
| tabEmployee Education                  |
| tabEmployee External Work History      |
| tabEmployee Internal Work History      |
| tabEmployee Leave Approver             |
| tabEmployment Type                     |
| tabError Snapshot                      |
| tabEvent                               |
| tabEvent Role                          |
| tabExpense Claim                       |
| tabExpense Claim Detail                |
| tabExpense Claim Type                  |
| tabFile                                |
| tabFiscal Year                         |
| tabFiscal Year Company                 |
| tabFooter Item                         |
| tabGL Entry                            |
| tabGra                                 |
| tabGrad                                |
| tabGrade                               |
| tabGrade spec                          |
| tabHammer                              |
| tabHeat treatment process              |
| tabHoliday                             |
| tabHoliday List                        |
| tabHomepage Featured Product           |
| tabIndustry Type                       |
| tabInspection standard                 |
| tabInstallation Note                   |
| tabInstallation Note Item              |
| tabIssue                               |
| tabItem                                |
| tabItem Attribute                      |
| tabItem Attribute Value                |
| tabItem Customer Detail                |
| tabItem Group                          |
| tabItem Price                          |
| tabItem Quality Inspection Parameter   |
| tabItem Reorder                        |
| tabItem Supplier                       |
| tabItem Tax                            |
| tabItem Variant                        |
| tabItem Variant Attribute              |
| tabItem Website Specification          |
| tabJob Applicant                       |
| tabJob Opening                         |
| tabJournal Entry                       |
| tabJournal Entry Account               |
| tabLanded Cost Item                    |
| tabLanded Cost Purchase Receipt        |
| tabLanded Cost Taxes and Charges       |
| tabLanded Cost Voucher                 |
| tabLead                                |
| tabLeave Allocation                    |
| tabLeave Application                   |
| tabLeave Block List                    |
| tabLeave Block List Allow              |
| tabLeave Block List Date               |
| tabLeave Type                          |
| tabLetter Head                         |
| tabMagazines and Articles              |
| tabMaintenance Schedule                |
| tabMaintenance Schedule Detail         |
| tabMaintenance Schedule Item           |
| tabMaintenance Visit                   |
| tabMaintenance Visit Purpose           |
| tabManufacturer                        |
| tabMaster list of Drawings             |
| tabMaterial Request                    |
| tabMaterial Request Item               |
| tabMaterial master                     |
| tabMode of Payment                     |
| tabMode of Payment Account             |
| tabModule Def                          |
| tabMonthly Distribution                |
| tabMonthly Distribution Percentage     |
| tabNewsletter                          |
| tabNote                                |
| tabOffer Letter                        |
| tabOffer Letter Term                   |
| tabOffer Term                          |
| tabOperation                           |
| tabOpportunity                         |
| tabOpportunity Item                    |
| tabPOS Profile                         |
| tabPacked Item                         |
| tabPacking Slip                        |
| tabPacking Slip Item                   |
| tabPage                                |
| tabPage Role                           |
| tabParty Account                       |
| tabPatch Log                           |
| tabPayment Entry                       |
| tabPayment Entry Deduction             |
| tabPayment Entry Reference             |
| tabPayment Gateway                     |
| tabPayment Gateway Account             |
| tabPayment Reconciliation Invoice      |
| tabPayment Reconciliation Payment      |
| tabPayment Request                     |
| tabPayment Tool Detail                 |
| tabPeriod Closing Voucher              |
| tabPortal Menu Item                    |
| tabPrice List                          |
| tabPrice List Country                  |
| tabPricing Rule                        |
| tabPrint Format                        |
| tabPrint Heading                       |
| tabProcess                             |
| tabProcess Details                     |
| tabProcess details                     |
| tabProcess flow                        |
| tabProduct Bundle                      |
| tabProduct Bundle Item                 |
| tabProduct master                      |
| tabProduction Order                    |
| tabProduction Order Item               |
| tabProduction Order Operation          |
| tabProduction Plan Item                |
| tabProduction Plan Material Request    |
| tabProduction Plan Sales Order         |
| tabProject                             |
| tabProject Task                        |
| tabProject User                        |
| tabProperty Setter                     |
| tabPurchase Invoice                    |
| tabPurchase Invoice Advance            |
| tabPurchase Invoice Item               |
| tabPurchase Order                      |
| tabPurchase Order Item                 |
| tabPurchase Order Item Supplied        |
| tabPurchase Receipt                    |
| tabPurchase Receipt Item               |
| tabPurchase Receipt Item Supplied      |
| tabPurchase Taxes and Charges          |
| tabPurchase Taxes and Charges Template |
| tabQuality Inspection                  |
| tabQuality Inspection Reading          |
| tabQuotation                           |
| tabQuotation Item                      |
| tabQuotation Lost Reason               |
| tabQuotationmaster                     |
| tabRaw material cross section          |
| tabReport                              |
| tabRequest for Quotation               |
| tabRequest for Quotation Item          |
| tabRequest for Quotation Supplier      |
| tabRole                                |
| tabSMS Log                             |
| tabSMS Parameter                       |
| tabSalary Component                    |
| tabSalary Detail                       |
| tabSalary Slip                         |
| tabSalary Slip Deduction               |
| tabSalary Slip Earning                 |
| tabSalary Slip Timesheet               |
| tabSalary Structure                    |
| tabSalary Structure Deduction          |
| tabSalary Structure Earning            |
| tabSales Invoice                       |
| tabSales Invoice Advance               |
| tabSales Invoice Item                  |
| tabSales Invoice Payment               |
| tabSales Invoice Timesheet             |
| tabSales Order                         |
| tabSales Order Item                    |
| tabSales Partner                       |
| tabSales Person                        |
| tabSales Taxes and Charges             |
| tabSales Taxes and Charges Template    |
| tabSales Team                          |
| tabSample Tryout Report                |
| tabScheduler Log                       |
| tabSerial No                           |
| tabSeries                              |
| tabSessions                            |
| tabShipping Rule                       |
| tabShipping Rule Condition             |
| tabShipping Rule Country               |
| tabSingles                             |
| tabSink                                |
| tabStandard Reply                      |
| tabStock Entry                         |
| tabStock Entry Detail                  |
| tabStock Ledger Entry                  |
| tabStock Reconciliation                |
| tabStock Reconciliation Item           |
| tabSupplier                            |
| tabSupplier Quotation                  |
| tabSupplier Quotation Item             |
| tabSupplier Type                       |
| tabTC                                  |
| tabTDC                                 |
| tabTarget Detail                       |
| tabTask                                |
| tabTask Depends On                     |
| tabTax Rule                            |
| tabTerms and Conditions                |
| tabTerritory                           |
| tabTime Log                            |
| tabTime Log Batch                      |
| tabTime Log Batch Detail               |
| tabTimesheet                           |
| tabTimesheet Detail                    |
| tabToDo                                |
| tabTop Bar Item                        |
| tabTranslation                         |
| tabUOM                                 |
| tabUOM Conversion Detail               |
| tabUser                                |
| tabUserRole                            |
| tabVAVE                                |
| tabVersion                             |
| tabWarehouse                           |
| tabWarranty Claim                      |
| tabWeb Form                            |
| tabWeb Form Field                      |
| tabWeb Page                            |
| tabWebsite Item Group                  |
| tabWebsite Slideshow                   |
| tabWebsite Slideshow Item              |
| tabWebsite Theme                       |
| tabWorkflow                            |
| tabWorkflow Action                     |
| tabWorkflow Document State             |
| tabWorkflow State                      |
| tabWorkflow Transition                 |
| tabWorkstation                         |
| tabWorkstation Working Hour            |
| tabbolh                                |
| tabcalculation                         |
| tabcdfd                                |
| tabcus                                 |
| tabcust                                |
| tabcustm                               |
| tabdd                                  |
| tabdm                                  |
| tabelements                            |
| tabhhh                                 |
| tabhtp                                 |
| tabitm                                 |
| tabitme                                |
| tabmill                                |
| tabnerg                                |
| tabnr                                  |
| tabpf                                  |
| tabpmhh                                |
| tabprocess child                       |
| tabprod                                |
| tabqm                                  |
| tabrew                                 |
| tabsink                                |
| tabspl ele mill                        |
| tabspl ele spec                        |
| tabspl ele tst                         |
| tabtc                                  |
| tabtdl                                 |
| tabterf                                |
| tabtrtef                               |
| tabtry                                 |
| tabtry1                                |
| tabtryout                              |
| tabwow                                 |
| tabzv                                  |
+----------------------------------------+
355 rows in set (0.01 sec)

MariaDB [1bd3e0294d]> 

then , running SELECT name FROM tabItem does not show anything

can you please share the output of desc tabItem

1 Like

Sir @neilLasrado . Thanks for responding running this does not show anything , please help even the item icon in the desktop disappeared

MariaDB [1bd3e0294d]> desc tabItem
→

desc tabItem; (use a semicolon after each sql statement)

1 Like