Content
mysql2 adapter denies credentials on configure openproject
Added by Thomas Wunner over 8 years ago
Hi,
for some strange reasons, I could not connect to my database for the openproject installation using the mysql2 adapter. With my local mysql client it works perfect with the same password.
I followed the instuctions from here (without -ce suffix): https://community.openproject.com/topics/5360
The system is an Ubuntu Server 14.04 LTS with Plesk admin panel.
The output during the configuration task:
DONE [openproject] ./bin/configure [legacy-installer] ./bin/preinstall [mysql] ./bin/preinstall [apache2] ./bin/preinstall [repositories] ./bin/preinstall [smtp] ./bin/preinstall [memcached] ./bin/preinstall No memcached server to install. Skipping. [openproject] ./bin/preinstall [legacy-installer] ./bin/postinstall [mysql] ./bin/postinstall Generating /etc/openproject/conf.d/database... [apache2] ./bin/postinstall [repositories] ./bin/postinstall [smtp] ./bin/postinstall [memcached] ./bin/postinstall [openproject] ./bin/postinstall rake aborted! Mysql2::Error: Access denied for user 'openproject'@'127.0.0.1' (using password: YES) /opt/openproject/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `connect' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `initialize' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_handling.rb:113:in `retrieve_connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_handling.rb:87:in `connection' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/model_schema.rb:230:in `table_exists?' /opt/openproject/config/initializers/30-redmine.rb:36:in `<top (required)>' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:268:in `load' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:268:in `block in load' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:240:in `load_dependency' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:268:in `load' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/engine.rb:652:in `block in load_config_initializer' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/notifications.rb:166:in `instrument' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/engine.rb:651:in `load_config_initializer' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/engine.rb:615:in `each' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/engine.rb:615:in `block in <class:Engine>' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:30:in `instance_exec' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:30:in `run' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:55:in `block in run_initializers' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:44:in `each' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:44:in `tsort_each_child' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:54:in `run_initializers' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/application.rb:352:in `initialize!' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/railtie.rb:194:in `public_send' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/railtie.rb:194:in `method_missing' /opt/openproject/config/environment.rb:34:in `<top (required)>' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `require' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `block in require' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:240:in `load_dependency' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `require' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/application.rb:328:in `require_environment!' /opt/openproject/vendor/bundle/ruby/2.1.0/gems/railties-4.2.5.2/lib/rails/application.rb:457:in `block in run_tasks_blocks' Tasks: TOP => db:migrate => environment (See full trace by running task with --trace)
Two other issues:
1st: In /home/openproject is empty
2nd: I was not able to use strong password, because the test database connection uses an URI that does not URI encode the given password. So every special char is not allowed here. I am not familiar with ruby, so I can´t fix it for myself.
Any help would be welcome.
Cheers,
Thomas
Replies (4)
Similar problem here.
Running packaged openproject 5.0.20 on CentOS 6.
After upgrading to latest 6.0.x release the mysql connection is refused.
The initial openproject configure ran without errors but the website shows a 503 error.
In the logs there’s a mysql2 connection closed error.
Also I’m not able to run reconfigure/configure due to mysql connection rejection.
Not even a connect to mysql via cli is working anymore.
Any conclusions?
By the way, upgrade from 5.0.17 to 5.0.20 ran without any problem.
Hi guys,
could you check the output of
openproject config
and see whether the DATABASE_URL contains the correct password? We have had issues with some characters in that URI before and I’m not certain that is fully resolved (as you mentioned, Thomas).Florian: What error do you get when running
openproject reconfigure@ ? That shouldn’t access the database until you’ve configured your MySQL connection. If you can’t connect with the credentials manually, I suspect something is at fault with your MySQL server itself.Best,
Oliver
Hello Oliver,
thanks for your response.
With 5.0.20 everything works flawless.
I can get the URL with
openproject config:get DATABASE_URL
I also can connect to the DB via mysql cli with the given password of the output of the command above.
After upgrading to 6.0.x:
openproject config:get DATABASE_URL
is the same as with 5.0.20By the way, copy and paste would be nice in this tui for entering the password. :-)
I got a snapshot from my VM with 5.0.20 so yes, the error is reproduceable (I already did twice).
I don’t think its a database related problem.
I’ve same issue and i discovered that openproject don’t want db psw using chars lik %