Project

General

Profile

Actions

Support #1591

closed

Bundling Foreman

Added by Ryan Bourgeois almost 12 years ago. Updated over 11 years ago.

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

Description

I've been attempting to bundle and deploy the develop branch Foreman on top of Apache/Passenger on Ubuntu 12.04 beta. I keep coming up against this error when I run the db:update:

undefined method `[]' for #<ActiveRecord::Reflection::AssociationReflection:0x7f781a5dbb20>

Full call and trace:
@sadpengu@ubsrv01m:/var/lib/foreman$ sudo bundle exec rake db:migrate RAILS_ENV=production --trace
/var/lib/foreman/vendor/bundle/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
/var/lib/foreman/vendor/bundle/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
/var/lib/foreman/vendor/bundle/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
/var/lib/foreman/vendor/bundle/ruby/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8
  • Invoke db:migrate (first_time)
  • Invoke environment (first_time)
  • Execute environment
    rake aborted!
    undefined method `[]' for #<ActiveRecord::Reflection::AssociationReflection:0x7f781a5dbb20>
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/reflection.rb:46:in `reflect_on_aggregation'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/sanitization.rb:60:in `expand_hash_conditions_for_aggregates'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/sanitization.rb:59:in `each'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/sanitization.rb:59:in `expand_hash_conditions_for_aggregates'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/relation/query_methods.rb:326:in `send'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/relation/query_methods.rb:326:in `build_where'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/relation/query_methods.rb:136:in `where'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/relation/spawn_methods.rb:140:in `apply_finder_options'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/relation/finder_methods.rb:119:in `first'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/querying.rb:5:in `__send__'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/querying.rb:5:in `first'
    /var/lib/foreman/lib/foreman/default_settings/loader.rb:12:in `create'
    /var/lib/foreman/lib/foreman/default_settings/loader.rb:33:in `load'
    /var/lib/foreman/lib/foreman/default_settings/loader.rb:27:in `each'
    /var/lib/foreman/lib/foreman/default_settings/loader.rb:27:in `load'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activerecord-3.2.3/lib/active_record/transactions.rb:208:in `transaction'
    /var/lib/foreman/lib/foreman/default_settings/loader.rb:24:in `load'
    /var/lib/foreman/config/initializers/foreman.rb:29
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/engine.rb:588
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/engine.rb:587:in `each'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/engine.rb:587
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `run_initializers'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `send'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    /var/lib/foreman/config/environment.rb:5
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/railties-3.2.3/lib/rails/application.rb:292:in `initialize_tasks'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
    /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
    /var/lib/foreman/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2/bin/rake:33
    /var/lib/foreman/vendor/bundle/ruby/1.8/bin/rake:19:in `load'
    /var/lib/foreman/vendor/bundle/ruby/1.8/bin/rake:19
    Tasks: TOP => db:migrate => environment
    @

I've tried a great deal of hokus-pokus, including changing gem package versions and git submodule checkouts, all to no avail. I admit my understanding of rails and vendoring is fairly limited, so I apologize if this is something stupid. Please let me know what else I need to provide.

Thanks,
Ryan

Actions #1

Updated by Ohad Levy almost 12 years ago

  • Status changed from New to Feedback

I've seen this error when someone uses a wrong version of has_many_polymorphs, note in the Gem file the specific git version we are tied into.

I would really like to get rid of this gem eventually.

Actions #2

Updated by Ryan Bourgeois almost 12 years ago

Success! Thank you very much, sir.

I am nearing the completion of a set of scripts to bootstrap an Ubuntu 12.04 system with Foreman+Puppet+dhcpd+tftpd. This was one of my final hurdles. I'll be adding it up to github once I've got a working first version. https://github.com/bluedragonx

Actions #3

Updated by Ohad Levy almost 12 years ago

did you see the latest deb nightly ? Greg is trying to get them up and running again.

Actions #4

Updated by Ryan Bourgeois almost 12 years ago

No, I haven't. I started working on this about a month ago as a result of the deb's not working for me on any version of Ubuntu I tried. Combined with the fact I started testing this against the 12.04 alpha I was a bit apprehensive as to the final result, so I decided to roll my own. I'll prop up another VM and give them a shot. My scripts do a bit more than just install Foreman, it's closer to the foreman-puppet you've got, but more user friendly. If the nightly debs work I'll likely take that into account in my scripts, installing that by default but building the latest commit of the develop branch as an option (since it's done already - and seems to be working so far, just got to clean up a few things).

Actions #5

Updated by Ohad Levy almost 12 years ago

  • Target version deleted (1.0)
Actions #6

Updated by Sam Kottler over 11 years ago

  • Status changed from Feedback to Closed

Closing this one out.

Actions

Also available in: Atom PDF