Failed Upgrade to 2.4.0.beta2

When trying to upgrade to 2.4.0.beta2 from v2.4.0.beta1 +6 and I received the white page messaging asking for me to login directly on the server and run the ./launcher rebuild app command from the discourse folder. However I am experiencing a failure durning the migration process which is preventing us from upgrading. Please see below:

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1036:in `up'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'

/var/www/discourse/lib/migration/safe_migrate.rb:52:in `migrate'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/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, [2019-07-30T02:26:02.062067 #15] INFO -- : gem install public_suffix -v 3.0.3 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install

Successfully installed public_suffix-3.0.3

1 gem installed

gem install addressable -v 2.5.2 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install

Successfully installed addressable-2.5.2

1 gem installed

gem install sawyer -v 0.8.1 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install

Successfully installed sawyer-0.8.1

1 gem installed

gem install octokit -v 4.9.0 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install

Successfully installed octokit-4.9.0

1 gem installed

== 20190724055909 MoveToManagedAuthenticator: migrating =======================

-- execute("INSERT INTO user_associated_accounts (\n provider_name,\n provider_uid,\n user_id,\n created_at,\n updated_at\n) SELECT\n 'oauth2_basic',\n replace(key, 'oauth2_basic_user_', ''),\n (value::json->>'user_id')::integer,\n CURRENT_TIMESTAMP,\n CURRENT_TIMESTAMP\nFROM plugin_store_rows\nWHERE plugin_name = 'oauth2_basic'\nON CONFLICT (provider_name, user_id)\nDO NOTHING\n")

I, [2019-07-30T02:26:02.062767 #15] INFO -- : Terminating async processes

I, [2019-07-30T02:26:02.062812 #15] 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/10/bin/postmaster -D /etc/postgresql/10/main pid: 70

I, [2019-07-30T02:26:02.062859 #15] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 186

2019-07-30 02:26:02.063 UTC [70] LOG: received fast shutdown request

186:signal-handler (1564453562) Received SIGTERM scheduling shutdown...

186:M 30 Jul 2019 02:26:02.159 # User requested shutdown...

186:M 30 Jul 2019 02:26:02.159 * Saving the final RDB snapshot before exiting.

2019-07-30 02:26:02.903 UTC [70] LOG: aborting any active transactions

2019-07-30 02:26:02.906 UTC [70] LOG: worker process: logical replication launcher (PID 79) exited with exit code 1

2019-07-30 02:26:02.907 UTC [74] LOG: shutting down

186:M 30 Jul 2019 02:26:02.909 * DB saved on disk

186:M 30 Jul 2019 02:26:02.909 # Redis is now ready to exit, bye bye...

2019-07-30 02:26:02.960 UTC [70] LOG: database system is shut down

FAILED

--------------------

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 11246 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'"]}

c5f6c62f432b100b14621e70fc5cede77bcac6d5a9731b84a37d4733d122d70e

** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Any advice?

We need a few more lines at the top to see the error.

4 Likes

Additional Log details attached, thanks for the help @Falco:

> 
> Bundle complete! 118 Gemfile dependencies, 194 gems now installed.
> 
> Gems in the group development were not installed.
> 
> Bundled gems are installed into `./vendor/bundle`
> 
> Post-install message from i18n:
> 
> HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
> 
> But that may break your application.
> 
> Please check your Rails app for 'config.i18n.fallbacks = true'.
> 
> If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
> 
> 'config.i18n.fallbacks = [I18n.default_locale]'.
> 
> If not, fallbacks will be broken in your app by I18n 1.1.x.
> 
> For more info see:
> 
> https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
> 
> Post-install message from rubocop:
> 
> Performance cops have been removed from RuboCop 0.68. Use the `rubocop-performance` gem instead.
> 
> Put this in your `Gemfile`.
> 
> ```rb
> 
> gem 'rubocop-performance'
> 
> ```
> 
> And then execute:
> 
> ```sh
> 
> $ bundle install
> 
> ```
> 
> Put this into your `.rubocop.yml`.
> 
> ```yaml
> 
> require: rubocop-performance
> 
> ```
> 
> More information: https://github.com/rubocop-hq/rubocop-performance
> 
> I, [2019-07-30T02:30:24.659675 #13] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
> 
> 2019-07-30 02:30:54.028 UTC [11272] discourse@discourse ERROR: invalid input syntax for integer: "[5205]"
> 
> 2019-07-30 02:30:54.028 UTC [11272] discourse@discourse STATEMENT: INSERT INTO user_associated_accounts (
> 
> provider_name,
> 
> provider_uid,
> 
> user_id,
> 
> created_at,
> 
> updated_at
> 
> ) SELECT
> 
> 'oauth2_basic',
> 
> replace(key, 'oauth2_basic_user_', ''),
> 
> (value::json->>'user_id')::integer,
> 
> CURRENT_TIMESTAMP,
> 
> CURRENT_TIMESTAMP
> 
> FROM plugin_store_rows
> 
> WHERE plugin_name = 'oauth2_basic'
> 
> ON CONFLICT (provider_name, user_id)
> 
> DO NOTHING
> 
> rake aborted!
> 
> StandardError: An error has occurred, this and all later migrations canceled:
> 
> PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "[5205]"
> 
> : INSERT INTO user_associated_accounts (
> 
> provider_name,
> 
> provider_uid,
> 
> user_id,
> 
> created_at,
> 
> updated_at
> 
> ) SELECT
> 
> 'oauth2_basic',
> 
> replace(key, 'oauth2_basic_user_', ''),
> 
> (value::json->>'user_id')::integer,
> 
> CURRENT_TIMESTAMP,
> 
> CURRENT_TIMESTAMP
> 
> FROM plugin_store_rows
> 
> WHERE plugin_name = 'oauth2_basic'
> 
> ON CONFLICT (provider_name, user_id)
> 
> DO NOTHING
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:110:in `async_exec'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:110:in `async_exec'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:84:in `async_exec'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:871:in `block in method_missing'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `block in say_with_time'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `say_with_time'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:860:in `method_missing'
> 
> /var/www/discourse/plugins/discourse-oauth2-basic/db/migrate/20190724055909_move_to_managed_authenticator.rb:5:in `up'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:817:in `exec_migration'
> 
> /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:9:in `block in exec_migration'
> 
> /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:29:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1036:in `up'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:52:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
> 
> /usr/local/bin/bundle:23:in `load'
> 
> /usr/local/bin/bundle:23:in `<main>'
> 
> Caused by:
> 
> ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "[5205]"
> 
> : INSERT INTO user_associated_accounts (
> 
> provider_name,
> 
> provider_uid,
> 
> user_id,
> 
> created_at,
> 
> updated_at
> 
> ) SELECT
> 
> 'oauth2_basic',
> 
> replace(key, 'oauth2_basic_user_', ''),
> 
> (value::json->>'user_id')::integer,
> 
> CURRENT_TIMESTAMP,
> 
> CURRENT_TIMESTAMP
> 
> FROM plugin_store_rows
> 
> WHERE plugin_name = 'oauth2_basic'
> 
> ON CONFLICT (provider_name, user_id)
> 
> DO NOTHING
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:110:in `async_exec'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:110:in `async_exec'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:84:in `async_exec'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:871:in `block in method_missing'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `block in say_with_time'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `say_with_time'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:860:in `method_missing'
> 
> /var/www/discourse/plugins/discourse-oauth2-basic/db/migrate/20190724055909_move_to_managed_authenticator.rb:5:in `up'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:817:in `exec_migration'
> 
> /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:9:in `block in exec_migration'
> 
> /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:29:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1036:in `up'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:52:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
> 
> /usr/local/bin/bundle:23:in `load'
> 
> /usr/local/bin/bundle:23:in `<main>'
> 
> Caused by:
> 
> PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "[5205]"
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:110:in `async_exec'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/patches/db/pg.rb:110:in `async_exec'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:84:in `async_exec'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:871:in `block in method_missing'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `block in say_with_time'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `say_with_time'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:860:in `method_missing'
> 
> /var/www/discourse/plugins/discourse-oauth2-basic/db/migrate/20190724055909_move_to_managed_authenticator.rb:5:in `up'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:817:in `exec_migration'
> 
> /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:9:in `block in exec_migration'
> 
> /var/www/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:29:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1036:in `up'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
> 
> /var/www/discourse/lib/migration/safe_migrate.rb:52:in `migrate'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
> 
> /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-12.3.2/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, [2019-07-30T02:30:54.047592 #13] INFO -- : gem install public_suffix -v 3.0.3 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install
> 
> Successfully installed public_suffix-3.0.3
> 
> 1 gem installed
> 
> gem install addressable -v 2.5.2 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install
> 
> Successfully installed addressable-2.5.2
> 
> 1 gem installed
> 
> gem install sawyer -v 0.8.1 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install
> 
> Successfully installed sawyer-0.8.1
> 
> 1 gem installed
> 
> gem install octokit -v 4.9.0 -i /var/www/discourse/plugins/discourse-github/gems/2.6.2 --no-document --ignore-dependencies --no-user-install
> 
> Successfully installed octokit-4.9.0
> 
> 1 gem installed
> 
> == 20190724055909 MoveToManagedAuthenticator: migrating =======================
> 
> -- execute("INSERT INTO user_associated_accounts (\n provider_name,\n provider_uid,\n user_id,\n created_at,\n updated_at\n) SELECT\n 'oauth2_basic',\n replace(key, 'oauth2_basic_user_', ''),\n (value::json->>'user_id')::integer,\n CURRENT_TIMESTAMP,\n CURRENT_TIMESTAMP\nFROM plugin_store_rows\nWHERE plugin_name = 'oauth2_basic'\nON CONFLICT (provider_name, user_id)\nDO NOTHING\n")
> 
> 184:signal-handler (1564453854) Received SIGTERM scheduling shutdown...
> 
> I, [2019-07-30T02:30:54.048180 #13] INFO -- : Terminating async processes
> 
> I, [2019-07-30T02:30:54.048226 #13] 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/10/bin/postmaster -D /etc/postgresql/10/main pid: 68
> 
> I, [2019-07-30T02:30:54.048275 #13] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 184
> 
> 2019-07-30 02:30:54.048 UTC [68] LOG: received fast shutdown request
> 
> 2019-07-30 02:30:54.077 UTC [68] LOG: aborting any active transactions
> 
> 2019-07-30 02:30:54.082 UTC [68] LOG: worker process: logical replication launcher (PID 77) exited with exit code 1
> 
> 2019-07-30 02:30:54.082 UTC [72] LOG: shutting down
> 
> 184:M 30 Jul 2019 02:30:54.135 # User requested shutdown...
> 
> 184:M 30 Jul 2019 02:30:54.136 * Saving the final RDB snapshot before exiting.
> 
> 2019-07-30 02:30:54.145 UTC [68] LOG: database system is shut down
> 
> 184:M 30 Jul 2019 02:30:54.647 * DB saved on disk
> 
> 184:M 30 Jul 2019 02:30:54.647 # 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 11235 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'"]}
> 
> e269f7d0ccb5cb508ee7a10a8dfe7b386e9bb1c35d6bb192eadc8cdef3c689c8
> 
> ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Following up for advice here. Thanks in advance!

Looks like it was broken by this PR from @angus

It expects the key user_id in the JSON of the plugin row to be an integer and not an array of integers.

3 Likes

@angus do we have a possible eta on a fix?

@Jim.Morrison I’ll take a look at this first thing tomorrow.

cc @david

@Jim.Morrison please try updating again, I just pushed a fix which adds a safeguard for this situation:

https://github.com/discourse/discourse-oauth2-basic/commit/550d0bdee14d3189cf51f84789dfd283200b4e04

I’m not sure how this happened in the first place though. Do you have any custom plugins or console scripts which you used to edit the account associations?

4 Likes

Having updated Staging worked fine. However when I went to update production it has totally lost it:

Browsing to the root domain seems to work fine on mobile until I authenticate.

@angus @david could this relate to the latest update to the oauth2 plugin?

The immediate issue is resolved through a plugin conflict removal via the App.yml. Thank you for the assistance again @angus!

5 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.