Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$250] Cannot create Webook #423

Closed
maxceem opened this issue Aug 12, 2021 · 31 comments
Closed

[$250] Cannot create Webook #423

maxceem opened this issue Aug 12, 2021 · 31 comments

Comments

@maxceem
Copy link

maxceem commented Aug 12, 2021

Topcoder-X stopped working for one of my repo where it previously worked, it didn't react to assigning Topcoder-X labels. So I decided trying to re-create webhooks. First I removed existent webhook from the repo, and then I tried to create it again using Topcoder X UI, but got an error:

Failed to create webhook. 404 error making request post https://api.github.com/repos/topcoder-platform/taas-apis/hooks: "Not Found".

image

@jmgasper
Copy link
Collaborator

@maxceem - What sort of access rights do you have to that repo?

@maxceem
Copy link
Author

maxceem commented Aug 12, 2021

@jmgasper I'm admin there

image

@jmgasper
Copy link
Collaborator

@afrisalyp - Any idea on this one?

@jmgasper jmgasper changed the title Cannot create Webook [$50] Cannot create Webook Aug 12, 2021
@jmgasper jmgasper changed the title [$50] Cannot create Webook [$250] Cannot create Webook Aug 13, 2021
@jmgasper
Copy link
Collaborator

@afrisalyp - I think that we're running into one of the "brown outs" listed here:

https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param

We'll need to fix this ASAP, thanks!

@afrisalyp
Copy link
Collaborator

@jmgasper Okay, going to check it.

@afrisalyp
Copy link
Collaborator

@jmgasper Fixes provided to support the Github API changes.

@jmgasper
Copy link
Collaborator

@afrisalyp - Thanks!

@maxceem - This should start working again shortly, and we'll plan a production deploy for next week to apply the permanent fix.

@afrisalyp
Copy link
Collaborator

@jmgasper The fix addresses the Github API change.

I am still investigating the problem Failed to create webhook. 404 error making request post https://api.github.com/repos/topcoder-platform/taas-apis/hooks: "Not Found".. Seems it is not related to the API change.

Any idea?

@jmgasper
Copy link
Collaborator

@afrisalyp - Sorry, I just assumed it was failing because of the incorrect token approach. I'll open up a separate ticket to keep investigating.

@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/d33759f3-21e7-457c-a042-34bf812bb1d7 has been created for this ticket.

This is an automated message for ghostar2020 via Topcoder X

@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/d33759f3-21e7-457c-a042-34bf812bb1d7 has been assigned to afrisalyp.

This is an automated message for ghostar2020 via Topcoder X

@jmgasper
Copy link
Collaborator

@maxceem - Can you try again now please? I'm interested to see if this is still an issue now that the brownout is over in the Github API.

@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/d33759f3-21e7-457c-a042-34bf812bb1d7 afrisalyp has been unassigned.

This is an automated message for ghostar2020 via Topcoder X

@maxceem
Copy link
Author

maxceem commented Aug 14, 2021

@jmgasper yeah, it's still there, just checked:

image

@afrisalyp afrisalyp assigned afrisalyp and unassigned afrisalyp Aug 15, 2021
@jmgasper
Copy link
Collaborator

Challenge https://www.topcoder.com/challenges/d33759f3-21e7-457c-a042-34bf812bb1d7 has been assigned to afrisalyp.

This is an automated message for ghostar2020 via Topcoder X

@jmgasper
Copy link
Collaborator

@maxceem - In Topcoder-X (x.topcoder.com) can you try going into settings, revoking your Github token, and then renewing it please?

@maxceem
Copy link
Author

maxceem commented Aug 16, 2021

@jmgasper revoking GitHub token and setting it up again didn't help, see demo video https://monosnap.com/file/oOxHDY3nYchkZWNIu8rTsJ1qMh0rlv. It didn't redirect me anywhere during setting up a new token, not sure if this is expected or no.

@afrisalyp
Copy link
Collaborator

@maxceem

Can you please try to revoke the TCX apps in the Github Applications setting?

Screenshot from 2021-08-16 14-56-45

Then please try to revoke and re-setup again on the TCX website. It will take us to the Github authorization page.

Screenshot 2021-08-16 14:59:01

Please make sure that you have been granted to the organisation.

@maxceem
Copy link
Author

maxceem commented Aug 16, 2021

Thanks for details @afrisalyp this time I've managed to reauthorize the topcoder-x app, but it didn't help in general.

After I removed the application from my settings, and click revoke/setup inside Topcoder-X settings, it did redirect me to the authorise app page, and I can see access to the organisations is there:

image

Though when I'm trying to re-created webhooks I got the same error:

image

Btw, I gave it a try with another repository from the same organisation and it did work:

image

This is super weird as I'm admin in both repos. And in both repos TopcoderX worked for me before.

@afrisalyp
Copy link
Collaborator

Thanks @maxceem

Screenshot from 2021-08-16 19-50-32

Btw, can you open the webhook setting like this?
Also, please try Add Webhook on the page to see if the functionality is working in the Github website.

@maxceem
Copy link
Author

maxceem commented Aug 16, 2021

Sure @afrisalyp here is how the page looks like

image

I've added some hook using example.com URL and it worked good:

image

After that I've tried again to use Topcoder X, but got error again

image

@afrisalyp
Copy link
Collaborator

@maxceem

That's weird :)

Can you please help to check with this curl command.
It will get the current hooks and post a new one.
You will need to generate PAT with admin:repo_hook scope.

Let see if it works.

curl -u username:PAT \
  -X GET \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/topcoder-platform/taas-apis/hooks

curl -u username:PAT \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/repos/topcoder-platform/taas-apis/hooks \
  -d '{"name":"web", "active": true, "events": ["push","pull_request","create","commit_comment","issue_comment","issues","label"], "config": { "url": "https://example.com/github-hooks", "content_type": "json", "secret":"test123"}}'

@maxceem
Copy link
Author

maxceem commented Aug 17, 2021

@afrisalyp yeah, super weird :)

I've tried these commands and both worked good to me:

image

image

@afrisalyp
Copy link
Collaborator

@jmgasper

Can you please help to check in the DB record?
I am wondering to see the owner of the project.
I'm afraid that the owner is not the same as the copilot (maxceem).

Please check records in the Project table with repoUrl:

Thanks.

@jmgasper
Copy link
Collaborator

@afrisalyp - I've requested these details.

@afrisalyp
Copy link
Collaborator

@jmgasper

Sure thanks.

@jmgasper
Copy link
Collaborator

@afrisalyp / @maxceem - veshu was the owner on the taas-apis project. I've had that switched back to @maxceem so we can try again, thanks!

@maxceem
Copy link
Author

maxceem commented Aug 18, 2021

Thank you @jmgasper @afrisalyp it helped!

Just for reference: veshu was a copilot for this repo more than a half of year ago. He removed himself, and I've configured this repo to my handle at that time. And for half of a year it worked good with my handle until a few days ago when Topcoder X sopped reacting on the TCX labels.
I'm not sure what might happen recently that caused this issue.

@afrisalyp
Copy link
Collaborator

afrisalyp commented Aug 19, 2021

Thanks, @jmgasper @maxceem.

Most TCX functionalities that need Github access such as auto commenting and labelling uses copilot access.
But other functionalities like creating hook use the owner access (who create the project in TCX web) as we assumed that in some cases owners may have higher access role than copilots.

Any idea on this?

@jmgasper
Copy link
Collaborator

@afrisalyp - Yeah, I've been discussing with Topcoder. I think for now we'll just chalk this up as an edge case.

@jmgasper
Copy link
Collaborator

Payment task has been updated: https://www.topcoder.com/challenges/d33759f3-21e7-457c-a042-34bf812bb1d7
Payments Complete
Winner: afrisalyp
Copilot: ghostar2020
Challenge d33759f3-21e7-457c-a042-34bf812bb1d7 has been paid and closed.

This is an automated message for ghostar2020 via Topcoder X

@jmgasper jmgasper added this to the Version 1.2 milestone Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants