mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #371] Invalid Request when calling create_file with Ruby GCS SDK #2222
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#2222
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mheffner on GitHub (Nov 26, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/371
When using the googe-cloud-storage Ruby gem, version 1.29.1, to try and upload a file to fake-gcs-server we are seeing an Invalid Request error. This is the request as seen from the fake-gcs-server logs:
It would appear that we are hitting this error case:
github.com/fsouza/fake-gcs-server@e8bd4c7f4a/fakestorage/upload.go (L71)which makes sense as we are not using a policy nor is there an
uploadTypePOST param.I can reproduce this with the following code:
This will throw an exception in:
If I run a netcat locally and point the endpoint at it, this is the full initial POST request:
This doesn't seem to follow the documented API, so I'm not exactly sure how it's supposed to work. Have others seen this before?
Cheers!
@mheffner commented on GitHub (Nov 28, 2020):
Digging further on this, the implementation stems from the ResumableUpload protocol here: https://github.com/googleapis/google-api-ruby-client/blob/master/lib/google/apis/core/upload.rb
I did not see it documented for GCS, but it does seem to closely mirror the protocol documented for the Photos API: https://developers.google.com/photos/library/guides/resumable-uploads
I was able to spike enough of an server-side implementation to get the Ruby SDK working, though it is by far a full version. I'll push a PR if it is useful for others.
@mheffner commented on GitHub (Nov 28, 2020):
PR here: https://github.com/mheffner/fake-gcs-server/pull/1. Not pulled on this repo as it requires some lint fixes first.
@fsouza commented on GitHub (Nov 30, 2020):
There are other undocumented things that we support here, so this should be fine 🙈 I merged your other PR and cleaned up the main branch, please feel free to send your PR :D
Thank you very much for reporting and investigating it!
@mheffner commented on GitHub (Nov 30, 2020):
Thanks @fsouza , I'll clean it up and submit it soon.
I did finally find this, though it doesn't provide a lot more context. 😆 https://github.com/googleapis/google-api-ruby-client/issues/311