Announcement

Collapse
No announcement yet.

Not able to create new fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not able to create new fields

    This is the error :- PDOException: SQLSTATE[42000]: Syntax error or access violation: 1118 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 in /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:72 Stack trace: #0 /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Connection.php(72): PDO->query()
    How can i resolve this and create new fields ???

  • #2
    Hi Ashif Malayil,

    This article from EspoCRM documentation may be useful for you: https://docs.espocrm.com/administrat...size-too-large.

    Comment


    • #3
      Still not able to create, if i give max length 10 then it is getting created. Actually i have created more text and enum fields than varchar.

      Comment


      • #4
        You can also decrease length for enum fields. In entityDefs, specify, for example: "maxLength": 20, where 20 is the length of the longest option. Then run hard rebuild or decrease the length manually in db.

        Comment


        • #5
          Originally posted by Ashif Malayil View Post
          Still not able to create, if i give max length 10 then it is getting created. Actually i have created more text and enum fields than varchar.
          Either reduce the "maxLength" of varchar fields until you can create new fields, or change varchar to text as described in the documentation: https://docs.espocrm.com/administrat...size-too-large.

          Here are 2 working methods that I have personally used. These methods can be combined: the first is described in the documentation (lazovic told you about), and yuri told you about the second):​

          Method 1.
          1. For example, in three varchar fields, "maxLength" was changed from 150 to 50 in the file custom/Espo/Custom/Resources/metadata/entityDefs/{EntityType}.json.
          2. Next, go to phpMyAdmin and find these three fields from the previous point there, and set the identical length there.
          3. Rebuild via CLI.
          Steps 2 and 3 can be replaced via Hard Rebuild: https://docs.espocrm.com/administrat.../#hard-rebuild.
          If fields are not created and Rebuild or Hard Rebuild fails, repeat these steps until the fields are created.​

          Method 2.
          1. For example, in three fields with varchar type, change the lines to text in the file custom/Espo/Custom/Resources/metadata/entityDefs/{EntityType}.json:

          From
          Code:
          "type": "varchar",
          "maxLength": 150
          to
          Code:
          "type": "text"

          2. Rebuild or Hard Rebuild via CLI.

          Repeat these steps until fields are created and Rebuild completes successfully.​
          Last edited by victor; 12-05-2023, 09:03 AM.

          Comment


          • #6
            I have reduced char length, even tried changing field type and changed max_input_vars size, still i'm not able to create fields? is there any ways

            Comment


            • #7
              Originally posted by Ashif Malayil View Post
              I have reduced char length, even tried changing field type and changed max_input_vars size, still i'm not able to create fields? is there any ways
              Repeat these steps until fields are created and Rebuild completes successfully.​
              Both methods have been used by me personally and by my colleagues many times. If you cannot create a new field with the Varchar type, it means that you have not modified enough existing fields. Actions in methods 1 and 2 should be performed until there is an opportunity to create at least one field.

              In any case, these solutions are temporary and you should create an additional entity where you can create fields until you run into database limits again.​

              Comment


              • #8
                Thank you victor, This issue has been resolved after changing Varchar to Text in json.
                Last edited by Ashif Malayil; 09-06-2024, 10:51 AM.

                Comment

                Working...
                X