incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Bug][Github] Github Connection not working, PAT is not being validated

Open Suhasr76 opened this issue 3 years ago • 10 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

I work in a organisation, and when I tried to add a github connection by following the docs, the PAT is not validated

Screenshot 2023-02-20 at 9 01 10 AM

The devlake.log file shows this error

Screenshot What is the reason for this error? This bug might be because, the org uses few https certificates for https requests, so is there a way to upload these certificates during initiating a connection. Or is it something else?

What do you expect to happen

  • Able to use above mentioned https certificates for required connection (this is applicable for Bitbucket also)
  • Or any other fix

How to reproduce

  • Initiate the github connection
  • Generate and Use PAT to authenticate
  • But for our organisation, PAT is not being validated

Anything else

No response

Version

main

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

Suhasr76 avatar Feb 23 '23 03:02 Suhasr76

Thanks for your valuable feedback and suggestion.

Make sure the endpoint of the GitHub connection was https://api.github.com/ Make sure you can use curl or postman to access the URL https://api.github.com/user success with your token.

mappjzc avatar Feb 23 '23 09:02 mappjzc

Hi @mappjzc, since we are using github enterprise and my github account is from the same enterprise, I used https://hostname/api/v3/ and it seems to be working now, but before I used different endpoint.

And also, https://api.github.com didn't work for a PAT generated from personal github account. What might be the reason for that?

Thanks for your help!!

Suhasr76 avatar Feb 23 '23 12:02 Suhasr76

Hi @mappjzc, since we are using github enterprise and my github account is from the same enterprise, I used https://hostname/api/v3/ and it seems to be working now, but before I used different endpoint.

And also, https://api.github.com didn't work for a PAT generated from personal github account. What might be the reason for that?

Thanks for your help!!

I don't know what is your meaning about didn't work for a PAT generated from personal GitHub account. Can you show more details?

mappjzc avatar Feb 23 '23 13:02 mappjzc

In the sense, initially I tried to add 2 github connections

  • One with my personal github account, with endpoint https://api.github.com/ and PAT generated from this account, and this one didnt work in the config-ui, but I was able to use curl to access this token
  • Second one was with my enterprise given github account and their endpoint https://hostname/api/v3/ and PAT generated from that account. This worked with both the config-ui and curl.

The first connection showed this error Screenshot 2023-02-20 at 9 01 10 AM

And this was the log in devlake.log Screenshot

Suhasr76 avatar Feb 25 '23 05:02 Suhasr76

Hi, @Suhasr76 , Would you mind sharing your curl command? Thanks.

klesh avatar Feb 27 '23 07:02 klesh

This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Apr 07 '23 00:04 github-actions[bot]

This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.

github-actions[bot] avatar Apr 14 '23 00:04 github-actions[bot]

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jan 02 '24 00:01 github-actions[bot]

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Mar 07 '24 00:03 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Mar 15 '24 00:03 github-actions[bot]