Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-4305

Change logentry3 metadata_json size on MySQL deployments



    • 0


      Currently, the metadata_json column in the logentry3 table on MySQL deployments has a size of TEXT. According to this document:


      the default size of the column set to be text is 65535 bytes. Unfortunately, this is not big enough for mirror logs when debugging is turned off. These can be up to 120 kB in size. When a statement containing text longer than 65535 bytes is sent to MySQL, data sent will be truncated to fit into the 65535 byte boundary. This creates issues when the metadata_json object is decoded, the decode fails because the string is not terminated properly and usage logs in Quay error out with a 500.

      The solution would be to increase the size of the logentry3 table's metadata_json column to at least MEDIUMTEXT which allows strings up to (2^24)-1 bytes or almost 16 MB in size. This would be enough to save the complete log in the table and would stop the 500 errors being generated when usage logs are read.

      ALTER TABLE logentry3 MODIFY metadata_json MEDIUMTEXT;

      This issue does not appear on PostgreSQL databases because it has only one text field and the length of data that can be saved is practically unlimited.

      Please check, thanks!



          Public project attachment banner

            context keys: [headless, issue, helper, isAsynchronousRequest, project, action, user]
            current Project key: PROJQUAY


              sleesinc Kenny Lee Sin Cheong
              rhn-support-ibazulic Ivan Bazulic
              0 Vote for this issue
              7 Start watching this issue