8000 Webhooks with Rocketchat on same UCS/Docker-Host is not working · Issue #15 · wekan/univention · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Webhooks with Rocketchat on same UCS/Docker-Host is not working #15

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

Open
chrisi51 opened this issue Oct 9, 2020 · 8000 14 comments
Open

Webhooks with Rocketchat on same UCS/Docker-Host is not working #15

chrisi51 opened this issue Oct 9, 2020 · 14 comments

Comments

@chrisi51
Copy link
chrisi51 commented Oct 9, 2020

Issue

Server Setup Information:

  • Did you test in newest Wekan?: 4.41 (latest ucs version)
  • Wekan version: 4.41
  • Deployment Method(snap/docker/sandstorm/mongodb bundle/source): docker (via ucs)

Problem description:

  • In webbrowser, what does show Right Click / Inspect / Console ? Chrome shows more detailed info than Firefox.
    A bad HTTP response code (404) was received when fetching the script.
    Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://xxxxxxxx/') with script ('https://xxxxxxxx/pwa-service-worker.js'): A bad HTTP response code (404) was received when fetching the script. in jobs-ch:1
    GET https://wekan.a-o.intern/site.webmanifest 404 (Not Found) in site.webmanifest:1
    Manifest: Line: 1, column: 1, Syntax error. in site.webmanifest:1
  • If using Docker, what does show command sudo docker logs wekan-app ? Please anonymize logs.
    no log entrys while changing cards

general problem:
I try to enable webhooks to send events from wekan to rocketchat. Both apps are running in a docker environment built by ucs.

What is working:

  • i can send webhook events from local terminal and from ucs root server to rocketchat and they appear as they should do.
  • i can send webhook events from wekan to an external webhook validator like https://webhook.site/

So i know, that wekan on its side is able to send data and rocketchat on its own side is able to receive, but for any reason wekan cant reach rocketchat.

I have no clue how to troubleshoot it. Where may i get an error or something like, to see why the webhook is not called or sent?

I discovered, that the ucs host was not able to nslookup rocketchat and wekan, so i've added dns entrys and this is working now. i also guess, there could be a problem with the internal ssl certs. Both apps got ssl certs by ucs and both apps should know the ucs CA, so there should not be a problem but potencially this can be a problem!?

hope u can bring me on the right train :)

@xet7 xet7 transferred this issue from wekan/wekan Oct 9, 2020
@xet7
Copy link
Member
xet7 commented Oct 9, 2020

Hmm, I'll try does this work.

@chrisi51
Copy link
Author
chrisi51 commented Oct 9, 2020

so you mean it may be a bug which i can't fix on my own?

@xet7
Copy link
Member
xet7 commented Oct 9, 2020

@chrisi51

Hey, take it easy. I'm in progress of testing does this work or not. I don't mean anything yet.

@xet7
Copy link
Member
xet7 commented Oct 9, 2020

@chrisi51

Try this:

  1. In your UCS instance, type this to see what is your UCS instance IP address:
sudo cat /etc/hosts

There you see something like this:

192.168.123.123 ucs-....
  1. At Wekan board, change beginning of Outgoing Webhook URL from https://ucs-... to that UCS IP address http://192.168.123.123/....

a) Set some Wekan board public, and copy from it avatar image URL of user.
b) Or copy some other public image URL.

  1. At RocketChat incoming webhook settings, at bottom CURL example, change:
  • API address https://ucs-.... to HTTP IP address http://192.168.123.123/....
  • Change "image_url":"/images/...png" to your Wekan avatar image URL like http://example.com/something.png`

Also set that API call as enabled slider blue.

  1. Run that example REST API call

This is because there is problem with incorrect image URL in REST API call. This fix here does not work RocketChat/Rocket.Chat#15494 (comment)

  1. Then at Wekan board create new card. It will show that activity as RocketChat channel message.

@chrisi51
Copy link
Author
chrisi51 commented Oct 9, 2020

@chrisi51

Hey, take it easy. I'm in progress of testing does this work or not. I don't mean anything yet.

sorry that was an missunderstanding due to language barrier - don't wanted to stress you up :)

i tried to follow your explanation and i got it running but i dont really understand, whats happening here :)
Is this a bug of rocketchat then?

seems to be really necessary to avoid domainnames and fall back to IP and also it seems to be necessary to give rocketchat an valid public image url of wekan - also with IP.

Thank you for your analysis and i hope that you keep up the good work :)

@xet7
Copy link
Member
xet7 commented Oct 9, 2020

Yes, it's a bug in RocketChat. Having valid image URL in REST API call makes RocketChat webhook start working correctly.

@xet7 xet7 closed this as completed Oct 9, 2020
@xet7 xet7 reopened this Oct 10, 2020
@xet7
Copy link
Member
xet7 commented Oct 10, 2020

Hmm, maybe I should check sometime, that if I add that image URL info to Wekan Outgoing Webhook JSON, does it start working immediately?

@chrisi51
Copy link
Author
chrisi51 commented Oct 10, 2020

and do you have any idea why dns is not working in this context? both, wekan and rocketchat can resolve the dns of each other so why do i have to use ips with http instead of https with dns.

i've tried to bring it to work with dns but had no success :(

by the way, i iadded a ticket to put some more data to the outgoing webhook json: wekan/wekan#3297 (dunno how to reference it)

@xet7
Copy link
Member
xet7 commented Oct 10, 2020

@chrisi51

I think DNS does not work, because Wekan and RocketChat are inside of Docker containers in Docker network.

@matziu
Copy link
matziu commented Mar 7, 2021

Same problem here.
Rocket.Chat in docker, zabbix 5.4 in docker on the same machine.

00:00:00.001 [Debug] [ RocketChat Webhook ] Sending request: https://xxx/api/v1/chat.postMessage {"channel":"#zabbix","attachments":[{"collapsed":false,"color":"#97AAB3","title":"{ALERT.SUBJECT}","title_link":"{$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}","text":"{ALERT.MESSAGE}"}]}

00:00:00.095 [Debug] [ RocketChat Webhook ] Received response with status code 400 {"success":false,"error":"Invalid href value provided"}

00:00:00.096 [Warning] [ RocketChat Webhook ] ERROR: Request failed with status code 400: "Invalid href value provided". Check debug log for more information.

@xet7
Copy link
Member
xet7 commented Mar 7, 2021

@matziu

Do you have Wekan installed? Is this related to Wekan at all?

It seems Zabbix is sending that webhook to RocketChat.

@matziu
Copy link
matziu commented Mar 7, 2021

Sry, my mistake.
I Have problem with zabbix and rocket.chat.

Sry :)

@xet7
Copy link
Member
xet7 commented Mar 7, 2021

@matziu

Please add issue to Zabbix, I think it's a problem in what kind of JSON Zabbix does send to RocketChat. That JSON maybe should not have image_url at all.

Also check does this workaround work #15 (comment)

And try does sending with curl from inside of Zabbix or RocketChat container work.

And check are Zabbix and RocketChat in same docker network.

@matziu
Copy link
matziu commented Mar 7, 2021

Thank You, i solved my problem: https://www.zabbix.com/forum/zabbix-help/417916-error-sending-message-through-rocket-chat-webhook

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

3 participants
0