acme.sh icon indicating copy to clipboard operation
acme.sh copied to clipboard

Report bugs to telegram notify

Open mjbnz opened this issue 4 years ago • 19 comments

This is the place to report bugs in the Telegram notify.

If you experience a bug, please report it in this issue.

Thanks!

mjbnz avatar Jan 10 '21 23:01 mjbnz

I want notify "*.example.com", but i received ".example.com", the "*" is miss

leezicai avatar Apr 06 '21 09:04 leezicai

Telegram notice hook return an error, here is the log:

telegram send error. {"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 246"}

pd12bbf7608ae1 avatar Apr 08 '21 01:04 pd12bbf7608ae1

If both of you could add _err "$_data" just before the return 1 at the end of the notify script, try again, and send me the results I'll be able to diagnose further.

Redact your chatid that will appear, and any ascii parts of the domains. The issues you're seeing are directly related to the content of that variable, so I'll need to see as much of it not edited as possible.

mjbnz avatar Apr 08 '21 02:04 mjbnz

acme.sh --set-notify --notify-level 3

add _err "$_data" at the end of the notify script.

acme.sh --cron

{"ok":true,"result":{"message_id":36,"from":{"id":000000,"is_bot":true,"first_name":"testBot","username":"testBot"},"chat":{"id":00000000,"first_name":"W","username":"test","type":"private"},"date":000000000,"text":"Renew Skipped\nSkipped certs:\n .example.com\n ","entities":[{"offset":0,"length":13,"type":"bold"},{"offset":33,"length":17,"type":"bold"},{"offset":50,"length":11,"type":"url"},{"offset":50,"length":11,"type":"bold"},{"offset":66,"length":13,"type":"url"},{"offset":66,"length":13,"type":"bold"},{"offset":104,"length":14,"type":"url"},{"offset":123,"length":13,"type":"url"}]}}[Thu Apr 8 10:27:29 CST 2021] telegram send success.

leezicai avatar Apr 08 '21 02:04 leezicai

➜ notify acme.sh --version https://github.com/acmesh-official/acme.sh v2.8.9

leezicai avatar Apr 08 '21 02:04 leezicai

@mjbnz

If both of you could add _err "$_data" just before the return 1 at the end of the notify script, t

Please add it and submit a PR.

Thanks.

Neilpang avatar Apr 08 '21 02:04 Neilpang

@Neilpang

Please add it and submit a PR.

This is just for debugging these couple of instances, it's not how it should be done going forward.

mjbnz avatar Apr 08 '21 02:04 mjbnz

@mjbnz

You can use _debug2 "$data" instead of _err.

this will save your debug time next time.

Neilpang avatar Apr 08 '21 02:04 Neilpang

@Charles-one

{"ok":true,...... [Thu Apr 8 10:27:29 CST 2021] telegram send success.

Yours worked correctly so the _err call wouldn't have run.. Reviewing the main script however, it should show the *. Did the domain appear with the * earier in the output preceeded with "Skipped " ? If so, I'll do some more testing. If not, it looks like a bug in the main script.

mjbnz avatar Apr 08 '21 02:04 mjbnz

@mjbnz

You can use _debug2 "$data" instead of _err.

this will save your debug time next time.

Understood, I'll add it in a PR later if changes are needed for these failures.

mjbnz avatar Apr 08 '21 02:04 mjbnz

@mjbnz

@Charles-one

{"ok":true,...... [Thu Apr 8 10:27:29 CST 2021] telegram send success.

Yours worked correctly so the _err call wouldn't have run.. Reviewing the main script however, it should show the *. Did the domain appear with the * earier in the output preceeded with "Skipped " ? If so, I'll do some more testing. If not, it looks like a bug in the main script.

===Starting cron=== [Thu Apr 8 10:45:17 CST 2021] Renew: '*.example.com' [Thu Apr 8 10:45:17 CST 2021] Skip, Next renewal time is: Tue Jun 1 03:10:38 UTC 2021 [Thu Apr 8 10:45:17 CST 2021] Add '--force' to force to renew. [Thu Apr 8 10:45:17 CST 2021] Skipped *.example.com [Thu Apr 8 10:45:17 CST 2021] Sending via: telegram

leezicai avatar Apr 08 '21 02:04 leezicai

[Thu Apr 8 10:45:17 CST 2021] Skipped *.example.com

Perfect thanks, I'll look into it.

mjbnz avatar Apr 08 '21 02:04 mjbnz

PR made to address this in #3479

mjbnz avatar Apr 08 '21 04:04 mjbnz

I'm facing similar to the above one too. How can I help to check on the problem?

[Tue Jul 27 15:40:20 UTC 2021] Sending via: telegram [Tue Jul 27 15:40:21 UTC 2021] telegram send error. [Tue Jul 27 15:40:21 UTC 2021] {"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 96"} [Tue Jul 27 15:40:21 UTC 2021] Error send message by telegram_send [Tue Jul 27 15:40:21 UTC 2021] Set /home/leewp14/bin/acme.sh/notify/telegram.sh error. [Tue Jul 27 15:40:21 UTC 2021] ===End cron=== leewp14@compute-arm-default: nan/bin/acme.sh$ ./acme.sh --set-notify --notify-hook telegram [Tue Jul 27 15:44:29 UTC 2021] Set notify hook to: telegram [Tue Jul 27 15:44:29 UTC 2021] Sending via: telegram [Tue Jul 27 15:44:30 UTC 2021] telegram send success. [Tue Jul 27 15:44:30 UTC 2021] telegram Success leewp14@compute-arm-default: nan/bin/acme.sh$

The test message can be sent and received on TG, however the hook send is not working. Using version 3.0.0.

leewp14 avatar Jul 27 '21 15:07 leewp14

I'm facing similar to the above one too. How can I help to check on the problem?

[Tue Jul 27 15:40:21 UTC 2021] {"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 96"}

What is the domain you're requesting? Does it have an underscore?

mjbnz avatar Jul 27 '21 22:07 mjbnz

I'm facing similar to the above one too. How can I help to check on the problem?

[Tue Jul 27 15:40:21 UTC 2021] {"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 96"}

What is the domain you're requesting? Does it have an underscore?

Nope, my domain is mitsuha.ren and hcdn.mitsuha.ren.

leewp14 avatar Jul 28 '21 02:07 leewp14

Nope, my domain is mitsuha.ren and hcdn.mitsuha.ren.

Hmm, ok, can you run a renew with the debug flag please.

mjbnz avatar Jul 28 '21 02:07 mjbnz

Why not use HTML instead of markdown? I had the same error "Bad Request: can't parse entities" as mentioned above because my domain contained asterisk (*.example.com). After looking in it, changing parse_mode to html and using <b></b> tags for bold text instead of ** markdown syntax, everything works fine. This also doesn't requires to use sed to escape special characters like *.

knightly-flo avatar Sep 02 '22 17:09 knightly-flo