Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throws DB Access denied in prod env #27

Closed
ain opened this issue Nov 7, 2011 · 3 comments
Closed

Throws DB Access denied in prod env #27

ain opened this issue Nov 7, 2011 · 3 comments

Comments

@ain
Copy link

ain commented Nov 7, 2011

Worked nicely in staging, but throws Access denied in production:

(17:51:29) [current] rake db:seed_fu filter=02_stores

== Seed from /[...]/releases/20111107164213/db/fixtures/02_stores.rb
rake aborted!
Access denied for user 'root'@'localhost' (using password: NO)

Tasks: TOP => db:seed_fu

Looks like it doesn't respect the conf in database.yml

Full log:

(17:55:12) [current] rake db:seed_fu filter=02_stores --trace
** Invoke db:seed_fu (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:seed_fu

== Seed from /.../releases/20111107164213/db/fixtures/02_stores.rb
rake aborted!
Access denied for user 'root'@'localhost' (using password: NO)
/kunden/339168_20354/.gem/ruby/1.8/gems/mysql2-0.2.7/lib/mysql2/client.rb:42:in connect' /kunden/339168_20354/.gem/ruby/1.8/gems/mysql2-0.2.7/lib/mysql2/client.rb:42:ininitialize'
/kunden/339168_20354/.gem/ruby/1.8/gems/mysql2-0.2.7/lib/active_record/connection_adapters/mysql2_adapter.rb:14:in new' /kunden/339168_20354/.gem/ruby/1.8/gems/mysql2-0.2.7/lib/active_record/connection_adapters/mysql2_adapter.rb:14:inmysql2_connection'
/kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in send' /kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:innew_connection'
/kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in checkout_new_connection' /kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:191:incheckout'
/kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in loop' /kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:incheckout'
/usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:incheckout'
/kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:94:in connection' /kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:inretrieve_connection'
/kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in retrieve_connection' /kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:inconnection'
/kunden/339168_20354/.gem/ruby/1.8/gems/activerecord-3.0.9/lib/active_record/transactions.rb:207:in transaction' /kunden/339168_20354/.gem/ruby/1.8/gems/seed-fu-2.0.1/lib/seed-fu/runner.rb:35:inrun_file'
/kunden/339168_20354/.gem/ruby/1.8/gems/seed-fu-2.0.1/lib/seed-fu/runner.rb:26:in run' /kunden/339168_20354/.gem/ruby/1.8/gems/seed-fu-2.0.1/lib/seed-fu/runner.rb:25:ineach'
/kunden/339168_20354/.gem/ruby/1.8/gems/seed-fu-2.0.1/lib/seed-fu/runner.rb:25:in run' /kunden/339168_20354/.gem/ruby/1.8/gems/seed-fu-2.0.1/lib/seed-fu.rb:28:inseed'
/kunden/339168_20354/.gem/ruby/1.8/gems/seed-fu-2.0.1/lib/tasks/seed_fu.rake:41
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in call' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:inexecute'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in each' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:inexecute'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:insynchronize'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in invoke_with_call_chain' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:ininvoke'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in invoke_task' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:intop_level'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in each' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:intop_level'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in standard_exception_handling' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:intop_level'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in run' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:instandard_exception_handling'
/kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in run' /kunden/339168_20354/.gem/ruby/1.8/gems/rake-0.9.2/bin/rake:32 /usr/bin/rake:19:inload'
/usr/bin/rake:19
Tasks: TOP => db:seed_fu

@jonleighton
Copy link
Contributor

Seed fu doesn't doesn't handle connecting to the database - Rails does that. Are you sure you have your RAILS_ENV and database.yml set correctly?

@ain
Copy link
Author

ain commented Nov 8, 2011

If it needs RAILS_ENV=production appended to the command (which I think it does), then I guess it'd be a good idea to document it, maybe make an addition to the examples.

@jonleighton
Copy link
Contributor

RAILS_ENV needs to be set to whatever environment you are trying to seed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants