Can't upgrade the forum from v2.0.0.beta9 to 2.1.0.beta3


(Aleksandr) #1
Gems in the group development were not installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from discourse_image_optim:
Rails image assets optimization is extracted into image_optim_rails gem
You can safely remove `config.assets.image_optim = false` if you are not going to use that gem

I, [2018-07-27T08:52:19.700559 #17]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
ArgumentError: Unknown migration version "5.2"; expected one of "4.2", "5.0", "5.1"
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration/compatibility.rb:9:in `find'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:533:in `[]'
/var/www/discourse/plugins/discourse-qa/db/migrate/20180712004204_save_existing_post_vote_counts_to_custom_fields.rb:1
============================================================================
/var/www/discourse/lib/migration/safe_migrate.rb:30:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I, [2018-07-27T13:30:12.885516 #18]  INFO -- :
I, [2018-07-27T13:30:12.885881 #18]  INFO -- : Terminating async processes
I, [2018-07-27T13:30:12.885996 #18]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 47
I, [2018-07-27T13:30:12.886136 #18]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 160
2018-07-27 13:30:12 UTC [47-2] LOG:  received fast shutdown request
2018-07-27 13:30:12 UTC [47-3] LOG:  aborting any active transactions
2018-07-27 13:30:12 UTC [54-2] LOG:  autovacuum launcher shutting down
2018-07-27 13:30:12 UTC [51-1] LOG:  shutting down
160:signal-handler (1532698212) Received SIGTERM scheduling shutdown...
2018-07-27 13:30:12 UTC [51-2] LOG:  database system is shut down
160:M 27 Jul 13:30:12.913 # User requested shutdown...
160:M 27 Jul 13:30:12.913 * Saving the final RDB snapshot before exiting.
160:M 27 Jul 13:30:13.144 * DB saved on disk
160:M 27 Jul 13:30:13.144 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 17579 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
be8d9fa6c8e0211e8d5e90ed92db1744a306b6b6fc578b7eeee94ea1e45c240c
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

I got the same after:

./launcher cleanup
./launcher rebuild app

(Jeff Atwood) #2

This is your error

I, [2018-07-27T08:52:19.700559 #17] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' rake aborted!
ArgumentError: Unknown migration version "5.2"; expected one of "4.2", "5.0", "5.1"

Is your install following our official install guide, with Docker?


(Aleksandr) #3

sure.We use docker. That have been working for 2 years. I’d like to update our forum.


#4

Could you try pulling (updating) Discourse core’s repo again? Specifically,

cd /var/discourse
git pull

and then

./launcher rebuild app

I think somehow only the QA plugin’s source is updated, which contains a Rails 5.2 migration, while Discourse core is still at 2.0.0.beta9 (Rails 5.1.4).


#5

I have an error going from 2.02 to the 2.1.0.beta3. Different error. But no luck rebuilding.

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 512 exit 1> Location of failure: /pups/lib/pups/exec_command.rb:112:in 'spawn' exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]} 7a968b5781ffb627f7bc3a7eab64ef05bb31b6fd413d6c71da9b17e65e6e814d ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one


#6

Interestingly I was able to upgrade from 2.0.2 to 2.0.3 without issues.

But after upgrading to 2.0.3, still have the same issue trying to upgrade to 2.1.0.beta3.


#7

:thinking: Interesting that could you upgrade to 2.0.3 fine. Maybe try disabling the plugin first:

  1. Disable the plugin (Discourse QA in this case) by commenting out its line in app.yml.
  2. Upgrade Discourse
    cd /var/discourse
    git pull
    ./launcher rebuild app
    
  3. Enable the plugin (uncomment its line) and ./launcher rebuild app again

#8

The interesting thing is that I don’t have Discourse QA plugin. I did test another plugin (Discourse Assign) and that was not the issue either.


#9

My bad! I thought you and OP have the same backtrace.

Could you provide a longer log that includes the backtrace? (i.e. “please scroll up and look for earlier error messages”)


#10

Ah. its this problem.

I remove the Dropbox plugin and I was able to update to 2.1.0.beta3.