southbridgeio / redmine_intouch

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

Установка #46

Closed mixMugz closed 7 years ago

mixMugz commented 7 years ago

Доброго дня.

Не могу поставить ваше творение на redmine-3.3.3

Дано:

Последовательно пытаюсь ставить так:

  1. $ git clone https://github.com/centosadmin/redmine_telegram_common ./plugins/redmine_telegram_common $ bundle install --without development test

  2. $ git clone https://github.com/ogom/redmine_sidekiq ./plugins/redmine_sidekiq $ bundle install --without development test

  3. bundle exec rake redmine:plugins:migrate RAILS_ENV=production (здесь стоит отметить, что если в database.yml не прописаны DB test, development, то вылетаем на этом этапе с ошибкой)

  4. А вот дальше весело. В меню redmine появляется sidekiq - но попытка тыкнуть выдаёт Internal error. Сам sidekiq не запускается: Access denied for user 'root'@'localhost' (using password: NO) /home/redmine/.rvm/gems/ruby-2.3.3/gems/mysql2-0.3.21/lib/mysql2/client.rb:70:inconnect' /home/redmine/.rvm/gems/ruby-2.3.3/gems/mysql2-0.3.21/lib/mysql2/client.rb:70:in initialize' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:18:innew' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in mysql2_connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:innew_connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in checkout_new_connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:inacquire_connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in block in checkout' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/monitor.rb:214:inmon_synchronize' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in checkout' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:inblock in connection' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/monitor.rb:214:in mon_synchronize' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:inconnection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in retrieve_connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_handling.rb:113:inretrieve_connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/connection_handling.rb:87:in connection' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/model_schema.rb:230:intable_exists?' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:97:in get_primary_key' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:85:inreset_primary_key' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:73:in primary_key' /home/redmine/.rvm/gems/ruby-2.3.3/gems/protected_attributes-1.1.4/lib/active_record/mass_assignment_security/attribute_assignment.rb:15:inattributes_protected_by_default' /home/redmine/.rvm/gems/ruby-2.3.3/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:337:in block in protected_attributes_configs' /home/redmine/.rvm/gems/ruby-2.3.3/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:222:inprotected_attributes' /home/redmine/.rvm/gems/ruby-2.3.3/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:126:in block in attr_protected' /home/redmine/.rvm/gems/ruby-2.3.3/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:125:ineach' /home/redmine/.rvm/gems/ruby-2.3.3/gems/protected_attributes-1.1.4/lib/active_model/mass_assignment_security.rb:125:in attr_protected' /opt/redmine-3.3.3/app/models/custom_field.rb:37:in' /opt/redmine-3.3.3/app/models/custom_field.rb:18:in <top (required)>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:457:inload' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:457:in block in load_file' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:647:innew_constants_in' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:456:in load_file' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:354:inrequire_or_load' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:494:in load_missing_constant' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:184:inconst_missing' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:526:in load_missing_constant' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:184:inconst_missing' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:526:in load_missing_constant' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:184:inconst_missing' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:526:in load_missing_constant' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:184:inconst_missing' /opt/redmine-3.3.3/lib/redmine/field_format.rb:90:in field_attributes' /opt/redmine-3.3.3/lib/redmine/field_format.rb:93:in' /opt/redmine-3.3.3/lib/redmine/field_format.rb:50:in <module:FieldFormat>' /opt/redmine-3.3.3/lib/redmine/field_format.rb:21:in' /opt/redmine-3.3.3/lib/redmine/field_format.rb:20:in <top (required)>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:inrequire' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in block in require' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:inload_dependency' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in require' /opt/redmine-3.3.3/lib/redmine.rb:40:in<top (required)>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in require' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:inblock in require' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in load_dependency' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:inrequire' /opt/redmine-3.3.3/config/initializers/30-redmine.rb:6:in <top (required)>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:inload' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in block in load' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:inload_dependency' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in load' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:652:inblock in load_config_initializer' /home/redmine/.rvm/gems/ruby-2.3.3/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in instrument' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:651:inload_config_initializer' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in block (2 levels) in <class:Engine>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:615:ineach' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in block in <class:Engine>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:ininstance_exec' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in run' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:inblock in run_initializers' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:228:in block in tsort_each' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:422:in block (2 levels) in each_strongly_connected_component_from' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:431:ineach_strongly_connected_component_from' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:421:in block in each_strongly_connected_component_from' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:ineach' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in tsort_each_child' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:415:incall' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:415:in each_strongly_connected_component_from' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:349:inblock in each_strongly_connected_component' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in each' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:incall' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:347:in each_strongly_connected_component' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:226:intsort_each' /home/redmine/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/tsort.rb:205:in tsort_each' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:inrun_initializers' /home/redmine/.rvm/gems/ruby-2.3.3/gems/railties-4.2.7.1/lib/rails/application.rb:352:in initialize!' /opt/redmine-3.3.3/config/environment.rb:14:in<top (required)>' /home/redmine/.rvm/gems/ruby-2.3.3/gems/sidekiq-4.2.10/lib/sidekiq/cli.rb:244:in require' /home/redmine/.rvm/gems/ruby-2.3.3/gems/sidekiq-4.2.10/lib/sidekiq/cli.rb:244:inboot_system' /home/redmine/.rvm/gems/ruby-2.3.3/gems/sidekiq-4.2.10/lib/sidekiq/cli.rb:50:in run' /home/redmine/.rvm/gems/ruby-2.3.3/gems/sidekiq-4.2.10/bin/sidekiq:12:in<top (required)>' /home/redmine/.rvm/gems/ruby-2.3.3/bin/sidekiq:23:in load' /home/redmine/.rvm/gems/ruby-2.3.3/bin/sidekiq:23:in

    ' /home/redmine/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in eval' /home/redmine/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in
    '`

И вот тут что делать я слабо понимаю. По идее ругань идёт из-за того что нет BD test, dev. Но они мне точно не нужны. Создавать БД? Или что? Куда копать то дальше?

olemskoi commented 7 years ago

Попробуйте выставить environment в production.

Перед командой "RAILS_ENV=production", например

RAILS_ENV=production bundle install --without development test

mixMugz commented 7 years ago

Сделал. Результата не дало. Или мне надо очистить предыдущую установку?

olemskoi commented 7 years ago

Очищать не надо, надо перед каждой командой добавить RAILS_ENV=production.

redis поставили? sidekiq.yml создали, конфиг отредактировали?

mixMugz commented 7 years ago

$ gem list | grep redis redis (3.3.3)

$ cat ./config/sidekiq.yml

# Sample configuration file for Sidekiq.
# Place this file at config/sidekiq.yml and Sidekiq will
# pick it up automatically.
---
:pidfile: tmp/pids/sidekiq.pid
:logfile: log/sidekiq.log
:timeout: 30
:queues:
  - default
  - telegram
olemskoi commented 7 years ago

Предложенный мной конфиг совсем другого содержания.

Сам redis установили, запустили? redmine_sidekiq его требует.

mixMugz commented 7 years ago

Предложенный мной конфиг совсем другого содержания. Сам redis установили, запустили? redmine_sidekiq его требует.

  1. Не вижу информации по redis и его настройке для redmine_sidekiq.
  2. Можете пояснить конфиг предложенный вами и заодно уточнить где именно он вами предложен (я видимо пропустил в дебрях страниц)? Что вписывается в namespace?
mixMugz commented 7 years ago

Ну и как я уже написал. redis установился в гемах. О запуске и его настройки информации не вижу.

olemskoi commented 7 years ago

https://github.com/ogom/redmine_sidekiq/blob/master/config/sidekiq.yml.example - как видно из пути, это конфиг внутри плагина redmine_sidekiq. Его дефолтных настроек должно быть достаточно. Нужно установить yum install redis, добавить его в автозагрузку, запустить. sidekiq требует redis.

olemskoi commented 7 years ago

UPD: в нашем случае было достаточно создать redmine/config/sidekiq.yml со следующим содержанием:

---
:pidfile: tmp/pids/sidekiq.pid
:logfile: log/sidekiq.log
:timeout: 30
:concurrency: 25
:queues:
  - default
  - telegram
  - index_queue
mixMugz commented 7 years ago

Ага. Спасибо. Сейчас проверю. Для инфо:

yum -y install redis systemctl enable redis systemctl start redis

mixMugz commented 7 years ago

Так конфиг должен выглядеть?

`--- :pidfile: tmp/pids/sidekiq.pid :logfile: log/sidekiq.log :timeout: 30 :concurrency: 25 :queues:

production: redis: url: redis://localhost:6379/8 namespace: mynamespace`

olemskoi commented 7 years ago

Да. Пробелы необходимо соблюдать, подсмотреть их можно в примере. "index_queue" - это от плагина https://github.com/centosadmin/redmine_elasticsearch

mixMugz commented 7 years ago

Отлично. sidekiq запустился. Во всяком случае на вебморде. Конфиг я скопировал из двух ваших конфигов. Пробелы взял оттуда же.

olemskoi commented 7 years ago

Задачу можно закрыть?

mixMugz commented 7 years ago

Подождите. Не торопитесь. Я еще не закончил с redmine_intouch. ;)

mixMugz commented 7 years ago

Да. Пробелы необходимо соблюдать, подсмотреть их можно в примере. "index_queue" - это от плагина https://github.com/centosadmin/redmine_elasticsearch

Уточните, пожалуйста, конфигурационный файл. Там должен быть блок:

production:
redis:
url: redis://localhost:6379/8
namespace: mynamespace

или нет?

olemskoi commented 7 years ago

Нет.

olemskoi commented 7 years ago

У нас нет, наш конфиг я показал выше.

mixMugz commented 7 years ago

Так. Установка успешно завершилась. Буду ковырять дальше. Резюмируя:

mixMugz commented 7 years ago

Можно закрыть этот таск