Problem with sending notification when message contains HTML/code and a lot of escaping

(Michael Pankov) #1

I’ve got this error:

  "error_key": null,
  "message": {
    "chat_id": "@rustycrate",
    "text": "<b>Chikirev Sirguy @cheblin</b> posted in <a href=\"\">Почему ошибка conflicting implementation for</a>\n\n<pre>struct XX(i32);\n\nuse ::std::io::*;\n\nmod a {\n    use ::std::io::*;\n    \n    pub fn s() {} /// same function name\n    \n    impl ::std::io::Read for super::XX {\n        fn read(&mut self, buf: &mut [u8]) -> Result<usize> {\n            unimplemented!()\n        }\n    }\n}\n\nmod b {\n    use ::std::io::*;\n    \n    pub fn s() {} /// same function name\n    \n\n\n    impl ::std::io::Read for super::XX {\n        ...</pre>",
    "parse_mode": "html",
    "disable_web_page_preview": true
  "response_body": {
    "ok": false,
    "error_code": 400,
    "description": "Bad Request: can't parse entities: Expected end tag at byte offset 412"

I think the reason is message.text that has a lot of markup and escaping.

(Kartik Singhal) #2

I believe I just ran into a similar issue, but where do you go to see such a detailed error message? I just have the following error message from /admin/plugins/chat/slack:

(Kartik Singhal) #3

Okay, not so sure anymore if it’s the same problem as yours, but documenting what I am seeing in my Discourse instance, could probably go a new topic, but I can’t decide.

Dashboard says (and I have no idea to how to make this go away):

Some problems have been found with your installation of Discourse:
Some chat integration channels have errors. Visit the chat integration section to find out more.
Last checked: September 14, 2018 3:42 PM

Chat plugin page says:

Some channels for this provider failed last time messages were sent. Click the error icon(s) to learn more.

Clicking the error icon leads to the screenshot in the previous post.

When I manually test the filter by clicking on that button and choosing the topic on which this error initially occurred, it just works. But there doesn’t seem to be a way to find more info about the error (checked the web-based logs interface and grepped the logs in the /var/discourse directory). Nor do I see a way to make these errors go away.

EDIT: I ended up deleting the channel and associated rules and re-adding them to make the error go away. The root cause of the error and the minimal error info of just “null” are still a mystery, however.