Open dronmaxman opened 5 years ago
Нужно запускать в production-окружении (RAILS_ENV=production)
Нужно запускать в production-окружении (RAILS_ENV=production)
Да, прошло без ошибок. Как теперь понять что БОТ работает? в логе ничего нет, куда смотреть? Если написать боту, то он ничего не отвечает, просто молчит.
root@vs-kv-web-rm02:/var/www/html/redmine# ls -l /var/www/html/redmine/log/ total 2416 drwxr-xr-x 2 www-data www-data 4096 Jul 2 19:57 chat_telegram -rw-rw-r-- 1 www-data www-data 32 Jun 10 15:52 delete.me -rw-r--r-- 1 www-data www-data 0 Jul 2 19:35 development.log drwxr-xr-x 2 www-data www-data 4096 Jul 2 19:57 intouch -rw-r--r-- 1 www-data www-data 2406731 Jul 3 15:52 production.log drwxr-xr-x 2 www-data www-data 4096 Jul 3 01:25 redmine_2chat drwxr-xr-x 2 www-data www-data 4096 Jul 3 15:45 redmine_bots -rw-r--r-- 1 www-data www-data 31704 Jul 3 15:52 sidekiq.log drwxr-xr-x 2 www-data www-data 4096 Jul 2 19:42 telegram_common root@vs-kv-web-rm02:/var/www/html/redmine# ls -l /var/www/html/redmine/log/redmine_bots/ total 19964 -rw-rw-rwT 1 www-data www-data 67 Jul 3 15:45 bot.log -rw------- 1 www-data www-data 9941277 Jul 3 13:03 tdlib.log -rw------- 1 www-data www-data 10485873 Jul 3 09:47 tdlib.log.old
Нужно запускать в production-окружении (RAILS_ENV=production)
Да, прошло без ошибок. Как теперь понять что БОТ работает? в логе ничего нет, куда смотреть? Если написать боту, то он ничего не отвечает, просто молчит.
root@vs-kv-web-rm02:/var/www/html/redmine# ls -l /var/www/html/redmine/log/ total 2416 drwxr-xr-x 2 www-data www-data 4096 Jul 2 19:57 chat_telegram -rw-rw-r-- 1 www-data www-data 32 Jun 10 15:52 delete.me -rw-r--r-- 1 www-data www-data 0 Jul 2 19:35 development.log drwxr-xr-x 2 www-data www-data 4096 Jul 2 19:57 intouch -rw-r--r-- 1 www-data www-data 2406731 Jul 3 15:52 production.log drwxr-xr-x 2 www-data www-data 4096 Jul 3 01:25 redmine_2chat drwxr-xr-x 2 www-data www-data 4096 Jul 3 15:45 redmine_bots -rw-r--r-- 1 www-data www-data 31704 Jul 3 15:52 sidekiq.log drwxr-xr-x 2 www-data www-data 4096 Jul 2 19:42 telegram_common root@vs-kv-web-rm02:/var/www/html/redmine# ls -l /var/www/html/redmine/log/redmine_bots/ total 19964 -rw-rw-rwT 1 www-data www-data 67 Jul 3 15:45 bot.log -rw------- 1 www-data www-data 9941277 Jul 3 13:03 tdlib.log -rw------- 1 www-data www-data 10485873 Jul 3 09:47 tdlib.log.old
Методом тыка запустил вот так
bundle exec rake redmine_bots:telegram RAILS_ENV=production PID_DIR='/var/www/html/redmine/tmp/pids/'
Прошел регистрацию, появилась связка в базе данных id_te.
Теперь второй вопрос. Не получается авторизовать Телеграмм.
Ввожу номер телефона и получаю ошибку.
Несколько раз обновляю страницу и снова ошибка Unknown error. Please, see TDlib logs.
Теперь второй вопрос. Не получается авторизовать Телеграмм. Ввожу номер телефона и получаю ошибку.
Несколько раз обновляю страницу и снова ошибка Unknown error. Please, see TDlib logs.
смог авторизоваться?
Немного обновил конфиг сервера.
Environment:
Redmine version 3.4.11.stable
Ruby version 2.4.4-p296 (2018-03-28) [x86_64-linux]
Rails version 4.2.11.1
Environment production
Database adapter Mysql2
redmine_sidekiq 2.1.0
redmine_bots 0.4.1
### GEM
sidekiq (5.2.9)
Да, авторизоваться получилось. Но не могу заставить бота работать. Запускаю через getUpdate получаю
redmine@tvs-kv-web-rm03:~$ bundle exec rake redmine_bots:telegram RAILS_ENV=production PID_DIR='/opt/redmine/tmp/pids/'
[dry-types] Dry::Types.module is deprecated and will be removed in the next major version
Use Dry.Types() instead. Beware, it exports strict types by default, for old behavior use Dry.Types(default: :nominal). See more options in the changelog
/opt/redmine/config/application.rb:5:in `<top (required)>'
`Redis#exists(key)` will return an Integer in redis-rb 4.3. `exists?` returns a boolean, you should use it instead. To opt-in to the new behavior now you can set Redis.exists_returns_integer = true. To disable this message and keep the current (boolean) behaviour of 'exists' you can set `Redis.exists_returns_integer = false`, but this option will be removed in 5.0. (/opt/redmine/vendor/bundle/ruby/2.4.0/gems/sidekiq-cron-1.2.0/lib/sidekiq/cron/job.rb:464:in `block in save')
redmine@tvs-kv-web-rm03:~$
при этом бот обрабатывает команды в очереди и снова перестает отвечать.
Так же нашел ошибку в log/redmine_bot/bot.log
I, [2021-10-09T01:22:24.345979 #19527] INFO -- : Start daemon...
I, [2021-10-09T01:22:24.349735 #19527] INFO -- : Telegram Bot: Connecting to telegram...
I, [2021-10-09T01:34:00.770316 #21005] INFO -- : Start daemon...
I, [2021-10-09T01:34:00.773777 #21005] INFO -- : Telegram Bot: Connecting to telegram...
I, [2021-10-10T15:54:55.118291 #44915] INFO -- : Start daemon...
I, [2021-10-10T15:54:55.123678 #44915] INFO -- : Telegram Bot: Connecting to telegram...
D, [2021-10-10T15:54:56.535084 #44915] DEBUG -- : RedmineBots::Telegram::Bot#send_message
D, [2021-10-10T15:54:56.535254 #44915] DEBUG -- : chat_id: 756060824
D, [2021-10-10T15:54:56.535324 #44915] DEBUG -- : message: Чтобы связать аккаунты Redmine и Telegram, пожалуйста, введите команду /connect.
D, [2021-10-10T15:54:56.535387 #44915] DEBUG -- : params: {}
E, [2021-10-10T15:55:01.769638 #44915] ERROR -- : GLOBAL Timeout::Error: Operation timed out after 5001 milliseconds with 0 bytes received
/opt/redmine/plugins/redmine_bots/lib/redmine_bots/telegram/bot/faraday_adapter.rb:43:in `rescue in call'
/opt/redmine/plugins/redmine_bots/lib/redmine_bots/telegram/bot/faraday_adapter.rb:5:in `call'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/faraday-1.8.0/lib/faraday/request/url_encoded.rb:25:in `call'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/faraday-1.8.0/lib/faraday/request/multipart.rb:30:in `call'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/faraday-1.8.0/lib/faraday/rack_builder.rb:154:in `build_response'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/faraday-1.8.0/lib/faraday/connection.rb:516:in `run_request'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/faraday-1.8.0/lib/faraday/connection.rb:281:in `post'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/telegram-bot-ruby-0.16.0/lib/telegram/bot/api.rb:49:in `call'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/telegram-bot-ruby-0.16.0/lib/telegram/bot/api.rb:37:in `method_missing'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/telegram-bot-ruby-0.16.0/lib/telegram/bot/client.rb:30:in `fetch_updates'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/telegram-bot-ruby-0.16.0/lib/telegram/bot/client.rb:25:in `listen'
/opt/redmine/plugins/redmine_bots/lib/tasks/telegram.rake:29:in `block (3 levels) in <top (required)>'
/opt/redmine/plugins/redmine_bots/lib/redmine_bots/utils.rb:25:in `daemonize'
/opt/redmine/plugins/redmine_bots/lib/tasks/telegram.rake:26:in `block (2 levels) in <top (required)>'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/opt/redmine/vendor/bundle/ruby/2.4.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/redmine/vendor/bundle/ruby/2.4.0/bin/rake:23:in `load'
/opt/redmine/vendor/bundle/ruby/2.4.0/bin/rake:23:in `<top (required)>'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/opt/redmine/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
Версия ПО
Не могу заставить бота работать в режиме getUpdates. При выполнении команды bundle exec rake redmine_bots:telegram