Webhooks not working #6271
-
I am having issues with webhooks in a stackstorm-ha Helm deployments. I think some of the docs may be incorrect (or at least refer to SA environments https://docs.stackstorm.com/webhooks.html) in that it refers to [$ST2_IP] (not sure what that is but was using service IP of my st2api instance) and it references https over 443 when I think it should be http to 9101. Here is my curl: curl -X POST http://172.19.175.22:9101/api/v1/webhooks/sample -H "X-Auth-Token: " -H "Content-Type: application/json" --data '{"key1": "value1"}' . I set up a webhooks trigger for "sample" url but it does not trigger the action I have set up and just silently executes. I have confirmed that the trigger shows up in st2 webhook command. I was going to try to see if it actually got to st2api pod but I don't have root on it (and having some issues creating an ID with root perms). Also don't have logs since I think the default logging is not going to /var/log/st2 (nothing in this dir). Also, not a ton of references to webhooks with ST2 on internet so wondering if this is a not well supported/not commonly used feature. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
so you're sending a webhook request from within the cluster, correct? I've created a sample webhook and sent a request to it from postman (form my pc) and it did the thing it was supposed to do. When calling from within the cluster, I usually use the external address of st2web anyway, as it acts as a proxy to other services also logs are usually accessible by issuing I think your example would work if you removed the "/api" from your call, as that one is re-written from outside by nginx on st2web: curl -X POST http://10.100.111.13:9101/v1/webhooks/sample -H "X-Auth-Token: $token" -H "Content-Type: application/json" --data '{"message": "curl call"}' <-- this does the job from st2client pod |
Beta Was this translation helpful? Give feedback.
-
Thanks a bunch! Removing /api seemed to make it work. I am using it from within the cluster but will eventually want to access it outside of the cluster. Working on that now... |
Beta Was this translation helpful? Give feedback.
so you're sending a webhook request from within the cluster, correct?
I've created a sample webhook and sent a request to it from postman (form my pc) and it did the thing it was supposed to do.
When calling from within the cluster, I usually use the external address of st2web anyway, as it acts as a proxy to other services
also logs are usually accessible by issuing
kubectl logs <pod name> -n <namespace>
orkubectl logs deploy/<deployment name> -n <namespace>
I think your example would work if you removed the "/api" from your call, as that one is re-written from outside by nginx on st2web:
curl -X POST http://10.100.111.13:9101/v1/webhooks/sample -H "X-Auth-Token: $token" -H "Content-Typ…