New installation fails on migration

I am trying to install a new Discourse installation using discourse_docker, and the migrations are failing:

== 20180916195601 MigrateS3BackupSiteSettings: migrating ======================
-- execute("UPDATE site_settings\nSET name      = 'backup_location',\n    data_type = 7,\n    value     = 's3'\nWHERE name = 'enable_s3_backups' AND value = 't';\n")
   -> 0.0005s
-- execute("DELETE\nFROM site_settings\nWHERE name = 'enable_s3_backups';\n")
   -> 0.0004s
== 20180916195601 MigrateS3BackupSiteSettings: migrated (0.0018s) =============

== 20180917024729 RemoveSuperfluousColumns: migrating =========================

WARNING
-------------------------------------------------------------------------------------
An attempt was made to drop or rename a column in a migration
SQL used was: 'ALTER TABLE user_profiles DROP COLUMN IF EXISTS card_image_badge_id'

Please generate a post deployment migration using `rails g post_migration` to drop
or rename columns.

Note, to minimize disruption use self.ignored_columns = ["column name"] on your
ActiveRecord model, this can be removed 6 months or so later.

This protection is in place to protect us against dropping columns that are currently
in use by live applications.



FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 12775 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
59a086818934d9ab5ac6095987a41a5d4f317615dab7d86710afc36b0b40cf5e
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

It works file when forcing the version to v2.5.0.beta2 instead of test_passed, and I see recent commits related to SafeMigration, it seems to be correlated.

2 Likes

Maybe it is

https://github.com/discourse/discourse/commit/6b192d29fa095e91cb40b71e76dfc811f4aa205c

2 Likes

@renchap
did you get any solution ?

I have reverted the performance commits to migrations so that @sam has a chance to review this error and correct it after the long weekend:

https://github.com/discourse/discourse/commit/8b46f14744d4bab9339d075825914d86da6bd5eb

7 Likes

Fixed per:

3 Likes