[英]Why getting Grpc.Core.RpcException StatusCode=Unavailable, Detail=“Connect Failed”, with Google Cloud Firestore 1.0.0-beta05 C# SetAsync?
We are using C# with the Google.Cloud.Firestore.1.0.0-beta05 NuGet package, and we always get a Grpc.Core.RpcException when we try to call SetAsync. 我们正在将C#与Google.Cloud.Firestore.1.0.0-beta05 NuGet包一起使用,并且在尝试调用SetAsync时始终会收到Grpc.Core.RpcException。
Details: 细节:
Can anyone help us understand why we get the following? 谁能帮助我们理解为什么我们得到以下内容?
Grpc.Core.RpcException: Status(StatusCode=Unavailable, Detail="Connect Failed") Grpc.Core.RpcException:状态(状态代码=不可用,详细信息=“连接失败”)
The relevant snippets follow. 相关片段如下。
Any help would be greatly appreciated. 任何帮助将不胜感激。
Regards, 问候,
Eamonn 埃蒙·
C# Method: C#方法:
private async Task FirebaseSetAsync(string projectId)
{
var database = FirestoreDb.Create(projectId: projectId);
var docRef = database.Collection("users").Document("company");
Dictionary<string, object> user = new Dictionary<string, object>
{
{ "First", "Alan" },
{ "Middle", "Mathison" },
{ "Last", "Turing" },
{ "Born", 1912 }
};
try
{
var result = await docRef.SetAsync(user);
}
catch (Exception exception)
{
Log.Error("Exception.", exception);
}
}
web.config snippet: web.config代码段:
<system.net>
<defaultProxy>
<proxy proxyaddress="http://w.x.y.z:pppp/" />
</defaultProxy>
</system.net>
Log file snippet: 日志文件片段:
20:15:26.938 [ 7] [(null)] ERROR FirebaseFive.Controllers.HomeController - Exception.
Grpc.Core.RpcException: Status(StatusCode=Unavailable, Detail="Connect Failed")
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Google.Api.Gax.Grpc.ApiCallRetryExtensions.<>c__DisplayClass0_0`2.<<WithRetry>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Google.Cloud.Firestore.WriteBatch.<CommitAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Google.Cloud.Firestore.DocumentReference.<SetAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at FirebaseFive.Controllers.HomeController.<FirebaseSetAsync>d__1.MoveNext() in
D:\\Projects\\Git\\Firebase\\FirebaseFive\\FirebaseFive\\Controllers\\HomeController.cs:line 33 D:\\ Projects \\ Git \\ Firebase \\ FirebaseFive \\ FirebaseFive \\ Controllers \\ HomeController.cs:第33行
With grateful assistance from some people at Google, the answer is as follows: 在Google某些人员的帮助下,答案如下:
The Firestore library/SDK communicates using the HTTP/2.0 Protocol and our Company Proxy (squid-cache) does not support HTTP/2.0. Firestore库/ SDK使用HTTP / 2.0协议进行通信,而我们的公司代理(squid-cache) 不支持HTTP / 2.0。
Now we have to see if we can get a list of IP Addresses for the Firestore and associated services/domains so that we can bypass the Proxy for those Addresses. 现在,我们必须查看是否可以获取Firestore和相关服务/域的IP地址列表,以便我们可以绕过这些地址的代理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.