Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Бот не реагирует на вторую группу #33

Closed
m1roff opened this issue Feb 17, 2017 · 10 comments
Closed

Бот не реагирует на вторую группу #33

m1roff opened this issue Feb 17, 2017 · 10 comments

Comments

@m1roff
Copy link

m1roff commented Feb 17, 2017

Добавил бота в 1ую группу, все отлично работает, бот сразу написал

Здравствуйте! Я добавил этот чат для уведомлений из Redmine.

Добавляю во вторую, в чате написано, что я добавил бота, в списках участника бот есть, но сообщения от него никакого нет (. В Логах пусто

@m1roff
Copy link
Author

m1roff commented Feb 17, 2017

при рестарте бота на сервере, нашел ошибку

I, [2017-02-17T14:08:44.922215 #15792]  INFO -- : Start daemon...
I, [2017-02-17T14:08:44.945022 #15792]  INFO -- : Telegram Bot: Connecting to telegram...
I, [2017-02-17T14:08:45.050262 #15792]  INFO -- : peacedish_bot: connected
I, [2017-02-17T14:08:45.050403 #15792]  INFO -- : peacedish_bot: waiting for new users and group chats...
E, [2017-02-17T14:08:45.250566 #15792] ERROR -- : GLOBAL ERROR RangeError: 1001117150133 is out of range for ActiveRecord::Type::Integer with limit 4
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/type/integer.rb:45:in `ensure_in_range'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/type/integer.rb:23:in `type_cast_for_database'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/quoting.rb:13:in `quote'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `block in compile'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `map'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `compile'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `to_sql'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:39:in `find_by_sql'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:639:in `exec_queries'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:515:in `load'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:243:in `to_a'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/finder_methods.rb:500:in `find_nth_with_limit'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/finder_methods.rb:484:in `find_nth'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/finder_methods.rb:127:in `first'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/protected_attributes-1.1.3/lib/active_record/mass_assignment_security/relation.rb:49:in `first_or_initialize'
/home/peacedata/redmine/plugins/redmine_intouch/lib/intouch/telegram_bot.rb:40:in `fetch_group_chat'
/home/peacedata/redmine/plugins/redmine_intouch/lib/intouch/telegram_bot.rb:36:in `group_chat'
/home/peacedata/redmine/plugins/redmine_intouch/lib/intouch/telegram_bot.rb:8:in `call'
/home/peacedata/redmine/plugins/redmine_intouch/lib/tasks/intouch.rake:52:in `block (4 levels) in <top (required)>'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/telegrammer-0.8.0/lib/telegrammer/bot.rb:71:in `block (2 levels) in get_updates'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/telegrammer-0.8.0/lib/telegrammer/bot.rb:68:in `each'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/telegrammer-0.8.0/lib/telegrammer/bot.rb:68:in `block in get_updates'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/telegrammer-0.8.0/lib/telegrammer/bot.rb:61:in `loop'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/telegrammer-0.8.0/lib/telegrammer/bot.rb:61:in `get_updates'
/home/peacedata/redmine/plugins/redmine_intouch/lib/tasks/intouch.rake:50:in `block (3 levels) in <top (required)>'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `block in execute'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `each'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:80:in `block in run'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/home/peacedata/.rbenv/versions/2.3.3/bin/rake:22:in `load'
/home/peacedata/.rbenv/versions/2.3.3/bin/rake:22:in `<top (required)>'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/cli/exec.rb:74:in `load'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/cli/exec.rb:27:in `run'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/cli.rb:335:in `exec'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/cli.rb:20:in `dispatch'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/cli.rb:11:in `start'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/exe/bundle:32:in `block in <top (required)>'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/home/peacedata/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.4/exe/bundle:24:in `<top (required)>'
/home/peacedata/.rbenv/versions/2.3.3/bin/bundle:22:in `load'
/home/peacedata/.rbenv/versions/2.3.3/bin/bundle:22:in `<main>'

@m1roff
Copy link
Author

m1roff commented Feb 17, 2017

Обновил ручками тип поля tid таблицы telegram_group_chats на biginteger unsigned и все заработало. (БД MySQL)

@ipcross
Copy link

ipcross commented Feb 17, 2017

Ошибка выше говорит, что бот не запустился. Он вообще не должен на команды отвечать)))
По поводу ошибки сказать не могу, у нас постгрес и мы такое не ловили.

@m1roff
Copy link
Author

m1roff commented Feb 17, 2017

Ну ведь очевидно, что надо подправить? (а у pg длина int и у mysql отличаются?)

@ipcross
Copy link

ipcross commented Feb 17, 2017

Возможно, API телеграма бурно развивается и возможно формат поменялся. Надо проверять.

@ipcross
Copy link

ipcross commented Feb 22, 2017

Добрый день, mirkhamidov. Подскажите, у вас версия telegram-cli - 1.4.1?

@m1roff
Copy link
Author

m1roff commented Feb 24, 2017

А как это можно узнать?

@ipcross
Copy link

ipcross commented Feb 25, 2017

Запустить в терминале telegram-cli и выполнить команду version.

$ telegram-cli 
> version
Telegram-cli version 1.4.1 (uses tgl version 2.1.0)
uses libopenssl for encryption

Я кажется разобрался в чем тут дело, с ранних версиях кли они использовали для id сообщения целое число, а в этой версии стали передавать хэш, который ясное дело не может быть сохранен с целый тип базы данных.

@m1roff
Copy link
Author

m1roff commented Mar 2, 2017

Пишет что команда не найдена

Но в этот раз тоже целое число, только большое, там нет хэша

@arturtr
Copy link

arturtr commented Mar 30, 2017

Добавили миграцию увеличивающую размер поля в базе.
Спасибо за найденный баг.

@arturtr arturtr closed this as completed Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants