-
Notifications
You must be signed in to change notification settings - Fork 731
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
400 from OKHttp getInputStream #288
Comments
You might want to make sure that token is revoked, it might expire on its own though. But I don't see that repository anywhere. If it's a private repository, make sure that in the flow you ask for the right permissions, so that the token you receive from GitHub can actually be used for your usecase. (I believe that would be |
@Shredder121 : Thanks for your response. The repo I am accessing is a private repo and I am using OAuth to access it. I have permissions to access it and outside of this tool, do not have issues using the repo in any way. |
Could you, for science, build in a small delay between obtaining the token and using it? And maybe that's why manually browsing to it works, because that has a long enough delay. |
The way my program operates is - at the start of the session it authenticates to GitHub using OAuth and obtains the token. Then, it gets all directories in the repo, using the token. So far so good. Then, it iterates over these directories and gets files from each directory (again using the token). At this point it fails to obtain that file although the |
Any other ideas? |
Just wondering, what version of okhttp-urlconnection do you use? |
I actually meant to close this later last night. I was on version 1.72. I switched to the latest (1.76) and that resolved the issue. It's a little weird because.this code has been untouched for several months and it used to work (even with 1.72). Maybe GitHub made some breaking change underneath? I noticed this issue: #215, which could've led to the symptom I was seeing, however I confirmed that version 1.72 had the fix for it. So it has to be some later commit that changed something. Not sure which one but glad that updating the version fixes this issue, for now. Thank you for your responses! |
Yes, possible! Thanks. Still a mystery why it was working earlier but suddenly stopped. |
I can confirm that GitHub changed the way they handled ( All in all, that means that was the issue, so it's fixed for you, and not just 'for now' but for always. |
Hello,
I have built a tool using your API, which has been working for many months now, but suddenly fails due to a
FileNotFoundException
thrown bygetInputStrem
in OKHttp. When I paste the url it is trying to download, into my browser, it works perfectly fine. I can see the file contents. This is very strange. Do you have any clue about this?Stack trace:
Your help is greatly appreciated,
Sumithra
The text was updated successfully, but these errors were encountered: