Correct way to update docker?


(Adrian D'atri Guiran) #1

I just tried to do:

cd /var/discourse
git pull
./launcher rebuild app

and got an error about docker being out of date.

I originally followed this guide:
https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

Which has docker being installed via:
wget -qO- https://get.docker.com/ | sh

When i tried sams suggestions here:

apt-get upgrade lxc-docker
fails:
"E: Package 'lxc-docker' has no installation candidate"

???


(Matt Palmer) #2

That howto is (was) out of date. The name of the Docker package has changed in later releases. I’ve edited the howto to bring it up to date; the command you want to run now is

apt-get install lxc-docker- docker-engine

(Adrian D'atri Guiran) #3

Thanks for updating the How To. But i’m still pretty stuck on this because i’m sitting on a setup that followed those instructions.

A bit more detail.

My discourse install got a little bit screwy lately, everything stopped being able to be clicked on. I can only get to the admin by actually entering in the url directly i.e. https://mysite.com/admin

Beyond this, i’ve missed a few updates now, and my site is out of date. When i try to update it via /admin/upgrade, the docker upgrade works, but the discourse upgrade fails.

I decided that perhaps i would just scrap this install and start fresh, so i went to /admin/backups and downloaded a backup from where i am currently. Set up an entirely new server, and tried to import the discourse backup. This failed, on some postgres error, i’m guessing because the latest version of discourse is not compatible with my slightly out of date backup.

This takes me back, to actually trying to fix my install, and actually doing ./launcher rebuild app.

I tried to upgrade docker by just running this script again:
wget -qO- https://get.docker.com/ | sh

And that gets me docker ~1.11 (going from memory here). After this when I do
./launcher rebuild app
It crashes. on some pups error. I searched these forums for that error, there’s a lot of people with this error but no solutions.

I’m totally stuck.

TLDR; let my discourse get slightly out of date, and potentially losing all data.


(Matt Palmer) #4

You probably want to post the error you’re getting, or contribute to the discussions about the error. Without that, nobody can really help you.


#5

We did a bit of work to upgrade an old system - as part of that we needed to build a failover system at the same discourse version as the old system so we could import the backup from the old system.

We did that by setting the version in app.yml.

version: v1.5.0.beta3

Once that was done we could import the backup and upgrade from there (a few problems but we got there in the end).


(Adrian D'atri Guiran) #6

@gearold Thanks for the tip, i was wondering if there was a way to do that.

My old (broken) forum is version: v1.5.0.beta11 +213
I tried setting version: v1.5.0.beta11 +213 in app.yml in the params: section and this fails:
Pups::ExecError: cd /var/www/discourse && git fetch origin v1.5.0.beta11+213 failed with return #<Process::Status: pid 204 exit 128>
So instead i tried setting version: v1.5.0.beta11
And then
./launcher rebuild app
this worked, now i have my new site running at v1.5.0.beta11, but not v1.5.0.beta11 +213
I figured i’d give the import a shot, so i ran it, but it still crashes. :frowning:

So then I clicked on the version link on my old broken forum which went to here:

So i figured maybe i could use the hash at the end there for the version. so i edited app.yml again and changed it to:
version: d538bcbe4087ed6aa905d4bc885564e83e1c5a9c
then
./launcher rebuild app
Sure enough this worked, now my new copy is sitting on the same version as my broken forum:
v1.5.0.beta11 +213, horay, progress!

Unfortunately, even with versions matching perfectly the backup pulled from the broken forum still fails to import to the new forum, partial log, because of post size limit:

[2016-06-02 22:12:06] 'adrian' has started the restore!
[2016-06-02 22:12:06] Marking restore as running...
[2016-06-02 22:12:06] Making sure /var/www/discourse/tmp/restores/default/2016-06-02-221206 exists...
[2016-06-02 22:12:06] Copying archive to tmp directory...
[2016-06-02 22:12:06] Unzipping archive...
[2016-06-02 22:12:07] Extracting metadata file...
[2016-06-02 22:12:07] Validating metadata...
[2016-06-02 22:12:07]   Current version: 20160530203810
[2016-06-02 22:12:07]   Restored version: 20160225095306
[2016-06-02 22:12:07] Extracting dump file...
[2016-06-02 22:12:07] Restoring dump file... (can be quite long)
    ...
    ...
[2016-06-02 22:12:15] Enabling readonly mode...
[2016-06-02 22:12:15] Pausing sidekiq...
[2016-06-02 22:12:15] Waiting for sidekiq to finish running jobs...
[2016-06-02 22:12:15] Switching schemas... try reloading the site in 5 minutes, if successful, then reboot and restore is complete.
[2016-06-02 22:12:15] Migrating the database...
[2016-06-02 22:12:15] EXCEPTION: 

No migration with version number 20160530203810

[2016-06-02 22:12:15] /var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:952:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in `up'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:807:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:240:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:235:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:235:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
/var/www/discourse/lib/backup_restore/restorer.rb:259:in `migrate_database'
/var/www/discourse/lib/backup_restore/restorer.rb:51:in `run'
/var/www/discourse/lib/backup_restore/backup_restore.rb:161:in `block in start!'
/var/www/discourse/lib/backup_restore/backup_restore.rb:158:in `fork'
/var/www/discourse/lib/backup_restore/backup_restore.rb:158:in `start!'
/var/www/discourse/lib/backup_restore/backup_restore.rb:17:in `restore!'
/var/www/discourse/app/controllers/admin/backups_controller.rb:80:in `restore'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:198:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in `process'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:in `process'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.9.8/lib/mini_profiler/profiling_methods.rb:106:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in `block in action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/mapper.rb:49:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/builder.rb:63:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:38:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:129:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/query_cache.rb:36:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.1.1/lib/logster/middleware/reporter.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:22:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:10:in `call_with_quiet_assets'
/var/www/discourse/config/initializers/100-silence_logger.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.9.8/lib/mini_profiler/profiler.rb:282:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.0.beta.4/lib/message_bus/rack/middleware.rb:60:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:73:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/application.rb:165:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:562:in `process_client'
/var/www/discourse/lib/scheduler/defer.rb:85:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:658:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.0.1/lib/unicorn/http_server.rb:132:in `start'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.0.1/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:23:in `<main>'
[2016-06-02 22:12:15] Trying to rollback...
[2016-06-02 22:12:16] Rolling back...
[2016-06-02 22:12:16] Notifying 'adrian' of the end of the restore...
[2016-06-02 22:12:16] Cleaning stuff up...
[2016-06-02 22:12:16] Removing tmp '/var/www/discourse/tmp/restores/default/2016-06-02-221206' directory...
[2016-06-02 22:12:16] Unpausing sidekiq...
[2016-06-02 22:12:16] Disabling readonly mode...
[2016-06-02 22:12:16] Marking restore as finished...
[2016-06-02 22:12:16] Finished!

(Adrian D'atri Guiran) #7

@mpalmer You’re totally right, i should have been more detailed. It was late at night and i wasn’t thinking clearly.
Here is the full logs of why i am unable to upgrade my old (broken) forum it is currently stuck on version:
v1.5.0.beta11 +213

  1. I go to /admin/upgrade and run the docker_manager “Upgrade to latest Version” this runs fine, and completes without errors, full log here: http://termbin.com/l2cy

  2. After doing this, I run the discourse upgrade, this crashes, on the following error (full log here: http://termbin.com/cemp )

    == 20160302104253 AddLikeNotificationFrequencyToUserOptions: migrating ======== – add_column(:user_options, :like_notification_frequency, :integer, {:null=>false, :default=>1}) -> 0.0141s rake aborted! StandardError: An error has occurred, this and all later migrations canceled: PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: “” : UPDATE site_settings SET value = value::integer * 1440 WHERE name = ‘default_email_digest_frequency’ AND value IS NOT NULL /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/pg.rb:90:in exec' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-mini-profiler-0.10.1/lib/patches/db/pg.rb:90:inasync_exec’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in block in execute' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:472:inblock in log’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in instrument' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:466:inlog’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in execute' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:665:inblock in method_missing’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:634:in block in say_with_time' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:634:insay_with_time’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:654:in method_missing' /var/www/discourse/db/migrate/20160302170230_rename_digest_after_days_to_digest_after_minutes.rb:5:inup’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:611:in exec_migration' /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:7:inblock in exec_migration’ /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:6:in exec_migration' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:592:inblock (2 levels) in migrate’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:591:in block in migrate' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:inwith_connection’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:590:in migrate' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:768:inmigrate’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:998:in block in execute_migration_in_transaction' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:1044:inblock in ddl_transaction’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in block in transaction' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/transaction.rb:184:inwithin_new_transaction’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in transaction' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:intransaction’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:1044:in ddl_transaction' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:997:inexecute_migration_in_transaction’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:959:in block in migrate' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:ineach’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in migrate' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:823:inup’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:801:in migrate' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/tasks/database_tasks.rb:137:inmigrate’ /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/railties/databases.rake:44:in block (2 levels) in ' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rails_multisite-1.0.4/lib/tasks/db.rake:8:inblock (2 levels) in ‘
    /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rails_multisite-1.0.4/lib/rails_multisite/connection_management.rb:124:in call' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rails_multisite-1.0.4/lib/rails_multisite/connection_management.rb:124:inblock in each_connection’
    /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rails_multisite-1.0.4/lib/rails_multisite/connection_management.rb:122:in each' /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rails_multisite-1.0.4/lib/rails_multisite/connection_management.rb:122:ineach_connection’
    /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rails_multisite-1.0.4/lib/tasks/db.rake:3:in `block in '
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)
    == 20160302104253 AddLikeNotificationFrequencyToUserOptions: migrated (0.0253s)

    == 20160302170230 RenameDigestAfterDaysToDigestAfterMinutes: migrating ========
    – rename_column(:user_options, :digest_after_days, :digest_after_minutes)
    -> 0.0029s
    – execute(“UPDATE user_options SET digest_after_minutes = digest_after_minutes * 1440 WHERE digest_after_minutes IS NOT NULL”)
    -> 0.0151s
    – execute(“UPDATE site_settings SET value = value::integer * 1440 WHERE name = ‘default_email_digest_frequency’ AND value IS NOT NULL”)

  3. I have done this step both with and without doing steps 1 & 2 above first. (Because i have a server image restore point and I keep going back and trying different things). I try to manually upgrade via the server.

ssh to box cd /var/discourse git pull ./launcher rebuild app
This gives me the following error
ERROR: Docker version 1.7.1 not supported, please upgrade to at least 1.8.0, or recommended 1.8.0

Which is how i got onto the whole start of this thread “correct way to update docker?”

I have tried doing a few things:

  1. running the original install script again:
    wget -qO- https://get.docker.com/ | sh
    This seems to upgrade docker, but there’s a lot of warnings, and then ./launcher rebuild app fails after this.

  2. I just tried this now
    apt-get update && apt-get upgrade docker-engine
    This seems to have got me a newer version of docker, but does it mater that i don’t have lxc-docker?

    xxxx@xxxx:~# apt-cache policy lxc-docker
    lxc-docker:
    Installed: (none)
    Candidate: (none)
    Version table:

So with docker-engine upgraded, after running ./launcher rebuild app I get what somewhat looks like an error message, i can’t quite tell, it tells me to boostrap again, but i recall jeff saying once that you should never need to do ./launcher bootstrap app.

                                                            ok
Setting next OID for new cluster                            ok
Sync data directory to disk                                 ok
Creating script to analyze new cluster                      ok
Creating script to delete old cluster                       ok

Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
    ./analyze_new_cluster.sh

Running this script will delete the old cluster's data files:
    ./delete_old_cluster.sh
-------------------------------------------------------------------------------------
UPGRADE OF POSTGRES COMPLETE

Old 9.3 database is stored at /shared/postgres_data_old

Please run ./launcher bootstrap again
-------------------------------------------------------------------------------------

f5881548a4c9be1c09b1750bd9880108936ec1da91cfc76cd5bfae467f455c67

After doing this, the site is effectively completely broken.
Even if i reboot the box, or try running ./launcher start app
I just get:
502 Bad Gateway

So i figure what the heck (i’ve got server backup image, so i’ll just run that bootstrap thing anyway).

./launcher bootstrap app
This fails as well:

	FAILED
	--------------------
	Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 810 exit 1>
	Location of failure: /pups/lib/pups/exec_command.rb:108: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'"]}
	c17c489e154d8725bdd803379379aa58e7c123cd9cb23328d8bb4cda5a266906
	** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

more detailed version of above log: http://termbin.com/0ivo

:frowning:


(Adrian D'atri Guiran) #8

Issue solved with advice from this thread:

But the advice is actually wrong, it should be DELETE FROM:

./launcher enter app
rails c
> SiteSetting.exec_sql("DELETE FROM site_settings WHERE name = 'default_email_digest_frequency' ")

Thanks for your help @mpalmer @gearoid