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

Upload initiation fails due to asserting wrong HTTP status code #124

Closed
lisandromc opened this issue May 8, 2020 · 2 comments · Fixed by #141
Closed

Upload initiation fails due to asserting wrong HTTP status code #124

lisandromc opened this issue May 8, 2020 · 2 comments · Fixed by #141
Assignees
Labels
api: storage Issues related to the googleapis/google-resumable-media-python API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@lisandromc
Copy link
Contributor

lisandromc commented May 8, 2020

Code in module _upload.py, line 453 of method _process_initiate_response reads:

        _helpers.require_status_code(
            response,
            (http_client.OK,),
            self._get_status_code,
            callback=self._make_invalid,
        )

However, initiating an upload against https://storage.googleapis.com yields a 201 Created response, so it fails to comply.

Fixing this is as simple as adding http_client.CREATED to line 455:

(http_client.OK, http_client.CREATED),
lisandromc added a commit to blink-media-inc/google-resumable-media-python that referenced this issue May 8, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label May 9, 2020
@busunkim96 busunkim96 added api: storage Issues related to the googleapis/google-resumable-media-python API. and removed triage me I really want to be triaged. labels May 12, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels May 12, 2020
@frankyn frankyn added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. triage me I really want to be triaged. labels May 13, 2020
@frankyn
Copy link
Member

frankyn commented May 13, 2020

Do you have bandwidth to take a look at making this fix?

@frankyn frankyn assigned frankyn and unassigned HemangChothani May 13, 2020
@frankyn
Copy link
Member

frankyn commented May 13, 2020

Ah, thanks @lisandromc for sending a fix, I'll review.

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label May 15, 2020
@frankyn frankyn added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed 🚨 This issue needs some love. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels May 22, 2020
tseaver pushed a commit that referenced this issue Jul 23, 2020
frankyn pushed a commit that referenced this issue Jul 23, 2020
* fix: accept `201 Created` as valid upload response.

Supersedes: #125

Fixes: #124

* tests: accomodate unit test to extra argument.

Co-authored-by: Lisandro Mc Gough <lisandro78@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/google-resumable-media-python API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
5 participants