mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #280] [go-example] object doesn't exist #2207
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#2207
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 @ncarenton on GitHub (Jun 19, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/280
Thanks for this project!
I can not make the go-example work, it finds the bucket but not the object:
The strange thing is that curl is working fine so the object is actually there:
It is also working fine with the python example:
@fsouza commented on GitHub (Jun 21, 2020):
Hey @ncarenton, thanks for reporting and apologies for the delayed response. Not sure if you noticed this comment in the example file:
github.com/fsouza/fake-gcs-server@c822c3b926/examples/go/main.go (L5-L9)(I feel like we can probably move that comment elsewhere in the file, it's easy to miss it as part of the package statement)
In order for the downloads to work in the way the Go example expects, the server needs to be started with some flags.
@ncarenton commented on GitHub (Jun 21, 2020):
Hi @fsouza, no worries for the short delay :)
I actually did miss this comment, it could indeed be moved to
downloadFile()for example, for better visibility.Starting my docker container with
-public-hostdoes fix my issue! Still I would like to ask if it is possible to use a regular GCS client with the fake server, meaning without these 2 arguments:option.WithEndpoint("https://storage.gcs.127.0.0.1.nip.io:4443/storage/v1/"), option.WithHTTPClient(httpClient)? Is it possible to do that and setSTORAGE_EMULATOR_HOSTenv var so we start the fake server without-public-hostthen ? I get the feeling it would be simpler.Many thanks for your help
@fsouza commented on GitHub (Jun 22, 2020):
I don't know if the Go sdk supports
STORAGE_EMULATOR_HOST🤔 Does it?If the sdk supports that env var, we could support it in the emulator too, or figure out a way to bind to any host (not sure if it's possible because of conflicting paths).
@ncarenton commented on GitHub (Jun 22, 2020):
I guess so: https://github.com/googleapis/google-cloud-go/blob/master/storage/storage.go#L104
@fsouza commented on GitHub (Jun 22, 2020):
Nice, in that case we need to look for that variable and if it's defined, bind in the proper port and use HTTP instead of HTTPs.
@yiyue115 commented on GitHub (Sep 30, 2020):
Hello 😃 Actually I faced a similar issue as well cuz I missed that comment 😛
Is there any update on this one?
@OrangeFlag commented on GitHub (Dec 8, 2020):
Hello, in my case I have set the correct external-url and public-host for my docker container, but when I call fake-gcs from the local machine, I also get a 404
I used wireshark and realized that the requests differ in the Host field and response in Location field.
Wouldn't it be nice to reply based on the Host being sent and remove the external-url and public-host?
So it would be possible to call the service from any environment
Thanks for your work!
TLDR
docker-compose for fast-gcs
Fast fix to request fake-gcs from localhost:
@sfro commented on GitHub (Mar 16, 2021):
I'm not able to create objects no matter what public-host I put 🤔 logs show that the request isn't even reaching the server.
Using cloud.google.com/go/storage v1.14.0.
@fsouza commented on GitHub (Mar 18, 2021):
Hey @sfro, I'll try updating the example to include upload. thanks for reporting!