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

mysql root password issue / add password arg to scrolls command #32

Open
ringe opened this issue May 3, 2012 · 7 comments
Open

mysql root password issue / add password arg to scrolls command #32

ringe opened this issue May 3, 2012 · 7 comments
Labels

Comments

@ringe
Copy link

ringe commented May 3, 2012

I ran this:

scrolls new nin.no -s twitter_bootstrap unicorn mysql resque redis rspec guard simple_form delayed_job rails_basics capybara git jquery

But there's a root password set on my MySQL database, so I got this:

generate    delayed_job
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:303:in `new_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:313:in `checkout_new_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `block (2 levels) in checkout'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `loop'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `block in checkout'
    from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:308:in `clear_cache!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:418:in `_run__3574419146895382369__prepare__641275549978487432__callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/runar/dev/nin.no/config/environment.rb:5:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands.rb:25:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
         run    bundle exec guard init from "."
Writing new Guardfile to /home/runar/dev/nin.no/Guardfile
bundler guard added to Guardfile, feel free to edit it
livereload guard added to Guardfile, feel free to edit it
redis guard added to Guardfile, feel free to edit it
resque guard added to Guardfile, feel free to edit it
rspec guard added to Guardfile, feel free to edit it
unicorn guard added to Guardfile, feel free to edit it
        rake    db:create:all
Access denied for user 'root'@'localhost' (using password: NO). 
Please provide the root password for your mysql installation
>MYREALLYPRIVATEPASSWORD
rake aborted!
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.* TO 'root'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION' at line 1: GRANT ALL PRIVILEGES ON nin.no_development.* TO 'root'@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;

Tasks: TOP => db:create:all
(See full trace by running task with --trace)
    rakefile    sample.rake
      remove    public/index.html
      remove    public/images/rails.png
    generate    controller home index
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:303:in `new_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:313:in `checkout_new_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `block (2 levels) in checkout'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `loop'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `block in checkout'
    from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:308:in `clear_cache!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:418:in `_run__1625313415494350825__prepare__3247787802287098622__callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/runar/dev/nin.no/config/environment.rb:5:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands.rb:25:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
        gsub    app/controllers/home_controller.rb
The template [/tmp/template20120503-5370-1mhplei] could not be loaded. Error: No such file or directory - /home/runar/dev/nin.no/app/controllers/home_controller.rb

Would adding the password, like scrolls --mysql-password=MYREALLYPRIVATEPASSWORD work?

Thank you for your effort.

@thommahoney
Copy link
Collaborator

@ringe Is this issue resolved if you create the app with the name 'nin_no' instead of 'nin.no'?

scrolls new nin_no -s twitter_bootstrap unicorn mysql resque redis rspec guard simple_form delayed_job rails_basics capybara git jquery

@ringe
Copy link
Author

ringe commented May 3, 2012

@thommahoney No, that makes no difference. The root cause is: Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)

@ringe
Copy link
Author

ringe commented May 3, 2012

Sorry, was too quick. There's one error remaining then:

generate    delayed_job
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:303:in `new_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:313:in `checkout_new_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `block (2 levels) in checkout'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `loop'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:232:in `block in checkout'
    from /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:308:in `clear_cache!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:418:in `_run__2193102986267095823__prepare__2280426419077776492__callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/runar/dev/nin_no/config/environment.rb:5:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
    from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands.rb:25:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
        run    bundle exec guard init from "."

The rest goes through as expected.

@thommahoney
Copy link
Collaborator

This is a bug in the sorting logic. We seem to be running the delayed_job scroll's after_bundle callback before mysql's after_bundle. Therefore the password is not in place and, in my case, the table hadn't been created yet:

      wizard  Running after Bundler callbacks.
      create    spec/support/capybara.rb
      create    spec/requests/home_spec.rb
    generate    delayed_job
/Users/tmahoney/.rvm/gems/ruby-1.9.3-p125@nin_no/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Unknown database 'nin_no_development' (Mysql2::Error)
....
        rake    db:create:all

@drnic
Copy link
Owner

drnic commented May 3, 2012

@thommahoney delayed_job scroll is set to run_after: [eycloud_recipes_on_deploy, mysql, postgresql] already; is this not working?

For the password issue; perhaps we could poll mysql with root/nopassword, if it fails to login then we could prompt for user/password?

@thommahoney
Copy link
Collaborator

@drnic When the mysql after_bundle block runs, it does prompt for the
password after it fails the first time. Unfortunately the run_after sorting
seems to be broken for after_blocks and likely after_everything_blocks too.

On Thu, May 3, 2012 at 3:55 PM, Dr Nic Williams <
[email protected]

wrote:

@thommahoney delayed_job scroll is set to run_after: [eycloud_recipes_on_deploy, mysql, postgresql] already; is this not
working?

For the password issue; perhaps we could poll mysql with root/nopassword,
if it fails to login then we could prompt for user/password?


Reply to this email directly or view it on GitHub:
#32 (comment)

@drnic
Copy link
Owner

drnic commented May 3, 2012

Indeed, sorting is quirky. Sorting shouldn't be quirky.

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

No branches or pull requests

3 participants