Closed srekkas closed 6 years ago
OS is centos, and database is MariaDB
[root@localhost redmine]# systemctl status mysqld Unit mysqld.service could not be found. [root@localhost redmine]# systemctl status mariadb ● mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2018-03-07 09:38:34 EET; 3h 44min ago Process: 1054 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS) Process: 968 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS) Main PID: 1053 (mysqld_safe) CGroup: /system.slice/mariadb.service ├─1053 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─1382 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
Mar 07 09:38:31 localhost.localdomain systemd[1]: Starting MariaDB database server... Mar 07 09:38:31 localhost.localdomain mariadb-prepare-db-dir[968]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done. Mar 07 09:38:31 localhost.localdomain mysqld_safe[1053]: 180307 09:38:31 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'. Mar 07 09:38:31 localhost.localdomain mysqld_safe[1053]: 180307 09:38:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql Mar 07 09:38:34 localhost.localdomain systemd[1]: Started MariaDB database server.
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
Can you show your database settings, show to us ls -l /var/run/mysqld/mysqld.sock
for testing you can use our repo https://github.com/noshutdown-ru/vagrant_redmine
test: adapter: mysql2 encoding: utf8 database: redmine_test pool: 5 username: redmine password: bbb socket: /var/lib/mysqld/mysqld.sock
production: adapter: mysql2 encoding: utf8 database: redmine_production pool: 5 username: redmine password: bbb socket: /var/lib/mysql/mysql.sock
ls -l /var/run/mysqld/mysqld.sock ls: cannot access /var/run/mysqld/mysqld.sock: No such file or directory
ls -l /var/run/mariadb/mariadb.pid -rw-rw---- 1 mysql mysql 5 Mar 7 09:38 /var/run/mariadb/mariadb.pid
looks your database have strange configuration, in logs it tried to connect to /var/run/mysqld/mysqld.sock in database settings you define /var/lib/mysqld/mysqld.sock, for testing you can switch to SqLite
i cannot at a moment, because it runs in production.
"fixed" that with: mkdir /var/run/mysqld ln -s /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.sock
now i get
rake redmine:plugins:vault:convert
rake aborted!
Mysql2::Error: Access denied for user 'redmine'@'localhost' to database 'redmine_development'
/usr/local/rvm/gems/ruby-2.4.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:89:in connect' /usr/local/rvm/gems/ruby-2.4.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:89:in
initialize'
looks user 'redmine'@'localhost' not have access
but how can it work without what permissions. Redmine runs like half year now. Many issues, we have like 10 users :)
it tried use database redmine_development maybe your redmine work in production
hell, well i need break from work long ago.
i have only these databases | redmine_production | | redminedb
When you run rake redmine:plugins:vault:convert
you not define RAILS_ENV
example: RAILS_ENV=production bundle exec rake db:migrate
so i dont want mess anything up, i dont use ruby for anything than redmine. what exact commands i need to run?
run rake redmine:plugins:vault:convert RAILS_ENV=production ??
When you run rake you need before define environment RAILS_ENV=production
, before rake call
Sorry it doesn't matter , just define RAILS_ENV=production
so if where are more noobs like me, seems both work
[root@localhost redmine]# rake redmine:plugins:vault:convert RAILS_ENV=production
or
[root@localhost redmine]# export RAILS_ENV=production [root@localhost redmine]# rake redmine:plugins:vault:convert
just,rake redmine:plugins:vault:convert RAILS_ENV=production
but i cannot understand what you tried to do
Use Redmine encryption | Recommended. Don't forget to put your key into database_cipher_key in config/configuration.yml. IMPORTANT: run rake redmine:plugins:vault:convert after changing this switch. |
---|
before you used Vault encryption ? if you not used it - you no need run it
its new plugin install,so i like to use thats Recommended. My test entry key changed to something like "aes ..." after that.
you can delete your test keys end proceed using without convert, just check what new keys decrypted properly
ok thanks for patience
you welcome, we need improve our documentation =)
I am trying install plugin, bet hang at this step
rake redmine:plugins:vault:convert rake aborted! Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) /usr/local/rvm/gems/ruby-2.4.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:89:in'
/var/www/html/redmine/lib/redmine/field_format.rb:21:in
connect' /usr/local/rvm/gems/ruby-2.4.0/gems/mysql2-0.4.9/lib/mysql2/client.rb:89:in
initialize' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb:18:innew' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in
mysql2_connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:innew_connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in
checkout_new_connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:inacquire_connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in
block in checkout' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:incheckout' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in
block in connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:inconnection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in
retrieve_connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:113:inretrieve_connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:87:in
connection' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/model_schema.rb:230:intable_exists?' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/attribute_methods/primary_key.rb:97:in
get_primary_key' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/attribute_methods/primary_key.rb:85:inreset_primary_key' /usr/local/rvm/gems/ruby-2.4.0/gems/activerecord-4.2.8/lib/active_record/attribute_methods/primary_key.rb:73:in
primary_key' /usr/local/rvm/gems/ruby-2.4.0/gems/protected_attributes-1.1.4/lib/active_record/mass_assignment_security/attribute_assignment.rb:15:inattributes_protected_by_default' /usr/local/rvm/gems/ruby-2.4.0/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:337:in
block in protected_attributes_configs' /usr/local/rvm/gems/ruby-2.4.0/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:222:inprotected_attributes' /usr/local/rvm/gems/ruby-2.4.0/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:126:in
block in attr_protected' /usr/local/rvm/gems/ruby-2.4.0/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:125:ineach' /usr/local/rvm/gems/ruby-2.4.0/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:125:in
attr_protected' /var/www/html/redmine/app/models/custom_field.rb:38:in<class:CustomField>' /var/www/html/redmine/app/models/custom_field.rb:18:in
<top (required)>' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:457:inload' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:457:in
block in load_file' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:647:innew_constants_in' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:456:in
load_file' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:354:inrequire_or_load' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:494:in
load_missing_constant' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:184:inconst_missing' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:526:in
load_missing_constant' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:184:inconst_missing' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:526:in
load_missing_constant' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:184:inconst_missing' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:526:in
load_missing_constant' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:184:inconst_missing' /var/www/html/redmine/lib/redmine/field_format.rb:108:in
field_attributes' /var/www/html/redmine/lib/redmine/field_format.rb:111:in<class:Base>' /var/www/html/redmine/lib/redmine/field_format.rb:57:in
<module:Redmine>' /var/www/html/redmine/lib/redmine/field_format.rb:20:in
<top (required)>' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:inrequire' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in
block in require' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:inload_dependency' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in
require' /var/www/html/redmine/lib/redmine.rb:40:in<top (required)>' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in
require' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:inblock in require' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in
load_dependency' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-4.2.8/lib