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.
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!