Closed Retrodynen closed 2 years ago
Can you print r.body
before this line to see what server gives? https://github.com/ba0f3/telebot.nim/blob/master/src/telebot/private/utils.nim#L199
Hi!
Will do tomorrow afternoon, am about to head to bed :)
I'll show the output of that and then I'll try to get you a minimal reproduction of the issue too. I made this issue in a bit of a rush, sorry.
Thank you for your work on this library!!
From: Huy Doan @.>
To: ba0f3/telebot.nim @.>
CC: Retrodynen @.>; Author @.>
Date: 3 Dec 2021 00:33:40
Subject: Re: [ba0f3/telebot.nim] sam.nim(199, 10)
n.mapper.tokens[n.pos].kind == JSMN_OBJECT
assertionDefect (Issue #67)
Can you print r.body before this line to see what server gives? https://github.com/ba0f3/telebot.nim/blob/master/src/telebot/private/utils.nim#L199
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub[https://github.com/ba0f3/telebot.nim/issues/67#issuecomment-985113549], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AQ2C6QABQ7LO7XXSHIUD2IDUPAF6BANCNFSM5JIBOBSQ]. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAA7CAYAAADFJfKzAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAkSURBVGiB7cExAQAAAMKg9U9tBn+gAAAAAAAAAAAAAAAAAOA2Np8AAXMIPwYAAAAASUVORK5CYII=###24x24:true###][Tracking image][https://github.com/notifications/beacon/AQ2C6QAPZY5LK37ACXDHSSDUPAF6BA5CNFSM5JIBOBS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHK32HTI.gif]
Thank you!
"message":{"message_id":4930974,"from":{"id":484446095,"is_bot":false,"is_deleted":false,"first_name":"Nathan","last_name":"Smith","username":"Ligmanuts"},"chat":{"id":-1001133642811,"title":"/bant/ International Ra
ndom - also Charlottes blog/ModP playground/Molochs Slayers appreciation group","username":"bantchan","type":"supergroup"},"date":1638440871,"text":"Badge #696969"}}]}
/home/zack/.nimble/pkgs/cligen-1.5.19/cligen.nim(788Error: unhandled exception: /home/zack/.nimble/pkgs/sam-0.1.17/sam.nim(239, 10) `node.mapper.tokens[node.pos].kind == JSMN_STRING`
Async traceback:
/home/zack/.nimble/pkgs/cligen-1.5.19/cligen.nim(788) banner
Weird, it seems it's spanning multiple lines?
{"update_id":30499219,
"message":{"message_id":4930974,"from":{"id":484446095,"is_bot":false,"is_deleted":false,"first_name":"Nathan","last_name":"Smith","username":"Ligmanuts"},"chat":{"id":-1001133642811,"title":"/bant/ International Ra
ndom - also Charlottes blog/ModP playground/Molochs Slayers appreciation group","username":"bantchan","type":"supergroup"},"date":1638440871,"text":"Badge #696969"}}]}
/home/zack/.nimble/pkgs/cligen-1.5.19/cligen.nim(788Error: unhandled exception: /home/zack/.nimble/pkgs/sam-0.1.17/sam.nim(239, 10) `node.mapper.tokens[node.pos].kind == JSMN_STRING`
looks weird, Is there newline in chat title?
There isn't
the json you give me is invalid
is this an issue with telegram's servers then or?
I dont think it came from telegram server. maybe you was behind a proxy or somthing?
I'm not behind any proxy at all
Can I give you a file of the raw response from getUpdates via Telegram?
-------- Original Message --------
Subject: Re: [ba0f3/telebot.nim] sam.nim(199, 10)
n.mapper.tokens[n.pos].kind == JSMN_OBJECT
assertionDefect (Issue #67)
From: Huy Doan @.>
To: ba0f3/telebot.nim @.>
Cc: Retrodynen @.>, Author @.>
Date: Tue Dec 07 2021 17:16:31 GMT+0000 (GMT)
I dont think it came from telegram server. maybe you was behind a proxy or somthing?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ba0f3/telebot.nim/issues/67#issuecomment-988120186, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ2C6QFXFE3G2O63TLPAED3UPY6O7ANCNFSM5JIBOBSQ.
yes sure, reach me at @quhng on telegram
I think the result was too large, its a sam
's problem.
Try to reduce number of updates per request by set limit
parameter in loop
or getUpdates
proc
I did bot.poll(timeout=300, limit=10)
instead of bot.poll(timeout=300)
, the same error occurs. :(
@Retrodynen please check it again
Will do!
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(788) banner
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) multiSubs
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(802) multi
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) dispatchstart
/home/tgbot/mbot/banner.nim(112) tgmain
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/api.nim(1185) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1961) waitFor
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1653) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1394) runOnce
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(234) processPendingCallbacks
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncmacro.nim(28) loopNimAsyncContinue
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/api.nim(1179) loopIter
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(96) unmarshal
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(195) toOption
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(96) unmarshal
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(209) toOption
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(180) unref
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(106) unmarshal
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/json.nim(517) []
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/collections/tables.nim(246) []
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/collections/tables.nim(234) raiseKeyError
[[reraised from:
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(788) banner
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) multiSubs
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(802) multi
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) dispatchstart
/home/tgbot/mbot/banner.nim(112) tgmain
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/api.nim(1185) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1963) waitFor
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncfutures.nim(389) read
]]
Error: unhandled exception: key not found: type
Async traceback:
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(788) banner
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) multiSubs
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(802) multi
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) dispatchstart
/home/tgbot/mbot/banner.nim(112) tgmain
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/api.nim(1185) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1961) waitFor
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1653) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1394) runOnce
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(234) processPendingCallbacks
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncmacro.nim(28) loopNimAsyncContinue
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/api.nim(1179) loopIter
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(96) unmarshal
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(195) toOption
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(96) unmarshal
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(209) toOption
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(180) unref
/home/tgbot/.nimble/pkgs/telebot-2022.01.01/telebot/private/utils.nim(106) unmarshal
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/json.nim(517) []
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/collections/tables.nim(246) []
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/collections/tables.nim(234) raiseKeyError
Exception message: key not found: type
Ok I moved to 2022.01.02 and get:
[[reraised from:
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(788) banner
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) multiSubs
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(802) multi
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) dispatchstart
/home/tgbot/mbot/banner.nim(112) tgmain
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/api.nim(1185) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1963) waitFor
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncfutures.nim(389) read
]]
Error: unhandled exception: key not found: correct_option_id
Async traceback:
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(788) banner
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) multiSubs
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(802) multi
/home/tgbot/.nimble/pkgs/cligen-1.5.19/cligen.nim(764) dispatchstart
/home/tgbot/mbot/banner.nim(112) tgmain
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/api.nim(1185) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1961) waitFor
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1653) poll
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(1394) runOnce
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncdispatch.nim(234) processPendingCallbacks
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/asyncmacro.nim(28) loopNimAsyncContinue
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/api.nim(1179) loopIter
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/utils.nim(98) unmarshal
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/utils.nim(189) toOption
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/utils.nim(98) unmarshal
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/utils.nim(189) toOption
/home/tgbot/.nimble/pkgs/telebot-2022.01.02/telebot/private/utils.nim(100) unmarshal
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/json.nim(517) []
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/collections/tables.nim(246) []
/home/tgbot/.choosenim/toolchains/nim-1.6.2/lib/pure/collections/tables.nim(234) raiseKeyError
Exception message: key not found: correct_option_id
[KeyError]
Hi, it seems commit ecb8dc1c895fe67e0739ffba027336dc0a8e750a
made my bot unresponsive to any command, The bot runs and I can see it receive commands in the debug output but it doesn't seem to react to the command at all. If I switch back to dbd11a3684cd8d0db4724ca6494365c5f1ec093b
it works fine. Any ideas?
Close this issue cuz sam
is not being used anymore
Bot randomly starts to crash - change in bot API?
I'm forced to rerun the bot with clean=true to get rid of the message queue, it then works for several more days until the same thing happens.