Skip to content
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

Github is failing to clean up webhooks during DELETE lifecycle #252

Open
eweiter opened this issue Jan 16, 2018 · 1 comment
Open

Github is failing to clean up webhooks during DELETE lifecycle #252

eweiter opened this issue Jan 16, 2018 · 1 comment

Comments

@eweiter
Copy link

eweiter commented Jan 16, 2018

I was using the IBM Cloud Functions UI and I noticed the following behavior for Github trigger.

When I would create a trigger it would appear to create the Trigger and the Feed fine. The feed calls response was:
{"duration":589,"name":"webhook","subject":"eweiter@us.ibm.com","activationId":"e8ec3315288c4457ac3315288cf457d1","publish":false,"annotations":[{"key":"path","value":"whisk.system/github/webhook"},{"key":"waitTime","value":37},{"key":"kind","value":"nodejs:6"},{"key":"limits","value":{"timeout":60000,"memory":256,"logs":10}},{"key":"initTime","value":249}],"version":"0.0.264","response":{"result":{"response":"{\"type\":\"Repository\",\"id\":20159188,\"name\":\"web\",\"active\":true,\"events\":[\"push\"],\"config\":{\"url\":\"https://xxx:yyy@10.121.10.111:443/api/v1/namespaces/eweiter%40us.ibm.com_dev/triggers/JasonTest\",\"content_type\":\"json\",\"insecure_ssl\":\"0\"},\"updated_at\":\"2018-01-16T17:52:37Z\",\"created_at\":\"2018-01-16T17:52:37Z\",\"url\":\"https://api.github.com/repos/eweiter/bumblefoot/hooks/20159188\",\"test_url\":\"https://api.github.com/repos/eweiter/bumblefoot/hooks/20159188/test\",\"ping_url\":\"https://api.github.com/repos/eweiter/bumblefoot/hooks/20159188/pings\",\"last_response\":{\"code\":null,\"status\":\"unused\",\"message\":null}}"},"success":true,"status":"success"},"end":1516125157900,"logs":[],"start":1516125157311,"namespace":"eweiter@us.ibm.com_dev"}
To me it is showing that a "Push" event was created and that it is Active.

However when I go to delete that Trigger, the Feed deletion encounters an error. The Feed deletion response was:
{"duration":207,"name":"webhook","subject":"eweiter@us.ibm.com","activationId":"6a3da00bcc7448e6bda00bcc7438e60d","publish":false,"annotations":[{"key":"limits","value":{"timeout":60000,"memory":256,"logs":10}},{"key":"path","value":"whisk.system/github/webhook"},{"key":"kind","value":"nodejs:6"},{"key":"waitTime","value":23}],"version":"0.0.264","response":{"result":{"error":"Found no existing webhooks for trigger URL https://xxx:yyy@10.121.10.111:443/api/v1/namespaces/eweiter%40us.ibm.com_dev/triggers/JasonTest"},"success":false,"status":"application error"},"end":1516125185130,"logs":[],"start":1516125184923,"namespace":"eweiter@us.ibm.com_dev"}
Where it is telling me that it couldn't find any hooks on that trigger to delete and it is returning a status code of 502.

Steps to recreate:

  1. Create a Trigger with the Github feed using the "push" event
  2. Delete the Trigger
@prabhashthere
Copy link

prabhashthere commented Oct 3, 2018

This happens if we edit the generated webhook manually from the GitHub site. Sometimes the callBackUrl will be slightly changed if you just pressed the edit button of the webhook (whether you did any changes or not).

The callBackUrl which GitHub package sends to create the webhook includes the TCP port name 443. But if we try to edit the webhook, GitHub will remove the port name (which is not mandatorily needed to find the trigger location) from the callBackUrl. When the package tries to delete the webhook, they look for the previous callbackUrl and it is not available anymore causing a failure in deleting the webhook.
If we can update the git package to generate the callBackUrl without the port name, then we can mitigate this problem.

Example callBackUrls
before edit: https://auth@apihost:443/api/v1/namespaces/_/triggers/myGitTrigger
after edit: https://auth@apihost/api/v1/namespaces/_/triggers/myGitTrigger

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

2 participants