Troubleshooting Row Size Limit Errors in Sugar
Overview
When creating new fields in Sugar, there may be occasions where the field fails to save in Studio due to hitting the row size limit of the table in your database. This article covers the error message that appears in Sugar and how to resolve this issue so that new fields can be created for the module.
Symptoms
When creating a new field in Admin > Studio, the following error message appears on the screen when the field fails to save due to reaching the row size limit for MySQL:
- Field cannot be created. You have reached the row size limit of this table in your database. Learn more.
Note: For more information on row size limits for MySQL, please refer to the Limits on Table Column Count and Row Size documentation on the MySQL website.
Resolution
To resolve this issue, review existing custom fields in the module with the following data type, and reduce the Max Size value wherever possible to free up space in the database table:
- TextField
- URL
- IFrame
- Phone
Note: The Max Size option in Studio defines the maximum number of characters allowed for the field and default to "255" for these field types.
The following steps cover how to reduce the Max Size value for these custom field types in Admin > Studio:
- Navigate to Admin > Studio > {Module Name} > Fields.
- Select a custom field that meets one of the data types listed above. For our example, we will select the custom Mobile Phone 2 field.
- Update the Max Size value to reduce the maximum number of characters allowed for the custom field. For our example, we will change the max size to "20" as it is not necessary to have a limit of 255 characters for a phone type field.
- Click "Save" to preserve your changes.
Repeat the same steps for other custom fields in the module where you can potentially reduce the max size limit in the database table.
Application
Once the max size limit has been reduced for the custom field(s) to free up space on the database table, you should be able to create new fields in the affected module. To avoid running into the row size limit error again, be sure to define a proper value for the Max Size option when creating any custom fields with data type of: "TextField", "URL", "IFrame", or "Phone".