googleapis / googleapis/google-cloud-dotnet

StorageClient.DownloadObject is throwing System.Net.Http.HttpRequestException: No such host is known. (storage.googleapis.com:443) error

Open
#14,556 12 comments 0 reactions 1 assignee Assigned to @rajeevpodar View on GitHub
api: storage priority: p3 type: question
Dominant language
C#
Stars
1.1k
Forks
411
Avg merge
7h 29m
Merged PRs (30d)
57

Description

I use the StorageClient API to list objects, upload objects and download objects. It is working just fine when I try from my laptop but when deployed to Windows Server 2016, I was seeing the above error. Therefore, I requested the Proxy account for my App. Once that is setup, I added the proxy to StorageClient's InnerHandler as specified in [this article](https://github.com/googleapis/google-cloud-dotnet/issues/1832).

However, this works just fine for listing the objects and upload the objects but it still does not work for DownloadObject. For some reason it still throws the "No such host is known. (storage.googleapis.com:443)" when I make the call to DownloadObject. If I go by [amanda-tarafa](https://github.com/amanda-tarafa) post I cannot even call List Objects and get the same error.

That said, can anyone tell me why the DownloadOject does not use the proxy that is set in either inner handler or using HttpClientFactory? The code used to set the proxy is as sampled by jskeet and also by amanda-tarafa but nothing works for DownloadObject.

I greatly appreciate if you could help me solve this mystery.

-Vincent D'Souza

Here is the error:
System.Net.Http.HttpRequestException: No such host is known. (storage.googleapis.com:443)
---> System.Net.Sockets.SocketException (11001): No such host is known.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Google.Apis.Http.ConfigurableMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Google.Apis.Download.MediaDownloader.DownloadCoreAsync(String url, Stream stream, CancellationToken cancellationToken)
at Google.Apis.Download.DownloadProgress.ThrowOnFailure(IDownloadProgress progress)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.