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

getting error while trying parce big json #34

Open
eskornev opened this issue Apr 27, 2018 · 7 comments
Open

getting error while trying parce big json #34

eskornev opened this issue Apr 27, 2018 · 7 comments

Comments

@eskornev
Copy link

Hello!
I'm using bot in docker, and there is problem with big alerting message, in telegram chat we getting "Error sending message, checkout logs".
In docker logs there are errors "Error sending message: Bad Request: can't parse entities: Unexpected end tag at byte offset 0", with different digits at the end.
JSON data is here: https://pastebin.com/31uZTPZa

@hryamzik
Copy link
Collaborator

Can you reproduce this using tests?

@eskornev
Copy link
Author

eskornev commented Apr 27, 2018

yes, using docker on local machine:
curl -H "Content-Type: application/json" -d '<json_from_pastebin>' http://localhost:9087/alert/<chat_id>

result is error:
{"err":"Bad Request: can't parse entities: Unclosed start tag at byte offset 3890","message":{"message_id":0,"from":null,"date":0,"chat":null,"forward_from":null,"forward_from_chat":null,"forward_from_message_id":0,"forward_date":0,"reply_to_message":null,"edit_date":0,"text":"","entities":null,"audio":null,"document":null,"game":null,"photo":null,"sticker":null,"video":null,"video_note":null,"voice":null,"caption":"","contact":null,"location":null,"venue":null,"new_chat_members":null,"left_chat_member":null,"new_chat_title":"","new_chat_photo":null,"delete_chat_photo":false,"group_chat_created":false,"supergroup_chat_created":false,"channel_chat_created":false,"migrate_to_chat_id":0,"migrate_from_chat_id":0,"pinned_message":null,"invoice":null,"successful_payment":null},"srcmsg":"\n\u003cb\u003eLabels:\u003c/b\u003e\n alertname = \u003ccode\u003eKube_zone1_container_is_not_running\u003c/code\u003e\n container =...

@ainmosni
Copy link

Yeah I'm getting these as well, makes it spam telegram.

@pvlltvk
Copy link

pvlltvk commented Sep 5, 2018

Getting same error, as i can understand the error arise when bot try to split big json to multiple messages, and as a result message have invalid html format (without end tag).

@hryamzik
Copy link
Collaborator

hryamzik commented Sep 7, 2018

PRs are welcomed.

@favadi
Copy link

favadi commented Sep 18, 2018

Splitting HTML document is not easy. As an workaround we could add this to the config.yaml file to avoid splitting. Notice that Telegram might refuse to send if the message is too big.

split_msg_byte: 2147483647 # math.MaxInt32

@yctn
Copy link

yctn commented Feb 7, 2019

im having the same issue. any news on this?

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

6 participants