Row size too large - update error


  • I added over 50 custom fields to the Opportunity form.
  • I reached the limit and was getting errors when trying to add more fields or save the form.
  • I deleted some fields and have NO PROBLEM saving forms in ERPNext
  • I get an error message of “Row size too large” when I try to update the system

I tried deleting ALL the customizations from the Opportunity form, and I still get the same error when trying to update.

Is there some kind of database cache I need to clear? Why does it still say “Row size too large” even after I delete all customizations, save, refresh, logout, and then run bench update?

Thank you for any and all help!


    Executing erpnext.patches.v9_1.create_issue_opportunity_type in site1.local (1bd3e0294d)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/", line 162, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "/usr/lib/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/local/lib/python2.7/site-packages/click/", line 716, in __call__
        return self.main(*args, **kwargs)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 696, in main
        rv = self.invoke(ctx)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1060, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1060, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 889, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 534, in invoke
        return callback(*args, **kwargs)
      File "/home/frappe/frappe-bench/env/local/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 31, in migrate
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 29, in run_all
        if not run_single(patchmodule = patch):
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 63, in run_single
        return execute_patch(patchmodule, method, methodargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 83, in execute_patch
        frappe.get_attr(patchmodule.split()[0] + ".execute")()
      File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v9_1/", line 18, in execute
        frappe.reload_doc('crm', 'doctype', 'opportunity')
      File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 695, in reload_doc
        return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 155, in reload_doc
        return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 19, in import_files
      File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/", line 24, in import_file
        ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
      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 245, in insert
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 887, in run_post_save_methods
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 755, in run_method
        out = Document.hook(fn)(self, *args, **kwargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 1024, in composer
        return composed(self, method, *args, **kwargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 1007, in runner
        add_to_return_value(self, fn(self, *args, **kwargs))
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 749, in <lambda>
        fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/", line 208, in on_update
        updatedb(, self)
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 76, in updatedb
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 155, in sync
      File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 354, in alter
        raise e
    pymysql.err.InternalError: (1118, u'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs')

When you delete custom fields from the Frappe UI, the columns dont actually get deleted from the database - they remain. You will have to go into the database and actually manually delete the unneeded columns from the tabOpportunity table.


Thank you, thank you, thank you. Now, I’ve never worked directly with the database before. I assume I need to do that from the console? I did some google searches but honestly I’m just not sure what I should be looking for for instructions. Any chance you could point me in the right direction?

you can see all custom fields which where created for Opportunity

~/frappe-bench$ bench mysql
select name from tabCustom Field where dt=“Opportunity”;

you can delete all custom fields which where created for Opportunity

delete from tabCustom Field where dt=“Opportunity”;

Not quite. The commands are accurate, but @Dbone will actually have to delete columns in tabOpportunity.

bench --site [sitename] mysql


alter table tabOpportunity drop column `{column_name}`;

Thank you, I managed to login, view, and delete extra columns. My initial error is now solved, on to the next one. Lol.

To understand the error, you can read the following article.

1 Like