Project

General

Profile

Actions

Bug #4186

closed

foreman-rake db:seed fails in 1.4 RC2

Added by Stephen Hoekstra almost 11 years ago. Updated over 6 years ago.

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

Description

When installing 1.4 RC2 via .deb noticed errors in production.log for "undefined method `chefproxy_proxies'", further investigation showed "foreman-rake db:seed" fails:

@# foreman-rake db:seed --trace
  • Invoke db:seed (first_time)
  • Execute db:seed
  • Invoke db:abort_if_pending_migrations (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Invoke db:load_config (first_time)
  • Execute db:load_config
  • Execute db:abort_if_pending_migrations
    [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!
    Unable to create medium: Path has already been taken
    /usr/share/foreman/db/seeds.rb:121
    /usr/share/foreman/db/seeds.rb:112:in `each'
    /usr/share/foreman/db/seeds.rb:112
    /usr/share/foreman/vendor/ruby/1.8/gems/audited-3.0.0/lib/audited/auditor.rb:250:in `call'
    /usr/share/foreman/vendor/ruby/1.8/gems/audited-3.0.0/lib/audited/auditor.rb:250:in `without_auditing'
    /usr/share/foreman/db/seeds.rb:110
    /usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:245:in `load'
    /usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:245:in `load'
    /usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:236:in `load_dependency'
    /usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:245:in `load'
    /usr/share/foreman/vendor/ruby/1.8/gems/railties-3.2.16/lib/rails/engine.rb:525:in `load_seed'
    /usr/share/foreman/vendor/ruby/1.8/gems/activerecord-3.2.16/lib/active_record/railties/databases.rake:347
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:236:in `execute'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:175:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:106:in `top_level'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:106:in `top_level'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:78:in `run'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
    /usr/share/foreman/vendor/ruby/1.8/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
    /usr/bin/rake:27
    Tasks: TOP => db:seed@
Actions #2

Updated by Dominic Cleal almost 11 years ago

Can you provide any more info about how this happened? Was it a clean install, or an upgrade?

Actions #3

Updated by Dominic Cleal almost 11 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 1.9.2
Actions #4

Updated by Stephen Hoekstra almost 11 years ago

It was an upgrade from 1.3.2 to 1.4rc2 using packages from deb.theforeman.org.

No errors during install process. When the application restarted we started to see the node.rb lookups fail, in the application log:

Started GET "/node/hostname.domain?format=yml" for 10.0.41.9 at Sun Jan 26 13:51:28 +0000 2014
Processing by HostsController#externalNodes as YML
  Parameters: {"name"=>"hostname.domain"}
Operation FAILED: undefined method `chefproxy_proxies' for #<Class:0x7fb1afd89d08>
  Rendered common/500.html.erb within layouts/application (2.2ms)
  Rendered layouts/base.html.erb (1.2ms)
Completed 500 Internal Server Error in 6.4ms (Views: 4.6ms | ActiveRecord: 0.0ms)
Started POST "/api/reports" for 10.0.41.9 at Sun Jan 26 13:51:29 +0000 2014
Processing by Api::V2::ReportsController#create as JSON
  Parameters: {"report"=>"[FILTERED]", "apiv"=>"v2"}
undefined method `chefproxy_proxies' for #<Class:0x7fb1afd89d08> (NoMethodError)

Running the clean steps in the upgrade process gave output in first post. Updating db/seeds.rb and rerunning the rake task fixed the probem.

Actions #5

Updated by Ohad Levy almost 11 years ago

the original bug was that there is unique on path, if the media existed with the same path but with different name it would fail to create.

I wonder if we should do anything with the seed script failures, as they are currently silently ignored.

Actions #6

Updated by Dominic Cleal almost 11 years ago

  • Assignee set to Stephen Hoekstra
  • Translation missing: en.field_release set to 2
Actions #7

Updated by Stephen Hoekstra almost 11 years ago

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

Also available in: Atom PDF