pymysql.err.InternalError: (1069, u'Too many keys specified; max 64 keys allowed') v12 branch

So I was able to install Frappe and ERP from v10 to v12 branch.
Aldo, I was able to restore database from V10.

What really gives me an error are the Custom Doctypes and Custom Fields.

After I execute migrate it gives me this error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, 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 97, 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/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1137, 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 1137, 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 956, 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 555, 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 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 228, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 51, 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 56, 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 66, 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 141, in import_doc
    doc.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 255, in insert
    self.run_post_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 912, in run_post_save_methods
    self.run_method("on_update")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 781, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1051, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1034, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 775, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/custom_field/custom_field.py", line 67, in on_update
    frappe.db.updatedb(self.dt)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 282, in updatedb
    db_table.sync()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 36, in sync
    self.alter()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py", line 86, in alter
    raise e
pymysql.err.InternalError: (1069, u'Too many keys specified; max 64 keys allowed')

Any idea how to fix it? And what causes this problem?

1 Like

How many of the fields in this doctype are Indexed?
Try

SHOW INDEX FROM `tab...`;

@adityahase, @aldoblack

It’s already reported, pls can your both comment in github, because there’s months I reported this

https://github.com/frappe/frappe/issues/6841

In which doctype?

It has been reported since January and nothing.

The Custom DocTypes you are having trouble with.

How do I identify it with? There are plenty Custom Doctypes that I have created.

Same error occured any solution for this.

Any update or guidance on this would be helpful.

…
While trying to follow instructions @Tropicalrambler “Our Enterprise Strategy and ERPNext” from Medium, I created 60 +Indexes on tabProject on “project_name” and “github_sync_id”. And why is the “github_sync_id” thrown in there, could it be causing any issues?

The instructions said to create a Kanban board first but I couldn’t create a new Kanban Board using “Project” Reference DocType and insert a new field, it had to be of type “Select” and predefined.

I’ve since deleted the indexes but still don’t understand why they were created in the first place. Any guidance on this would be appreciated.

ERPNext: v11.1.20 (v12)
Frappe Framework: v11.1.21 (v12)

I just saw your post. Let me look into it and I will let you know if I can find anything specific to help you.

Update

After updating to v12.x.x-develop I retried setting the Kanboard first but I still had to create a custom “kanban_field” of type “select” under Projects first. But this time I was able to do so…
…

Screenshot_2019-07-24_16-05-23

…
The index creation issue remains. It looks like the indexes are auto-created with a “_count” appended but I noticed that the index check only checks for identical index names.
…


…

If that’s the right bit of code?
Again, any thoughts?

Screenshot_2019-07-24_16-06-10

I am having this same prolem with " Items" doctype and this is my second time encoutered with this issue, the first time i solved this by building a new site, but keep building a new site is not a very good solution…
Anyone can help please?

I’have same pblm …pls help anyone

I receive the same error after adding a custom field to Employee through Customize Form and adding Custom Field to the hooks.py, then exporting fixtures by running bench --site site_name export-fixtures.

I’ve solved it once by creating a new bench and new site and restoring my database. This is not a sustainable solution as the error occurred again. For now I’m reverting back to Version 11.

@marynvdl

I have found the problem and the cause of this. See my issue posted

https://github.com/frappe/frappe/issues/8123

1 Like

Hello Everyone, I seem to having the same error, Please how were you able to fix yours?