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
[storage] Confusing behavior when using a custom endpoint #5072
Comments
Or maybe disable switching to the XML API if any custom endpoint is being used.
I agree, but I think disabling the switch is cleaner. What do you think? As a workaround, can you use the testbench included in |
Yes, disabling the switch will work too. I shall try the testbench! |
That, unfortunately, will not work. Some folks override the endpoint to use private interconnects, and we would want to keep XML enabled in that case. I see that |
Hmm why do you think it has partial XML support? I didn't find anything in code or HTTP routes. |
This looks like But I have not looked further to see if operations to PUT/POST/GET objects behave as the service does, e.g., they parse and return the right HTTP headers. |
Okay, I looked further, definitely no support for XML, filed fsouza/fake-gcs-server#331 |
And also fsouza/fake-gcs-server#332 |
I have setup things to automatically close this issue via #5100. Once that change is in there are no actionable things for us to do, there are some problems using the |
Does this issue affect the google-cloud-cpp project?
I believe so.
What component of
google-cloud-cpp
is this related to?GCS/storage/CURL client.
Describe the bug
TL;DR: Tried to use a custom endpoint, some requests properly go to the endpoint, and some go to
storage.googleapis.com
instead. This is because CURL client 1) automatically switches to XML API unless certain headers are provided 2) ignores the custom endpoint for XML requests in favor ofCLOUD_STORAGE_TESTBENCH_ENDPOINT
.Long version: I am trying to add GCS support in apache/arrow. I've built and installed the
google-cloud-cpp
project as described indoc/packaging.md
(on Ubuntu 18.04), except that I made shared libs.Then, I wrote some C++ code implementing a filesystem interface for Arrow, using
google::cloud::storage
client.Then, I wrote a test using fsouza/fake-gcs-server. The test setup creates a bucket, creates a file, and reads the file back.
To be able to use
fake-gcs-server
, I launch the server like this:and provide a custom endpoint like this:
gcs::Client
, I create a bucketbucket
, insert an objectsomefile
, and read an object withclient_->ReadObject("bucket", "somefile");
. The resultinggcs::ObjectReadStream
has a badbit, and the status just saysPermanent error in Read(): [PERMISSION_DENIED]
.google-cloud-cpp
's CURL clientCLOUD_STORAGE_TESTBENCH_ENDPOINT
: https://github.com/googleapis/google-cloud-cpp/blob/v1.17.0/google/cloud/storage/internal/curl_client.cc#L242Expected behavior
fake-gcs-server
doesn't support XML API. I guess the expected behavior here would be to stick to custom endpoint even if switched to XML API, and then I could see the unsupported web server route error. Or at least I'd like the error message to be informative enough that I can understand that the wrong endpoint is being used.Operating system:
Ubuntu 18.04.2 LTS
Linux 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
What compiler and version are you using?
c++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
What version of
google-cloud-cpp
are you using?Git tag
v1.17.0
.The text was updated successfully, but these errors were encountered: