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

[Bug][GitHub] GitHub PAT not working with private GitHub organization #8190

Open
2 of 3 tasks
GiesN opened this issue Nov 14, 2024 · 5 comments
Open
2 of 3 tasks

[Bug][GitHub] GitHub PAT not working with private GitHub organization #8190

GiesN opened this issue Nov 14, 2024 · 5 comments
Labels
severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug

Comments

@GiesN
Copy link

GiesN commented Nov 14, 2024

Search before asking

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

What happened

Hello everyone,
we want to use Apache DevLake for our private company GitHub organization.
We created a PAT with the permissions mentioned in the documentation and added SSO to the organization for this token.
The token is still throwing an error and saying it need a certain set of permissions which the PAT has.

Bildschirmfoto 2024-11-14 um 10 03 52

What do you expect to happen

The PAT should work, because he has the right permissions and we should be able to connect to our GitHub org.

How to reproduce

Not possible

Anything else

No response

Version

v1.0.2-beta3@7cf1a60

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@GiesN GiesN added the type/bug This issue is a bug label Nov 14, 2024
Copy link

dosubot bot commented Nov 14, 2024

Hey there, @GiesN! I'm here to help you with any bugs, questions, or contributions you have for the Apache DevLake project. Let's tackle this GitHub PAT issue together.

To resolve the issue with the GitHub PAT not working with your private GitHub organization in Apache DevLake, ensure that the PAT has the following permissions:

  • repo
  • read:user
  • read:org

These permissions are necessary for accessing private repositories. Additionally, if you are using fine-grained personal access tokens, make sure the token is granted read-only permission for entities such as Actions, Contents, Discussions, Issues, Metadata, and Pull requests. Also, fine-grained PATs do not support GraphQL APIs, so you must disable Use GraphQL APIs on the connection page if you choose to use them, which may significantly increase data collection time [1][2].

If the permissions are correctly set and the issue persists, check if there are any specific error messages or logs that could provide more details on the problem. Starting from version 0.18.0, DevLake provides an auto-check for the permissions of your token(s), which might help identify any missing permissions [3].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the severity/p1 This bug affects functionality or significantly affect ux label Nov 14, 2024
@GiesN
Copy link
Author

GiesN commented Nov 14, 2024

@dosu The permissions for the PAT are set correctly. It must be another issue. Could it be that the organization is a private one?

Copy link

dosubot bot commented Nov 14, 2024

If the permissions for the PAT are set correctly and you're still encountering issues, it could be related to the organization being private. Ensure that the PAT is authorized for SSO if your organization enforces SAML SSO. Without proper SSO authorization, the token might not work even if it has the correct permissions. Additionally, check for any specific error messages or logs that might provide more insight into the issue. If the repositories keep loading or you encounter a 403 error, it might indicate insufficient permissions or SSO-related issues [1].

To continue talking to Dosu, mention @dosu.

@GiesN
Copy link
Author

GiesN commented Nov 14, 2024

@dosu SSO is also configured right. Is there something else which can lead to this error message by mistake?

Copy link

dosubot bot commented Nov 14, 2024

If the permissions and SSO are configured correctly, and you're still facing issues, consider the following possibilities:

  1. Token Expiry or Revocation: Ensure that the PAT is still valid and hasn't been revoked or expired.

  2. Organization Settings: Check if there are any organization-level settings or policies that might restrict access, even with a valid PAT.

  3. Network or Firewall Restrictions: Verify that there are no network or firewall restrictions that might be blocking the connection between DevLake and GitHub.

  4. DevLake Configuration: Double-check the DevLake configuration to ensure that the GitHub connection settings are correctly set up, including the correct GitHub API URL if you're using GitHub Enterprise.

  5. Error Logs: Review any error logs or messages for additional clues. Sometimes, logs can provide specific details about what might be going wrong.

If none of these resolve the issue, it might be helpful to look for any recent changes in your GitHub organization or DevLake setup that could have affected the connection.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant