Actions
Bug #4158
closedRole definitions in plugins cause "Could not find table 'roles'" error on initial migration
Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Plugin integration
Target version:
-
Description
When starting with an empty database and a plugin installed (such as foreman_bootdisk >= 1.3) which defines custom roles, the DB migration fails as the roles table doesn't exist at startup. The plugin roles code should skip if the table isn't present yet, like the default data loader does (Role.count rescue return
).
rake aborted! Could not find table 'roles' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/connection_adapters/sqlite_adapter.rb:472:in `table_structure' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/connection_adapters/sqlite_adapter.rb:346:in `columns' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/model_schema.rb:229:in `yield' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/model_schema.rb:229:in `columns' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/model_schema.rb:249:in `column_names' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/model_schema.rb:262:in `column_methods_hash' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/dynamic_matchers.rb:74:in `all_attributes_exists?' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/dynamic_matchers.rb:27:in `method_missing' /home/dcleal/code/foreman/foreman/app/services/foreman/plugin.rb:177:in `block in role' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' /home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activerecord-3.2.16/lib/active_record/transactions.rb:208:in `transaction' /home/dcleal/code/foreman/foreman/app/services/foreman/plugin.rb:176:in `role' /home/dcleal/code/foreman/foreman_bootdisk/lib/bootdisk/engine.rb:28:in `block (2 levels) in <class:Engine>' /home/dcleal/code/foreman/foreman/app/services/foreman/plugin.rb:61:in `instance_eval' /home/dcleal/code/foreman/foreman/app/services/foreman/plugin.rb:61:in `register' /home/dcleal/code/foreman/foreman_bootdisk/lib/bootdisk/engine.rb:20:in `block in <class:Engine>'
Updated by Dominic Cleal almost 11 years ago
- Is duplicate of Bug #4353: relation "roles" does not exist during DB migration added
Updated by Dominic Cleal almost 11 years ago
- Status changed from New to Duplicate
Actions