-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Githubreceiver fails with ERROR 404 trying to login api.github.com #38393
Comments
Pinging code owners for receiver/github: @adrielp @andrzej-stencel @crobert-1 @TylerHelmuth. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label. |
@bayer-alvaro - what are the permissions assigned on your authentication token? That specific message is a returned call from GitHub. Usually the 404 data null simply means permissions don't allow you to make the query search. Security through obscurity, but the practice is don't let anyone know a repo (or rather resource) exists if you don't have the required permissions to view it. This is how the |
/label -needs-triage waiting-for-author |
Hi @adrielp , thanks for your reply but the token has ORG level Read permissions. Indeed, I ensured it does by directly requesting, using same token
And getting expected json response with no issues at all |
@bayer-alvaro - In the original message, I'm not seeing any mention of login. That message is a GraphQL response saying that the query made didn't return any data on a scrape of metrics. Login errors would show up as failed to login through GraphQL... and I don't see that in the snippet of the log presented. Also, GraphQL and REST have different auth flows behind the scenes (on GitHubs side). Login is only through GraphQL The Read-Only token Repository permissions needed are:
From there, ensure your token is given access to the repositories within your org (GitHub used to require a request be approved to do that for orgs) Please remove the I'm going to leave this issue open for a little bit. If you'd like to get a quick response and have a small working session I'm on the CNCF slack so feel free to reach out. This appears to be a config issue, not an issue with the receiver itself. |
Hi back @adrielp , Following your advices, I am getting some different results. Seems like now scraping and facing some other issues I'll have to figure out apart from this one. Something I do not understand: as suggested by you, I removed endpoint.
Is it implicit ? Or that config fields is meant only for self managed github? |
Scraper throws back only this same error all time
Highlighting the fact to report code I guess this may be related to limit query, but beyond org and topic, not sure what else ... How many repositories may be considered like "too much" ?
|
Closing as login issue is overcome. Thanks @adrielp |
Yes, it's implicit. Here's the code that builds the clients. If So, endpoint is only needed if it's a self-managed server and should only be the regular URL like For the 502 error, I haven't seen this error in a long time. It's an internal server error on the GitHub side. Here's an issue (and another) from other communities who have similarly experienced this. I'm working on adding exponential backoff retries for rate limiting. I might be able to figure something out here, but headers don't actually come back through the library for graphql we're using. I'm really surprised to see a 502 though. this code was specifically set to 50 to address this on branches and haven't seen a 502 pop up sense. |
Component(s)
receiver/github
Describe the issue you're reporting
I've tried several different configurations, switching endpoint between "https://api.github.com" and " "https://api.github.com/graphql". All fail with
error scraperhelper@v0.120.1-0.20250303102058-a9bca17f1a4c/obs_metrics.go:61 Error scraping metrics {"otelcol.component.id": "github", "otelcol.component.kind": "Receiver", "otelcol.signal": "metrics", "error": "returned error 404: {\"data\":null}"}
My config file
The text was updated successfully, but these errors were encountered: