Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[RestEndpointOption][IPV4 instead of Domain] Set RestEndpointOption with ip address resolved by dns 8.8.8.8, result in "The specified bucket does not exist." #15019

Answered by FengYikai710
FengYikai710 asked this question in Q&A
Discussion options

Set RestEndpointOption with ipv4 address resolved by dns 8.8.8.8, and the https request failed with "The specified bucket does not exist.". Can RestEndpointOption set to ip address resolved by dns ? Is the domain "storage.googleapis.com" the only option for RestEndpointOption ? Could you help me with this @dbolduc, I'll be extremely grateful!

You must be logged in to vote

@ddelgrosso1 Finally I figure out that the problem is caused by SNI field in TLS message,if I set CURLIOT_URL with IPV4,SNI is empty which lead to a "NoSuchBucket" respond. Set the CURLOPT_CURL with "https://storage.googleapis.com:443" and CURLOPT_RESOLVE with "storage.googleapis.com:443:142.251.32.123" (142.251.32.123 is the result of dns resolve), curl will send TLS message to endporint 142.251.32.123 with SNI. I Customized CURLOPT_RESOLVE parameters in sdk and it works! Thanks for the help!

Replies: 2 comments 5 replies

Comment options

Hey, I am no longer working on this project. So I will tag: @scotthart

You must be logged in to vote
0 replies
Comment options

@FengYikai710 Yes, RestEndpointOption should work with an IP address. For example:

auto client = google::cloud::storage::Client(
 google::cloud::Options{}
 .set<google::cloud::storage::RestEndpointOption>("127.0.0.1:9000"));
auto ws = client.WriteObject("ddelgrosso-test-bucket", "test-cancellation");

Resulted in requests being sent to a listening emulator running on 127.0.0.1 port 9000.

You must be logged in to vote
5 replies
Comment options

@FengYikai710 do you have a code sample and / or can you explain a bit about what you are trying to accomplish. It would help me guide you a bit better.

Comment options

@ddelgrosso1 code sample as follows:
auto client = google::cloud::storage::Client( google::cloud::Options{} .set<google::cloud::storage::RestEndpointOption>("https://74.125.68.207:443"));
auto response = client.ListBucketsForProject("test_project");
I tried to access storge service with ipv4 address, and the sdk return StatusCode kNotFound with msg
image

Comment options

@FengYikai710 from the error it isn't clear that there is a problem connecting to the IP address provided. Rather it looks like the service is returning a not found. Can you try running with logging enabled by setting the environment variables: CLOUD_STORAGE_ENABLE_TRACING=rpc,http GOOGLE_CLOUD_CPP_ENABLE_CLOG=Y. This might help give a better idea of what is going on.

Comment options

@ddelgrosso1 Finally I figure out that the problem is caused by SNI field in TLS message,if I set CURLIOT_URL with IPV4,SNI is empty which lead to a "NoSuchBucket" respond. Set the CURLOPT_CURL with "https://storage.googleapis.com:443" and CURLOPT_RESOLVE with "storage.googleapis.com:443:142.251.32.123" (142.251.32.123 is the result of dns resolve), curl will send TLS message to endporint 142.251.32.123 with SNI. I Customized CURLOPT_RESOLVE parameters in sdk and it works! Thanks for the help!

Answer selected by FengYikai710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /