Project

General

Profile

Actions

Bug #11284

closed

Unable to unset websockets_ssl_key when websockets_encrypt is on

Added by Stephen Benjamin over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Starting up rails is failing for me after running the migration from #11120

The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Unable to unset websockets_ssl_key when websockets_encrypt is on
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/validations.rb:56:in `save!'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/transactions.rb:264:in `block in save!'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/transactions.rb:264:in `save!'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/validations.rb:41:in `create!'
/home/vagrant/foreman/app/models/setting.rb:172:in `create!'
/home/vagrant/foreman/app/models/setting/auth.rb:36:in `block (2 levels) in load_defaults'
/home/vagrant/foreman/app/models/setting/auth.rb:15:in `each'
/home/vagrant/foreman/app/models/setting/auth.rb:15:in `block in load_defaults'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
/home/vagrant/foreman/app/models/setting/auth.rb:13:in `load_defaults'
/home/vagrant/foreman/config/initializers/foreman.rb:21:in `each'
/home/vagrant/foreman/config/initializers/foreman.rb:21:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:245:in `load'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:245:in `block in load'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:245:in `load'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/engine.rb:592:in `each'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/engine.rb:592:in `block in <class:Engine>'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `instance_exec'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `run'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `each'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `run_initializers'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/application.rb:136:in `initialize!'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/vagrant/foreman/config/environment.rb:5:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `block in require'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/application.rb:103:in `require_environment!'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.21/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `eval'
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `<main>'

Files

settings-table.sql settings-table.sql 3.97 KB Alon Goldboim, 08/05/2015 04:22 AM

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #11120: MigrateWebsocketsSetting fails with ReadOnlyRecord when websockets_encrypt is in settings.yamlClosedDominic Cleal07/15/2015Actions
Actions #1

Updated by Stephen Benjamin over 8 years ago

  • Related to Bug #11120: MigrateWebsocketsSetting fails with ReadOnlyRecord when websockets_encrypt is in settings.yaml added
Actions #2

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 63

Do you have a backup of your database? It would be very useful to get a dump of the websockets_* rows from the settings table to see how the data was migrated.

Also if you have any websockets_* settings in config/settings.yaml it would be useful to know.

Actions #3

Updated by Alon Goldboim over 8 years ago

I have tried to change my db to pg, got the same problem, uploaded my settings table.
Got no websockets_* settings in config/settings.yaml.

Actions #5

Updated by Dominic Cleal over 8 years ago

Found via IRC that Alon's issue was fixed by clearing the Rails cache (rake tmp:cache:clear), which'd make sense on a clean database as the cache is only relevant to the old DB.

For Stephen's problem during an upgrade/migration, then this should be fixed by deleting the cache entry for websockets_encrypt during db/migrate/20150312144232_migrate_websockets_setting.rb as we're changing the value in the database only.

I reckon you could replicate the bug by setting websockets_encrypt to true on 1.9-stable before upgrading, or to auto with no key/cert, assuming true is already in the cache.

Actions #6

Updated by Stephen Benjamin over 8 years ago

I don't have an older database backup, but it seems like all of us so far got back up and running by clearing the cache.

Actions #7

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2643 added
  • Pull request deleted ()
Actions #8

Updated by Lukas Zapletal over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF