southbridgeio / redmine_chat_telegram

Control Redmine issues via Telegram bot and chats
MIT License
60 stars 9 forks source link

Bot initialization failure #30

Closed paidfire closed 7 years ago

paidfire commented 7 years ago

I tried to install plugin following the readme instructions but ended up with error at bot init step.

bundle exec rake chat_telegram:bot PID_DIR='/var/run/' RAILS_ENV=production
/usr/local/lib/ruby/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
/usr/local/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::VCF
/usr/local/lib/ruby/gems/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of VCF was here
root@**:/var/redmine/redmine# rake aborted!
NameError: uninitialized constant Telegram
/var/redmine/redmine/plugins/redmine_chat_telegram/lib/tasks/chat_telegram.rake:60:in `chat_telegram_bot_init'
/var/redmine/redmine/plugins/redmine_chat_telegram/lib/tasks/chat_telegram.rake:141:in `block (2 levels) in <top (required)>'
Tasks: TOP => chat_telegram:bot

My telegram-cli is running as daemon (started with a modified init.d script from extras), its pid file is in /var/run

olemskoi commented 7 years ago

Hello,

Did you install https://github.com/centosadmin/redmine_telegram_common plugin?

paidfire commented 7 years ago

Yes, I installed all plugins that are listed there. That one, redis, sidekiq.

olemskoi commented 7 years ago

Can you please show screnshot of page with plugins and versions from admin panel?

paidfire commented 7 years ago

Sure, system's overview is below. Telegram CLI version is 1.4.1

Environment:
  Redmine version                3.3.1.stable.15942
  Ruby version                   2.3.3-p222 (2016-11-21) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.3
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  a_common_libs                  2.2.7
  clipboard_image_paste          1.10
  easy_gantt                     1.7
  easy_wbs                       2016-0.0
  luxury_buttons                 3.8.6
  redmine_2fa                    1.3.2
  redmine_agile                  1.4.2
  redmine_chat_telegram          1.6.0
  redmine_checklists             3.1.5
  redmine_contacts               4.0.5
  redmine_contacts_invoices      4.1.3
  redmine_finance                2.1.1
  redmine_inline_note_images_plugin 0.0.1
  redmine_intouch                0.4.1
  redmine_knowledgebase          3.2.1
  redmine_people                 1.2.0
  redmine_products               2.0.1
  redmine_sidekiq                2.1.0
  redmine_telegram_common        0.0.15
olemskoi commented 7 years ago

How did you install redmine? With bundle or with system gem?

olemskoi commented 7 years ago

Please send output of commands "bundle gem list" and "gem list".

paidfire commented 7 years ago
root@**:/var/redmine/redmine# bundle gem list
Creating gem 'list'...
Do you want to generate tests with your gem?
Type 'rspec' or 'minitest' to generate those test files now and in the future. rspec/minitest/(none):
Do you want to license your code permissively under the MIT license?
This means that any other developer or company will be legally allowed to use your code for free as long as they admit you created it. You can read more about the MIT license at http://choosealicense.com/licenses/mit. y/(n):
Do you want to include a code of conduct in gems you generate?
Codes of conduct can increase contributions to your project by contributors who prefer collaborative, safe spaces. You can read more about the code of conduct at contributor-covenant.org. Having a code of conduct means agreeing to the responsibility of enforcing it, so be sure that you are prepared to do that. Be sure that your email address is specified as a contact in the generated code of conduct so that people know who to contact in case of a violation. For suggestions about how to enforce codes of conduct, see http://bit.ly/coc-enforcement. y/(n):
      create  list/Gemfile
      create  list/.gitignore
      create  list/lib/list.rb
      create  list/lib/list/version.rb
      create  list/list.gemspec
      create  list/Rakefile
      create  list/README.md
      create  list/bin/console
      create  list/bin/setup
Initializing git repo in /var/redmine/redmine/list

root@**:/var/redmine/redmine# gem list

*** LOCAL GEMS ***

actionmailer (4.2.7.1)
actionpack (4.2.7.1)
actionpack-action_caching (1.2.0)
actionpack-xml_parser (1.0.2)
actionview (4.2.7.1)
active_model_otp (1.2.0)
activejob (4.2.7.1)
activemodel (4.2.7.1)
activerecord (4.2.7.1)
activesupport (4.2.7.1)
acts-as-taggable-on (3.5.0)
addressable (2.5.0)
arel (6.0.4)
awesome_nested_set (3.1.1)
axiom-types (0.1.1)
bigdecimal (1.2.8)
builder (3.2.3)
bundle (0.0.1)
bundler (1.14.4)
byebug (9.0.6)
chunky_png (1.3.8)
coderay (1.1.1)
coercible (1.0.0)
concurrent-ruby (1.0.4)
connection_pool (2.2.1)
css_parser (1.4.8)
descendants_tracker (0.0.4)
did_you_mean (1.0.0)
equalizer (0.0.11)
erubis (2.7.0)
faraday (0.11.0)
globalid (0.3.7)
htmlentities (4.3.1)
httpclient (2.8.3)
i18n (0.8.0)
ice_nine (0.11.2)
io-console (0.4.5)
jquery-rails (3.1.4)
json (1.8.6, 1.8.3)
liquid (2.6.3)
loofah (2.0.3)
mail (2.6.4)
mime-types (3.1)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_portile2 (2.1.0)
minitest (5.10.1, 5.8.5)
multi_json (1.12.1)
multipart-post (2.0.0)
mysql2 (0.3.21)
net-ldap (0.12.1)
net-telnet (0.1.1)
nokogiri (1.7.0.1)
pdf-core (0.2.5)
pg (0.18.4)
power_assert (0.2.6)
prawn (1.0.0)
protected_attributes (1.1.3)
psych (2.1.0)
public_suffix (2.0.5)
rack (1.6.5)
rack-openid (1.4.2)
rack-protection (1.5.3)
rack-test (0.6.3)
rails (4.2.7.1)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.8)
rails-html-sanitizer (1.0.3)
railties (4.2.7.1)
rake (12.0.0, 10.4.2)
rbpdf (1.19.0)
rbpdf-font (1.19.0)
rdoc (4.2.1)
redcarpet (3.3.4)
redis (3.3.3)
redis-namespace (1.5.3)
redis_rate_limiter (0.1.0)
redmine_crm (0.0.23)
redmine_extensions (0.1.18)
request_store (1.0.5)
rmagick (2.16.0)
roadie (3.2.1)
roadie-rails (1.1.1)
rotp (3.3.0)
rqrcode (0.10.1)
ruby-ole (1.2.12)
ruby-openid (2.3.0)
rufus-scheduler (3.3.4)
sidekiq (4.2.9)
sidekiq-cron (0.4.5)
sidekiq-failures (0.4.5)
sidekiq-rate-limiter (0.1.1)
sinatra (1.4.8)
spreadsheet (0.6.9)
sprockets (3.7.1)
sprockets-rails (3.2.0)
sqlite3 (1.3.13)
telegram-bot-ruby (0.7.2)
telegrammer (0.8.0)
test-unit (3.1.5)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.6)
ttfunk (1.1.1)
tzinfo (1.2.2)
vcard (0.2.15)
virtus (1.0.5)
wicked_pdf (1.1.0)
wkhtmltopdf-binary (0.12.3.1)
ya2yaml (0.31)
paidfire commented 7 years ago

How did you install redmine? With bundle or with system gem?

I'm not sure I understood your question completely. I installed gems in Redmine using bundler. I have multiple ruby environments on server managed by rvm, and my Redmine is not using system gems.

olemskoi commented 7 years ago

Please execute in redmine directory using your redmine rvm env. bundle exec gem list

paidfire commented 7 years ago
root@**:/var/redmine/redmine# rvm use ruby-2.3.3
Using /usr/share/rvm/gems/ruby-2.3.3

root@**:/var/redmine/redmine# bundle exec gem list

*** LOCAL GEMS ***

actionmailer (4.2.7.1)
actionpack (4.2.7.1)
actionpack-action_caching (1.2.0)
actionpack-xml_parser (1.0.2)
actionview (4.2.7.1)
active_model_otp (1.2.0)
activejob (4.2.7.1)
activemodel (4.2.7.1)
activerecord (4.2.7.1)
activesupport (4.2.7.1)
acts-as-taggable-on (3.5.0)
addressable (2.5.0)
arel (6.0.4)
awesome_nested_set (3.1.1)
axiom-types (0.1.1)
builder (3.2.3)
bundler (1.14.5)
byebug (9.0.6)
chunky_png (1.3.8)
coderay (1.1.1)
coercible (1.0.0)
concurrent-ruby (1.0.4)
connection_pool (2.2.1)
css_parser (1.4.8)
descendants_tracker (0.0.4)
equalizer (0.0.11)
erubis (2.7.0)
faraday (0.11.0)
globalid (0.3.7)
htmlentities (4.3.1)
httpclient (2.8.3)
i18n (0.8.0)
ice_nine (0.11.2)
jquery-rails (3.1.4)
json (1.8.6)
liquid (2.6.3)
loofah (2.0.3)
mail (2.6.4)
mime-types (3.1)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
multipart-post (2.0.0)
mysql2 (0.3.21)
net-ldap (0.12.1)
nokogiri (1.7.0.1)
pdf-core (0.2.5)
pg (0.18.4)
pidfile (0.3.1)
prawn (1.0.0)
protected_attributes (1.1.3)
public_suffix (2.0.5)
rack (1.6.5)
rack-openid (1.4.2)
rack-protection (1.5.3)
rack-test (0.6.3)
rails (4.2.7.1)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.8)
rails-html-sanitizer (1.0.3)
railties (4.2.7.1)
rake (12.0.0)
rbpdf (1.19.0)
rbpdf-font (1.19.0)
redcarpet (3.3.4)
redis (3.3.3)
redis-namespace (1.5.3)
redis_rate_limiter (0.1.0)
redmine_acts_as_taggable_on (1.1.0)
redmine_crm (0.0.23)
redmine_extensions (0.1.18)
request_store (1.0.5)
rmagick (2.16.0)
roadie (3.2.1)
roadie-rails (1.1.1)
rotp (3.3.0)
rqrcode (0.10.1)
ruby-ole (1.2.12)
ruby-openid (2.3.0)
rufus-scheduler (3.3.4)
sidekiq (4.2.9)
sidekiq-cron (0.4.5)
sidekiq-failures (0.4.5)
sidekiq-rate-limiter (0.1.1)
sinatra (1.4.8)
spreadsheet (0.6.9)
sprockets (3.7.1)
sprockets-rails (3.2.0)
sqlite3 (1.3.13)
telegram-bot-ruby (0.7.2)
telegrammer (0.8.0)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.6)
ttfunk (1.1.1)
tzinfo (1.2.2)
vcard (0.2.15)
virtus (1.0.5)
wicked_pdf (1.1.0)
wkhtmltopdf-binary (0.12.3.1)
ya2yaml (0.31)
olemskoi commented 7 years ago

Please try

rm Gemfile.lock gem install

Then plugin migrations and run again.

olemskoi commented 7 years ago

You can also try to update plugins with "git pull".

paidfire commented 7 years ago

Sadly, it didn't help.

root@**:/var/redmine/redmine# bundle exec rake chat_telegram:bot PID_DIR='/var/run/' RAILS_ENV=production
/usr/share/rvm/gems/ruby-2.3.3/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is duplicated and overwritten on line 466
/usr/share/rvm/gems/ruby-2.3.3/gems/actionpack-4.2.7.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::VCF
/usr/share/rvm/gems/ruby-2.3.3/gems/actionpack-4.2.7.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of VCF was here
root@**:/var/redmine/redmine# rake aborted!
NameError: uninitialized constant Telegram
/var/redmine/redmine/plugins/redmine_chat_telegram/lib/tasks/chat_telegram.rake:60:in `chat_telegram_bot_init'
/var/redmine/redmine/plugins/redmine_chat_telegram/lib/tasks/chat_telegram.rake:141:in `block (2 levels) in <top (required)>'
/usr/share/rvm/gems/ruby-2.3.3/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/cli/exec.rb:74:in `load'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/cli/exec.rb:27:in `run'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/cli.rb:335:in `exec'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/cli.rb:20:in `dispatch'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/cli.rb:11:in `start'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/exe/bundle:32:in `block in <top (required)>'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/usr/share/rvm/gems/ruby-2.3.3/gems/bundler-1.14.5/exe/bundle:24:in `<top (required)>'
/usr/share/rvm/gems/ruby-2.3.3/bin/bundle:22:in `load'
/usr/share/rvm/gems/ruby-2.3.3/bin/bundle:22:in `<main>'
Tasks: TOP => chat_telegram:bot
(See full trace by running task with --trace)
paidfire commented 7 years ago

Nevermind, I pulled last update for your plugin and it worked. Thanks for help.