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] Flytectl demo start with GITHUB_TOKEN throws 401 #4879

Closed
jsong336 opened this issue Feb 12, 2024 · 7 comments
Closed

[BUG] Flytectl demo start with GITHUB_TOKEN throws 401 #4879

jsong336 opened this issue Feb 12, 2024 · 7 comments
Assignees
Labels
bug Something isn't working flytectl Issues related to flytectl -Flytes CLI sandbox

Comments

@jsong336
Copy link
Contributor

When flytectl demo start is ran with GITHUB_TOKEN, it throws 401 error. Setting GITHUB_TOKEN empty works.

flytectl demo --logger.level 5 --logger.show-source start
INFO[0000] [0] Couldn't find a config file []. Relying on env vars and pflags. 
{"json":{"src":"viper.go:400"},"level":"debug","msg":"Config section [admin] updated. Firing updated event.","ts":"2024-02-12T02:17:43-05:00"}
🧑‍🏭 Bootstrapping a brand new Flyte cluster... 🔨 🔧
Error: GET https://api.github.com/repos/flyteorg/flyte/releases?per_page=100: 401 Bad credentials []
{"json":{"src":"main.go:13"},"level":"error","msg":"GET https://api.github.com/repos/flyteorg/flyte/releases?per_page=100: 401 Bad credentials []","ts":"2024-02-12T02:17:43-05:00"}

It seems to do something with when flytectl tries to list list available images with authenticated GHRepoService
https://github.com/flyteorg/flytectl/blob/9c87165667b75efedd678707aeacc5a4e4981261/pkg/github/githubutil.go#L75

Copy link

welcome bot commented Feb 12, 2024

Thank you for opening your first issue here! 🛠

Copy link

dosubot bot commented Feb 12, 2024

🤖

Hey there, @jsong336! Nice to see you back. Hope you've been doing well!

Based on the error message you provided, it seems like the GITHUB_TOKEN you're using might not have the correct permissions. The flytectl demo start command is trying to list the available releases from the Flyte repository on GitHub, which requires read access to the repository.

The GITHUB_TOKEN is used for authentication with GitHub's API. It's possible that the token you're using either doesn't have the necessary permissions, or it might be expired or invalid.

Here are a few things you can try:

  1. Check the permissions of your GITHUB_TOKEN. It needs to have the public_repo or repo scope to read the repository information. You can check and modify the permissions of your token in your GitHub account settings.

  2. Make sure your GITHUB_TOKEN is still valid. Tokens can expire or be revoked. You can generate a new token in your GitHub account settings if needed.

  3. If you're running this command in a GitHub Actions workflow, make sure the workflow has access to the GITHUB_TOKEN secret. You can check this in the settings of your GitHub repository.

If none of these suggestions solve your issue, could you provide more information about your environment? Specifically, how you're running the flytectl demo start command (e.g., locally, in a CI/CD pipeline, etc.) and any additional configuration you might have set up related to GitHub authentication.

For more information about GitHub tokens and their permissions, you can refer to the GitHub documentation.

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

-Dosu

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the bug Something isn't working label Feb 12, 2024
@pingsutw
Copy link
Member

@jsong336, Is it still not working for you?

@pingsutw pingsutw added flytectl Issues related to flytectl -Flytes CLI sandbox labels Feb 15, 2024
@jsong336
Copy link
Contributor Author

@pingsutw It works when I set the GITHUB_TOKEN empty. I think the flytectl uses GITHUB_TOKEN if it exists while getting the list available images and throw 401 since I dont have access over the repos which I think is very strange behaviour

@pingsutw
Copy link
Member

I think Flytectl should check if GITHUB_TOKEN Zia empty or not.
Would you like to open a pr for this?

@jsong336
Copy link
Contributor Author

Yeah I could, I probably would like to dig the code bit more to see what should be expected behaviour.

@jsong336
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytectl Issues related to flytectl -Flytes CLI sandbox
Projects
None yet
Development

No branches or pull requests

2 participants