Actions
Bug #24698
closeddatabase "test_plugin_matrix-3-dev" does not exist when using `RemoteExecutionFeature.register` with Rails 5.2
Difficulty:
Triaged:
No
Description
We've seen this in jenkins in rake db:create. It's connected to the way how Rails 5.2 initializes the environment even in db:create. I was not able to fully reproduce it locally, but the backtrace should be enough to solve the issue.
ActiveRecord::NoDatabaseError: FATAL: database "test_plugin_matrix-3-dev" does not exist 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:688:in `rescue in connect' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:683:in `connect' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:215:in `initialize' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:40:in `new' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:40:in `postgresql_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:809:in `new_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `checkout_new_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:832:in `try_to_checkout_new_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:793:in `acquire_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:521:in `checkout' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:380:in `connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:1008:in `retrieve_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_handling.rb:118:in `retrieve_connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/connection_handling.rb:90:in `connection' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/activerecord-5.2.0/lib/active_record/model_schema.rb:324:in `table_exists?' 15:57:51 /usr/local/rvm/gems/ruby-2.5.1@test_plugin_matrix-3/gems/foreman_remote_execution-1.6.1/app/models/remote_execution_feature.rb:27:in `register' 15:57:51 /var/lib/workspace/workspace/test_plugin_matrix@2/database/postgresql/ruby/2.5/slave/fast/plugin/lib/foreman_ansible/remote_execution.rb:16:in `register_rex_feature'
Actions