southbridgeio / redmine_intouch

Redmine Intouch plugin sends notifications to users via Telegram and E-mail
MIT License
64 stars 16 forks source link

При запуске бота появляется ошибка обращения к БД #7

Closed zaur45 closed 8 years ago

zaur45 commented 8 years ago

При попытке запуска бота: bundle exec rake intouch:telegram:bot PID_DIR='/var/run/'

Бот не стартует. В консоли следующий вывод:

rake aborted!
Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/opt/bitnami/apps/redmine/htdocs/app/models/custom_field.rb:32:in `<class:CustomField>'
/opt/bitnami/apps/redmine/htdocs/app/models/custom_field.rb:18:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/lib/redmine/field_format.rb:83:in `field_attributes'
/opt/bitnami/apps/redmine/htdocs/lib/redmine/field_format.rb:86:in `<class:Base>'
/opt/bitnami/apps/redmine/htdocs/lib/redmine/field_format.rb:48:in `<module:FieldFormat>'
/opt/bitnami/apps/redmine/htdocs/lib/redmine/field_format.rb:19:in `<module:Redmine>'
/opt/bitnami/apps/redmine/htdocs/lib/redmine/field_format.rb:18:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/lib/redmine.rb:38:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/config/initializers/30-redmine.rb:6:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/config/environment.rb:14:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/plugins/a_common_libs/lib/tasks/a_common_libs.rake:1:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/lib/tasks/redmine.rake:179:in `block in <top (required)>'
/opt/bitnami/apps/redmine/htdocs/lib/tasks/redmine.rake:179:in `each'
/opt/bitnami/apps/redmine/htdocs/lib/tasks/redmine.rake:179:in `<top (required)>'
/opt/bitnami/apps/redmine/htdocs/Rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)

Сам Redmine, при этом, работает нормально. Из особенностей: БД и Redmine находится на разных серверах.

Environment:
  Redmine version                3.1.1.stable
  Ruby version                   2.0.0-p647 (2015-08-18) [x86_64-linux]
  Rails version                  4.2.4
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.13
  Git                            1.9.5
  Filesystem                     
Redmine plugins:
  a_common_libs                  2.1.8
  redmine_banner                 0.1.1
  redmine_code_review            0.7.0
  redmine_default_assign         0.4
  redmine_intouch                0.2.1
  redmine_issue_checklist        2.0.8
  redmine_issue_templates        0.1.0
  redmine_ldap_sync              2.0.7.devel.g202f7c74b9-dirty
  redmine_mail_checker           1.0.0-devel
  redmine_people                 1.2.0
  redmine_sidekiq                2.1.0
  status_button                  0.1.0
  usability                      2.1.2
# uname -a
Linux debian-srv-2 3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
zaur45 commented 8 years ago

Судя по всему, проблема была в конфигурационном файле. Настройки базы для development не были сделаны. Зачистил все ненужные строки, добавил при запуске бота RAILS_ENV=production --- отработало без ошибок.