The webhook could not be saved by Telegram, seems to be an invalid URL

Infos:

  • Used Zammad version: 5.2.x
  • Used Zammad installation type: package
  • Operating system: Ubuntu 20.04
  • Browser + version: Chrome
  • Database : Postgresql 12.11
  • Web server : nginx 1.18.0

Expected behavior:

  • Telegram Bot to be added successfully

Actual behavior:

  • Error “The webhook could not be saved by Telegram, seems to be an invalid URL.” is shown and the bot is not added


Https configured via nginx proxy pass

Steps to reproduce the behavior:

add new bots (tried about 5 pieces). Manually added webhook . Requests get into the zammad logs, but naturally they are not processed, since the bots are not added to the system. The problem appeared a month ago. The old bots worked until I removed them.
*

LOGS zammad

E, [2022-08-01T10:49:32.620234 #1468134-133060] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-01T10:49:32.621678 #1468134-133060] INFO – : Completed 422 Unprocessable Entity in 273ms (Views: 0.2ms | ActiveRecord: 4.3ms | Allocations: 8351)
I, [2022-08-01T10:49:33.578202 #1468134-128240] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-01 10:49:33 +0000
I, [2022-08-01T10:49:33.585191 #1468134-128240] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-01T10:49:33.585280 #1468134-128240] INFO – : Parameters: {“api_token”=>“5541950547:AAGVJbni-zzoFCRR92AyzgUfOTkQNfsf1yU”, “welcome”=>“12345”, “goodbye”=>“123”, “group_id”=>“5”}
E, [2022-08-01T10:49:33.864749 #1468134-128240] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-01T10:49:33.866278 #1468134-128240] INFO – : Completed 422 Unprocessable Entity in 281ms (Views: 0.3ms | ActiveRecord: 4.2ms | Allocations: 8321)
I, [2022-08-01T10:49:34.427089 #1468134-130400] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-01 10:49:34 +0000
I, [2022-08-01T10:49:34.433530 #1468134-130400] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-01T10:49:34.433619 #1468134-130400] INFO – : Parameters: {“api_token”=>“5541950547:AAGVJbni-zzoFCRR92AyzgUfOTkQNfsf1yU”, “welcome”=>“12345”, “goodbye”=>“123”, “group_id”=>“5”}
E, [2022-08-01T10:49:34.695506 #1468134-130400] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-01T10:49:34.697425 #1468134-130400] INFO – : Completed 422 Unprocessable Entity in 264ms (Views: 0.2ms | ActiveRecord: 3.9ms | Allocations: 8358)
I, [2022-08-01T10:49:35.226716 #1468134-108920] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-01 10:49:35 +0000
I, [2022-08-01T10:49:35.233227 #1468134-108920] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-01T10:49:35.233374 #1468134-108920] INFO – : Parameters: {“api_token”=>“5541950547:AAGVJbni-zzoFCRR92AyzgUfOTkQNfsf1yU”, “welcome”=>“12345”, “goodbye”=>“123”, “group_id”=>“5”}
E, [2022-08-01T10:49:35.506133 #1468134-108920] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-01T10:49:35.507605 #1468134-108920] INFO – : Completed 422 Unprocessable Entity in 274ms (Views: 0.2ms | ActiveRecord: 3.9ms | Allocations: 8321)

MY SSL curl -Iv https://mydomain

  • SSL certificate verify ok.
  • Using HTTP2, server supports multi-use
  • Connection state changed (HTTP/2 confirmed)
  • Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  • Using Stream ID: 1 (easy handle 0x559d780e9b60)

HEAD / HTTP/2
Host: mydomain
user-agent: curl/7.68.0
accept: /

  • Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
    < HTTP/2 200
    HTTP/2 200
    < server: nginx
    server: nginx
    < date: Mon, 01 Aug 2022 11:04:10 GMT
    date: Mon, 01 Aug 2022 11:04:10 GMT
    < content-type: text/html; charset=utf-8
    content-type: text/html; charset=utf-8
    < x-frame-options: SAMEORIGIN
    x-frame-options: SAMEORIGIN
    < x-xss-protection: 1; mode=block
    x-xss-protection: 1; mode=block
    < x-content-type-options: nosniff
    x-content-type-options: nosniff
    < x-download-options: noopen
    x-download-options: noopen
    < x-permitted-cross-domain-policies: none
    x-permitted-cross-domain-policies: none
    < referrer-policy: strict-origin-when-cross-origin
    referrer-policy: strict-origin-when-cross-origin
    < link: </assets/application-0dff4740f40f18c3dd3a1a2d278781ee823c40e81140a6a1e817d15d7f7c8041.css>; rel=preload; as=style; nopush,</assets/application-print-ce6db3cee38ec792bd7dd6c766e91bbd7876617c60d96974af9a6db39c8adcbc.css>; rel=preload; as=style; nopush
    link: </assets/application-0dff4740f40f18c3dd3a1a2d278781ee823c40e81140a6a1e817d15d7f7c8041.css>; rel=preload; as=style; nopush,</assets/application-print-ce6db3cee38ec792bd7dd6c766e91bbd7876617c60d96974af9a6db39c8adcbc.css>; rel=preload; as=style; nopush
    < vary: Accept
    vary: Accept
    < csrf-token: jCMVV4f1oPAy8Rwis9GCozdtFDEOWb2V9GrgdNqb174EzMgRoRlTZrHaruLcD_VmadU4YZFNKE0rou7Cr-jwGQ
    csrf-token: jCMVV4f1oPAy8Rwis9GCozdtFDEOWb2V9GrgdNqb174EzMgRoRlTZrHaruLcD_VmadU4YZFNKE0rou7Cr-jwGQ
    < cache-control: no-cache, no-store, max-age=0, must-revalidate
    cache-control: no-cache, no-store, max-age=0, must-revalidate
    < pragma: no-cache
    pragma: no-cache
    < expires: -1
    expires: -1
    < etag: W/“8bf7723f9a5dc1a274df168aef03fac0”
    etag: W/“8bf7723f9a5dc1a274df168aef03fac0”
    < content-security-policy: base-uri ‘self’ https://mydomain; default-src ‘self’ ws: wss: https://images.zammad.com; font-src ‘self’ data:; img-src * data:; object-src ‘none’; script-src ‘self’ ‘unsafe-eval’ ‘strict-dynamic’ ‘nonce-euh7xXaQjIthSLapSfcrOA==’; style-src ‘self’ ‘unsafe-inline’; frame-src www.youtube.com player.vimeo.com
    content-security-policy: base-uri ‘self’ https://mydomain; default-src ‘self’ ws: wss: https://images.zammad.com; font-src ‘self’ data:; img-src * data:; object-src ‘none’; script-src ‘self’ ‘unsafe-eval’ ‘strict-dynamic’ ‘nonce-euh7xXaQjIthSLapSfcrOA==’; style-src ‘self’ ‘unsafe-inline’; frame-src www.youtube.com player.vimeo.com
    < set-cookie: _zammad_session_a138cfd0f37=a45ba1951d6525418f2f07313ab19b0a; path=/; secure; HttpOnly; SameSite=Lax
    set-cookie: _zammad_session_a138cfd0f37=a45ba1951d6525418f2f07313ab19b0a; path=/; secure; HttpOnly; SameSite=Lax
    < x-request-id: 48a2ea68-25a9-4507-a97f-5c0d7e757754
    x-request-id: 48a2ea68-25a9-4507-a97f-5c0d7e757754
    < x-runtime: 0.029710
    x-runtime: 0.029710
    < strict-transport-security: max-age=31536000; includeSubdomains
    strict-transport-security: max-age=31536000; includeSubdomains

<

  • Connection #0 to host mydomain left intact

Test SSL https://www.ssllabs.com/

My token telegram bots in logs zammad has been revoke/

, [2022-08-03T12:48:32.153244 #1999389-114840] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-03T12:48:32.153335 #1999389-114840] INFO – : Parameters: {“api_token”=>“5525818952:AAGzDDpej9PKQMsqk1o1R0h99qtPYQ1TdNg”, “welcome”=>“dsafsafsasfsaf”, “goodbye”=>“asdfasfasfasf”, “group_id”=>“5”}
E, [2022-08-03T12:48:32.430047 #1999389-114840] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-03T12:48:32.431630 #1999389-114840] INFO – : Completed 422 Unprocessable Entity in 278ms (Views: 0.3ms | ActiveRecord: 4.3ms | Allocations: 8357)
I, [2022-08-03T12:48:59.140721 #1999420-109580] INFO – : execute Channel.fetch (try_count 0)…
I, [2022-08-03T12:48:59.142699 #1999420-109580] INFO – : fetching imap (imap.mail.ru/support@grando.pro port=993,ssl=true,starttls=false,folder=Inbox,keep_on_server=true,auth_type=LOGIN)
I, [2022-08-03T12:49:01.150167 #1999420-109580] INFO – : - no message
I, [2022-08-03T12:49:01.182207 #1999420-109580] INFO – : ended Channel.fetch took: 2.046148515 seconds.
I, [2022-08-03T12:49:31.188533 #1999420-109580] INFO – : execute Channel.fetch (try_count 0)…
I, [2022-08-03T12:49:31.190711 #1999420-109580] INFO – : fetching imap (imap.mail.ru/support@grando.pro port=993,ssl=true,starttls=false,folder=Inbox,keep_on_server=true,auth_type=LOGIN)
I, [2022-08-03T12:49:32.935831 #1999420-109580] INFO – : - no message
I, [2022-08-03T12:49:32.944259 #1999420-109580] INFO – : ended Channel.fetch took: 1.760780866 seconds.
I, [2022-08-03T12:49:36.235692 #1999389-108920] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-03 12:49:36 +0000
I, [2022-08-03T12:49:36.243173 #1999389-108920] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-03T12:49:36.243274 #1999389-108920] INFO – : Parameters: {“api_token”=>“5525818952:AAGzDDpej9PKQMsqk1o1R0h99qtPYQ1TdNg”, “welcome”=>“dsafsafsasfsaf”, “goodbye”=>“asdfasfasfasf”, “group_id”=>“5”}
E, [2022-08-03T12:49:36.564486 #1999389-108920] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-03T12:49:36.566488 #1999389-108920] INFO – : Completed 422 Unprocessable Entity in 323ms (Views: 0.3ms | ActiveRecord: 4.0ms | Allocations: 8333)
I, [2022-08-03T12:49:39.099034 #1999389-114700] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-03 12:49:39 +0000
I, [2022-08-03T12:49:39.105128 #1999389-114700] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-03T12:49:39.105220 #1999389-114700] INFO – : Parameters: {“api_token”=>“5525818952:AAGzDDpej9PKQMsqk1o1R0h99qtPYQ1TdNg”, “welcome”=>“dsafsafsasfsaf”, “goodbye”=>“asdfasfasfasf”, “group_id”=>“5”}
E, [2022-08-03T12:49:39.371148 #1999389-114700] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-03T12:49:39.372494 #1999389-114700] INFO – : Completed 422 Unprocessable Entity in 267ms (Views: 0.2ms | ActiveRecord: 3.7ms | Allocations: 8323)
I, [2022-08-03T12:49:40.147136 #1999389-109380] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-03 12:49:40 +0000
I, [2022-08-03T12:49:40.153103 #1999389-109380] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-03T12:49:40.153186 #1999389-109380] INFO – : Parameters: {“api_token”=>“5525818952:AAGzDDpej9PKQMsqk1o1R0h99qtPYQ1TdNg”, “welcome”=>“dsafsafsasfsaf”, “goodbye”=>“asdfasfasfasf”, “group_id”=>“5”}
E, [2022-08-03T12:49:40.435372 #1999389-109380] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-03T12:49:40.437209 #1999389-109380] INFO – : Completed 422 Unprocessable Entity in 284ms (Views: 0.3ms | ActiveRecord: 3.8ms | Allocations: 8336)
I, [2022-08-03T12:49:41.435241 #1999389-114880] INFO – : Started POST “/api/v1/channels_telegram” for 10.0.3.67 at 2022-08-03 12:49:41 +0000
I, [2022-08-03T12:49:41.441239 #1999389-114880] INFO – : Processing by ChannelsTelegramController#add as JSON
I, [2022-08-03T12:49:41.441527 #1999389-114880] INFO – : Parameters: {“api_token”=>“5525818952:AAGzDDpej9PKQMsqk1o1R0h99qtPYQ1TdNg”, “welcome”=>“dsafsafsasfsaf”, “goodbye”=>“asdfasfasfasf”, “group_id”=>“5”}
E, [2022-08-03T12:49:41.717142 #1999389-114880] ERROR – : The webhook could not be saved by Telegram, seems to be an invalid URL. (Exceptions::UnprocessableEntity)
app/controllers/channels_telegram_controller.rb:24:in rescue in add' app/controllers/channels_telegram_controller.rb:21:in add’
app/controllers/application_controller/has_download.rb:21:in block (4 levels) in <module:HasDownload>' app/controllers/application_controller/has_download.rb:20:in block (3 levels) in module:HasDownload
app/controllers/application_controller/has_download.rb:19:in block (2 levels) in <module:HasDownload>' app/controllers/application_controller/handles_transitions.rb:16:in handle_transaction’
I, [2022-08-03T12:49:41.718522 #1999389-114880] INFO – : Completed 422 Unprocessable Entity in 277ms (Views: 0.2ms | ActiveRecord: 4.1ms | Allocations: 8322)

I got around this problem by changing the version to 5.1.1 . Zammad added bots

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.