Project

General

Profile

Actions

Bug #4353

closed

relation "roles" does not exist during DB migration

Added by Etzion Bar-Noy about 10 years ago. Updated over 5 years ago.

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

Description

On the same machine, installation with Postgresql or MySQL succeeds, however, using sqlite fails with the following error:
foreman-installer --foreman-db-type sqlite --foreman-proxy-bmc true --foreman-proxy-dhcp true --foreman-proxy-dhcp-interface eth0 --foreman-proxy-dhcp-range "192.168.11.2 192.168.11.250"

Result:
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: /usr/sbin/foreman-rake db:migrate returned 1 instead of one of [0] at /usr/share/foreman-installer/modules/foreman/manifests/rake.pp:9
/Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0] at /usr/share/foreman-installer/modules/foreman/manifests/rake.pp:9
/Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[mdw.mgmt]: Could not evaluate: 500 Internal Server Error
Installing Done [100%] [...................................................................]
Something went wrong! Check the log for ERROR-level output
The full log is at /var/log/foreman-installer/foreman-installer.log

Log section:
[DEBUG 2014-02-15 16:00:36 main] Exec[foreman-rake-db:migrate](provider=posix): Executing '/usr/sbin/foreman-rake db:migrate'
[DEBUG 2014-02-15 16:00:36 main] Executing '/usr/sbin/foreman-rake db:migrate'
[ WARN 2014-02-15 16:00:39 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: rake aborted!
[ WARN 2014-02-15 16:00:39 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Could not find table 'roles'
[ WARN 2014-02-15 16:00:39 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
[ WARN 2014-02-15 16:00:39 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: Tasks: TOP => db:migrate => environment
[ WARN 2014-02-15 16:00:39 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: (See full trace by running task with --trace)
[ERROR 2014-02-15 16:00:39 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: /usr/sbin/foreman-rake db:migrate returned 1 instead of one of [0] at /usr/share/foreman-installer/modules/foreman/manifests/rake.pp:9
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:165:in `fail'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/type/exec.rb:125:in `sync'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/type/exec.rb:515:in `refresh'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:94:in `send'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:94:in `process_callback'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:20:in `process_events'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:86:in `queued_events'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:85:in `each'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:85:in `queued_events'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:19:in `process_events'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:88:in `eval_resource'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:104:in `evaluate_without_trigger'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:509:in `thinmark'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:508:in `thinmark'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:104:in `evaluate_without_trigger'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:386:in `traverse'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:99:in `evaluate_without_trigger'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/gems/1.8/gems/kafo-0.3.11/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:25:in `evaluate'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:141:in `apply'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:122:in `retrieve_and_apply_catalog'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:161:in `benchmark'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:160:in `benchmark'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:121:in `retrieve_and_apply_catalog'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:229:in `main'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:149:in `run_command'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:416:in `hook'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:407:in `exit_on_fail'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
[ INFO 2014-02-15 16:00:39 main] /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute'
[ INFO 2014-02-15 16:00:39 main] /usr/bin/puppet:4
[ INFO 2014-02-15 16:00:39 main] RESOURCE Foreman::Rake[db:migrate]
[ INFO 2014-02-15 16:00:39 main] RESOURCE Foreman::Rake[db:seed]
[ INFO 2014-02-15 16:00:39 main] Foreman::Rake[db:seed]: Scheduling refresh of Exec[foreman-rake-db:seed]
[ INFO 2014-02-15 16:00:39 main] RESOURCE Exec[foreman-rake-db:seed]
[DEBUG 2014-02-15 16:00:39 main] Exec[foreman-rake-db:seed](provider=posix): Executing '/usr/sbin/foreman-rake db:seed'
[DEBUG 2014-02-15 16:00:39 main] Executing '/usr/sbin/foreman-rake db:seed'
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: rake aborted!
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Could not find table 'roles'
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns:
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Tasks: TOP => db:abort_if_pending_migrations => environment
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: (See full trace by running task with --trace)
[ERROR 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0] at /usr/share/foreman-installer/modules/foreman/manifests/rake.pp:9
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:165:in `fail'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/type/exec.rb:125:in `sync'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/type/exec.rb:515:in `refresh'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:94:in `send'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:94:in `process_callback'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:20:in `process_events'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:86:in `queued_events'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:85:in `each'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:85:in `queued_events'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction/event_manager.rb:19:in `process_events'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:88:in `eval_resource'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:104:in `evaluate_without_trigger'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:509:in `thinmark'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:508:in `thinmark'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:104:in `evaluate_without_trigger'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:386:in `traverse'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:99:in `evaluate_without_trigger'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/gems/1.8/gems/kafo-0.3.11/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:25:in `evaluate'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:141:in `apply'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:122:in `retrieve_and_apply_catalog'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:161:in `benchmark'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:160:in `benchmark'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:121:in `retrieve_and_apply_catalog'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:229:in `main'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:149:in `run_command'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:416:in `hook'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:407:in `exit_on_fail'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
[ INFO 2014-02-15 16:00:43 main] /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute'
[ INFO 2014-02-15 16:00:43 main] /usr/bin/puppet:4
[ INFO 2014-02-15 16:00:43 main] RESOURCE Foreman::Rake[db:seed]
[ INFO 2014-02-15 16:00:43 main] Class[Foreman::Service]: Scheduling refresh of Service[foreman]
[ INFO 2014-02-15 16:00:43 main] Class[Foreman::Service]: Scheduling refresh of Exec[restart_foreman]
[DEBUG 2014-02-15 16:00:43 main] Service[foreman](provider=redhat): Executing '/sbin/service foreman status'
[DEBUG 2014-02-15 16:00:43 main] Puppet::Type::Service::ProviderRedhat: Executing '/sbin/chkconfig foreman'
[ INFO 2014-02-15 16:00:43 main] RESOURCE Service[foreman]
[DEBUG 2014-02-15 16:00:43 main] Service[foreman](provider=redhat): Executing '/sbin/service foreman status'
[DEBUG 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Service/Service[foreman]: Skipping restart; service is not running
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Service/Service[foreman]: Triggered 'refresh' from 1 events
[DEBUG 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Service/Service[foreman]: The container Class[Foreman::Service] will propagate my refresh event
[ INFO 2014-02-15 16:00:43 main] RESOURCE Exec[restart_foreman]
[DEBUG 2014-02-15 16:00:43 main] Exec[restart_foreman](provider=posix): Executing '/bin/touch /usr/share/foreman/tmp/restart.txt'
[DEBUG 2014-02-15 16:00:43 main] Executing '/bin/touch /usr/share/foreman/tmp/restart.txt'
[ WARN 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Service/Exec[restart_foreman]: Triggered 'refresh' from 1 events
[DEBUG 2014-02-15 16:00:43 main] /Stage[main]/Foreman::Service/Exec[restart_foreman]: The container Class[Foreman::Service] will propagate my refresh event

I saw this problem only when installing with sqlite DB. Other DB types were successful.

System: Centos x86_64 6.5. Foreman:
rpm -qa | grep foreman
rubygem-foreman_api-0.1.11-1.el6.noarch
foreman-cli-1.4.0-1.el6.noarch
foreman-sqlite-1.4.0-1.el6.noarch
foreman-installer-1.4.0-1.el6.noarch
foreman-proxy-1.4.0-1.el6.noarch
rubygem-hammer_cli_foreman-0.0.18-1.el6.noarch
foreman-1.4.0-1.el6.noarch
ruby193-rubygem-foreman_discovery-1.2.0-0.1.rc2.el6.noarch


Related issues 2 (0 open2 closed)

Related to Foreman - Feature #812: cant assign roles to groups, just to usersClosedMarek Hulán03/31/2011Actions
Has duplicate Foreman - Bug #4158: Role definitions in plugins cause "Could not find table 'roles'" error on initial migrationDuplicate01/22/2014Actions
Actions #1

Updated by Etzion Bar-Noy about 10 years ago

For some reason, it doesn't work out of the box (unless I start removing and adding RPMs manually, cleaning up, etc), even with PGSQL. The same error about the relation 'roles'. With pgsql, after running with trace mode (following the failure, I executed it manually):

/usr/sbin/foreman-rake db:migrate --trace
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
    rake aborted!
    PGError: ERROR: relation "roles" does not exist
    LINE 4: WHERE a.attrelid = '"roles"'::regclass
    ^
    : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
    FROM pg_attribute a LEFT JOIN pg_attrdef d
    ON a.attrelid = d.adrelid AND a.attnum = d.adnum
    WHERE a.attrelid = '"roles"'::regclass
    AND a.attnum > 0 AND NOT a.attisdropped
    ORDER BY a.attnum
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1158:in `async_exec'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1158:in `exec_no_cache'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:664:in `block in exec_query'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:663:in `exec_query'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1283:in `column_definitions'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:859:in `columns'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/model_schema.rb:228:in `yield'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/model_schema.rb:228:in `default'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/model_schema.rb:228:in `columns'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/model_schema.rb:248:in `column_names'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/model_schema.rb:261:in `column_methods_hash'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/dynamic_matchers.rb:74:in `all_attributes_exists?'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/dynamic_matchers.rb:27:in `method_missing'
    /usr/share/foreman/app/services/foreman/plugin.rb:177:in `block in role'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
    /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
    /usr/share/foreman/app/services/foreman/plugin.rb:176:in `role'
    /opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-1.2.0.rc2/lib/foreman_discovery/engine.rb:44:in `block (2 levels) in <class:Engine>'
    /usr/share/foreman/app/services/foreman/plugin.rb:61:in `instance_eval'
    /usr/share/foreman/app/services/foreman/plugin.rb:61:in `register'
    /opt/rh/ruby193/root/usr/share/gems/gems/foreman_discovery-1.2.0.rc2/lib/foreman_discovery/engine.rb:28:in `block in <class:Engine>'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
    /usr/share/foreman/config/environment.rb:5:in `<top (required)>'
    /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:103:in `require_environment!'
    /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:295:in `block (2 levels) in initialize_tasks'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in execute'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in invoke_with_call_chain'
    /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in `invoke_with_call_chain'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:176:in `block in invoke_prerequisites'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in `each'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:174:in `invoke_prerequisites'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:157:in `block in invoke_with_call_chain'
    /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in `invoke_with_call_chain'
    /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in `invoke_task'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block (2 levels) in top_level'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `each'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block in top_level'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in `top_level'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in `block in run'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
    /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run'
    /opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'
    Tasks: TOP => db:migrate => environment
Actions #2

Updated by Dominic Cleal about 10 years ago

  • Subject changed from foreman-installer fails when using sqlite DB to relation "roles" does not exist during DB migration
  • Category set to DB migrations
  • translation missing: en.field_release deleted (2)

I think this might be due to the discovery plugin being installed during migration. Could you try removing the discovery RPM, doing the migration and then reinstalling it?

Actions #3

Updated by Etzion Bar-Noy about 10 years ago

Yes. That seems to have solved the problem. Thank you!

Actions #4

Updated by Dominic Cleal about 10 years ago

  • Related to Feature #812: cant assign roles to groups, just to users added
Actions #5

Updated by Dominic Cleal about 10 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal
  • Target version set to 1.9.1

I think I've fixed this in the #812 branch.

Actions #6

Updated by Dominic Cleal about 10 years ago

  • Has duplicate Bug #4158: Role definitions in plugins cause "Could not find table 'roles'" error on initial migration added
Actions #7

Updated by Anonymous about 10 years ago

  • Target version changed from 1.9.1 to 1.9.0
Actions #8

Updated by Dominic Cleal about 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
  • translation missing: en.field_release set to 4

Fixed via #812 for Foreman 1.5.0.

Actions #9

Updated by Dominic Cleal about 10 years ago

  • Status changed from Closed to New
  • Assignee deleted (Dominic Cleal)
  • % Done changed from 100 to 80

Re-opening as there's a second place this isn't quite fixed. You'll see it on a clean install with foreman_setup installed.

rake aborted!
PGError: ERROR:  relation "roles" does not exist
LINE 4:              WHERE a.attrelid = '"roles"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"roles"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum
[snip]
/usr/share/foreman/app/services/foreman/plugin.rb:183:in `block in role'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
/usr/share/foreman/app/services/foreman/plugin.rb:182:in `role'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_setup-1.0.4/lib/foreman_setup/engine.rb:26:in `block (2 levels) in <class:Engine>'
/usr/share/foreman/app/services/foreman/plugin.rb:61:in `instance_eval'
/usr/share/foreman/app/services/foreman/plugin.rb:61:in `register'

The check for "Permission" should be above the first use of "Role" here:
https://github.com/theforeman/foreman/blob/acfbc4588/app/services/foreman/plugin.rb#L183-L184

Actions #10

Updated by Marek Hulán about 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Marek Hulán
Actions #11

Updated by Marek Hulán about 10 years ago

  • Status changed from Assigned to Ready For Testing

PR is here https://github.com/theforeman/foreman/pull/1269
I moved Permission check as you suggested

Actions #12

Updated by Marek Hulán about 10 years ago

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

Also available in: Atom PDF