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
Issue with PublicHost and Golang client #1202
Comments
Hmm, that's interesting. |
@fsouza thank you for the reply! I am not sure what is happening but in Weird thing is that if I copy Could you please run it yourself to see if it works/fails? P.S. I guess it has something do to with it being example. This doesn't panic
Still don't understand why it fails in some files and not in the others. |
I had a very very similar issue with Google's Go client. I don't know that it's the same issue, but this stumped me for longer than I'll care to admit. By default, the Go client code will use the XML range reader rather than the JSON range reader (see https://github.com/googleapis/google-cloud-go/blob/cf3452eba7d02b28343c9e6c2425288f80e42d3c/storage/http_client.go#L780-L790). If I, on the official client, say |
@jboyens you've saved me a lot of time! |
Thanks @jboyens ! |
Hey!
Thank you for the great GCS emulator!
I am using this server as a local storage while working with DuckDB.
It has a feature working with files in S3 storages directly https://duckdb.org/docs/guides/import/s3_import
To use it I need to configure endpoint
SET s3_endpoint='some-host';
As far as I understand that should be the same host that is specified in
public-host
.I just picked up value for public host from source code comment, i.e.
storage.gcs.127.0.0.1.nip.io:4443
It works fine when I run
fake-gcs-server
as a binary but fails when I run it within Golang unit-test.I took this example https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/example_test.go#LL41C13-L41C13 and added
PublicHost: "storage.gcs.127.0.0.1.nip.io:8081"
and then gotobject not found
error.After some debugging I realized that the issue is probably here https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/server.go#L418
r.Host
wasstorage.googleapis.com
whiles.publicHost
wasstorage.gcs.127.0.0.1.nip.io:8081
.I got it working by initialing GCS client manually
and specifying
Scheme = "http"
I wonder if it's intended behaviour? My impression was that
(*Server).Client()
method should have handled this automatically as it was stated in the commentThis issue might be related to #982
The text was updated successfully, but these errors were encountered: