db:migrate fail - "You have an error in your SQL syntax;"

There are multiple "You have an error in your SQL syntax" as a result of

bundle exec rake db:migrate RAILS_ENV=production

Log attached. db_migrate.log

ENV:

  • GitLab 8.8-stable -> upgrade 8.9 stable

NOW IS:

  • GitLab 8.9.2
  • GitLab Shell 3.0.0
  • GitLab API v3
  • Git 2.9.0
  • Ruby 2.2.0p0
  • Rails 4.2.6
  • Mysql2 5.5.49-0ubuntu0.14.04.1

but gitlab is very unstable, a lot's of 500errors sample log: undef_method.log