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
httplib2 v0.16.0 breaks the library #803
Comments
@lzzy12 Thank you for the report! Would you be able to provide a bit of code demonstrating the issue? |
It looks like there were some changes to how redirects are handled in 0.16.0. See httplib2/httplib2@45441b2#diff-c6669c781a2dee1b2d2671cab4e21c66. I'll have to go through more carefully to figure out what's causing the error. For those of you who are experiencing issues, are you all using |
Yes me! |
Sorry, one more question. It looks like @HarlanH is using python2. @lzzy12 are you also using python 2? Edit: I see httplib2/httplib2#156 which may be relevant. Edit 2: It looks like the maintainers of httplib2 have come up with a workaround (allowing users to choose which redirects to follow) which will come out in the next release. It might be worth pinging the API team to see if they can add the missing header. For now, continue to use Edit 3: The Google Drive API Team uses the 308 response as (Resume Incomplete), rather than Permanent Redirect per the RFC. |
httplib2 v0.17.0 is just released with API to handle this. Sorry, I couldn't quickly find where to apply the following patch in this repo, aside from samples (which should probably be modified too). http = httplib2.Http()
+http.redirect_codes = set(http.redirect_codes) - {308} |
Side note: what a wonderful ironic mystery this issue number is 308 backwards. |
I am also experiencing the same behavior, yesterday logic was still working today not anymore. |
@SaschaHeyer yes it needs tests #813 |
Experienced this behavior uploading a large file that (presumably?) required a resumable upload, but with a file under 5MB the behavior does not happen. |
As mentioned in OP, you can pin httplib2 to v0.15.0 as a temporary fix |
You just need to execute the |
Merge #813 is proper solution, they rightfully asked for tests so it doesn't happen again. Someone please add test to that PR. It just needs to run existing upload test with particular version of dependency. Pin @rsmbyk |
I had this error and tried to ignore the exception. But when I access the |
Sorry about the delay folks, will get a test added to that PR and merged either today or early next week. Please continue to use 0.15.0 in the meantime. |
|
And a new Error
|
@mengyyy likely you have old httplib2 on that system. And invalid_requestMissing is just another error, it's not related here. |
I try it in another server and upte these two package but get the same result.
|
@mengyyy sorry my last try at workaround is |
I'm facing the same issue running this sample code. I pinned Output of pip freeze in the working state is
the doesn't work state would have been the same as above but with |
See more at googleapis/google-api-python-client#803. Fix applied as recommended in googleapis/google-api-python-client#803 (comment)
See more at googleapis/google-api-python-client#803. Fix applied as recommended in googleapis/google-api-python-client#803 (comment)
just in case this issue comes back to life -- I just ran into this same ( RedirectMissingLocation ) error when using
I then updated my gcloud components and the problem seemed to go away. UPDATE: it seems that updating the SDK was not the solution -- rather copying the file that I wanted to upload into BigQuery first to a GCS bucket and then loading from there seems to have been the solution to the problem. |
Seeing this issue on httplib2 version 0.18.1 as well (Python 3.6.8) Pip freeze:
I had to downgrade to 0.15.0 seeing the above suggestions. |
Similar to googleapis#9, this exposes the `redirect_codes` attribute of the underlying httplib2.Http instance on AuthorizedHttp, letting users modify the set of HTTP status codes interpreted as redirects (as in googleapis/google-api-python-client#803).
Similar to #9, this exposes the `redirect_codes` attribute of the underlying httplib2.Http instance on AuthorizedHttp, letting users modify the set of HTTP status codes interpreted as redirects (as in googleapis/google-api-python-client#803).
Looks like the error is back... I've upgraded ALL libraries to most recent: google-api-python-client |
@pkenjora Could you please open a new issue referencing this one? Replies to closed issues are more likely to be missed by repo maintainers. It would also be helpful if you could show the full Thanks! |
New issue at #1006 |
FIX: The error is caught at the wrong layer. This is actually an application layer error due to incorrect schema. Double check your schema, for me I had an incorrect time zone format "Los_Angeles/America" instead of "America/Los_Angeles", which triggered this error. Check your request schema! |
Recently updated httplib2 library (v0.16.0) have a breaking change causing this Exception:
httplib2.RedirectMissingLocation: Redirected but response is missing a location: header
Steps to reproduce:
pip install --upgrade httplib2
It should either force to use 0.15.0 version of httplib2 or adapt the breaking changes introduced in the new version.
A temporary fix for those using the client library would be to add httplib2==0.15.0 in requirements,txt of the project
The text was updated successfully, but these errors were encountered: