I’ve tried to update from Version v1.9.0.beta4 +300 to 1.9.0.beta5 by pulling the latest changes (git pull
) and try to rebuild the app (./launcher rebuild app
), but the migration failed with the following message:
Any fix?
I, [2017-08-11T05:43:33.644343 #15] INFO -- : > cd /var/www/discourse && su dis course -c 'bundle exec rake db:migrate'
2017-08-11 05:43:38.795 UTC [399] discourse@discourse ERROR: duplicate key valu e violates unique constraint "schema_migration_details_pkey"
2017-08-11 05:43:38.795 UTC [399] discourse@discourse DETAIL: Key (id)=(629) al ready exists.
2017-08-11 05:43:38.795 UTC [399] discourse@discourse STATEMENT: INSERT I NTO schema_migration_details(
version,
hostname,
name,
git_version,
duration,
direction,
rails_version,
created_at
) values (
20170609115401,
'3f1727b6fec9
',
'AddExtensionToTopicLinks',
'f2539a86d06b29b2b85eb734fdc9571959c17b1b',
40,
'up',
'4.2.9',
'2017-08-11 05:43:38.794188'
)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "sch ema_migration_details_pkey"
DETAIL: Key (id)=(629) already exists.
: INSERT INTO schema_migration_details(
version,
hostname,
name,
git_version,
duration,
direction,
rails_version,
created_at
) values (
20170609115401,
'3f1727b6fec9
',
'AddExtensionToTopicLinks',
'f2539a86d06b29b2b85eb734fdc9571959c17b1b',
40,
'up',
'4.2.9',
'2017-08-11 05:43:38.794188'
)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/p atches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/p atches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/postgresql/database_statements.rb:155:in `block in exe cute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_ support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:44:in `exec_m igration'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:592:in `block (2 levels) in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:591:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:590:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:768:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1023:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1069:in `block in ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/database_statements.rb:213:in `block in trans action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction '
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/transactions.rb:220:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1069:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1022:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:984:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:980:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:980:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:823:in `up'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:801:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/tasks/database_tasks.rb:139:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<to p (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "schema_migration_details_pkey"
DETAIL: Key (id)=(629) already exists.
: INSERT INTO schema_migration_details(
version,
hostname,
name,
git_version,
duration,
direction,
rails_version,
created_at
) values (
20170609115401,
'3f1727b6fec9
',
'AddExtensionToTopicLinks',
'f2539a86d06b29b2b85eb734fdc9571959c17b1b',
40,
'up',
'4.2.9',
'2017-08-11 05:43:38.794188'
)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/p atches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/p atches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/postgresql/database_statements.rb:155:in `block in exe cute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_ support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:44:in `exec_m igration'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:592:in `block (2 levels) in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:591:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:590:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:768:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1023:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1069:in `block in ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/database_statements.rb:213:in `block in trans action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction '
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/transactions.rb:220:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1069:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1022:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:984:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:980:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:980:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:823:in `up'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:801:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/tasks/database_tasks.rb:139:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<to p (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "sch ema_migration_details_pkey"
DETAIL: Key (id)=(629) already exists.
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/p atches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/p atches/db/pg.rb:90:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/postgresql/database_statements.rb:155:in `block in exe cute'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_ support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract_adapter.rb:478:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/var/www/discourse/lib/freedom_patches/schema_migration_details.rb:44:in `exec_m igration'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:592:in `block (2 levels) in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:591:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:590:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:768:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1023:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1069:in `block in ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/database_statements.rb:213:in `block in trans action'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction '
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/transactions.rb:220:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1069:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:1022:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:984:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:980:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:980:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:823:in `up'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/migration.rb:801:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/tasks/database_tasks.rb:139:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_r ecord/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<to p (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I, [2017-08-11T05:43:38.833122 #15] INFO -- : == 20170609115401 AddExtensionToT opicLinks: migrating =========================
-- add_column(:topic_links, :extension, :string, {:limit=>10})
-> 0.0006s
-- add_index(:topic_links, :extension)
-> 0.0395s
I, [2017-08-11T05:43:38.833423 #15] INFO -- : Terminating async processes
I, [2017-08-11T05:43:38.833489 #15] INFO -- : Sending INT to HOME=/var/lib/post gresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgr es:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main p id: 44
I, [2017-08-11T05:43:38.833548 #15] INFO -- : Sending TERM to exec chpst -u red is -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 157
2017-08-11 05:43:38.833 UTC [44] LOG: received fast shutdown request
2017-08-11 05:43:38.833 UTC [44] LOG: aborting any active transactions
157:signal-handler (1502430218) Received SIGTERM scheduling shutdown...
2017-08-11 05:43:38.835 UTC [51] LOG: autovacuum launcher shutting down
2017-08-11 05:43:38.836 UTC [48] LOG: shutting down
157:M 11 Aug 05:43:38.860 # User requested shutdown...
157:M 11 Aug 05:43:38.860 * Saving the final RDB snapshot before exiting.
157:M 11 Aug 05:43:38.930 * DB saved on disk
157:M 11 Aug 05:43:38.930 # Redis is now ready to exit, bye bye...
2017-08-11 05:43:39.331 UTC [48] LOG: database system is shut down
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:m igrate' failed with return #<Process::Status: pid 381 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 d iscourse -c 'bundle install --deployment --verbose --without test --without deve lopment'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bu ndle exec rake assets:precompile'"]}
3f1727b6fec9e30bde95e2a47c13e710204c52f8a934e8181455be57985faa3a
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one