Update 1.20 from 1.19 mysql 5.7 dependancy warning

On CentOS 7 upgrading from 1.19 to 1.20 we experienced a problem where the upgrade appear to do ok but the foreman interface just through a ruby error. The issue was tracked down to a failed database migration. Our foreman database was on RDS Mysql 5.6 and a column resize failed due to a 5.6 fixed limit. To fix the issue we had to upgrade RDS to 5.7 then re-rerun the database upgrade scripts. I couldn’t see the database dependancy listed in the upgrade pre-requisites or known issues.

Hope this post saves some else from having the same problem.


Thanks for sharing, moved the post to the support category.
Could you let us know specifically which migration failed?
Also, can you please open a PR to add a warning to the upgrade warnings section of the 1.20 manual?

The migration that we initially noticed failing was - Add type to token.

It failed with the error

Mysql2::Error: Specified key was too long; max key length is 767 bytes: ALTER TABLE tokens CHANGE value value varchar(900) DEFAULT NULL

After some research 767 appears to be a hard limit in 5.6 - https://dev.mysql.com/doc/refman/8.0/en/create-index.html

Upgrading to 5.7 fixed the problem.

I’ll raise a PR on the documentation note.

1 Like

PR created - https://github.com/theforeman/theforeman.org/pull/1283