.net - grpc中的.net Google.Cloud.Firestore名称解析错误
问题描述
我的后端在尝试访问云 Firestore 集合时失败。我使用 nuget 包 Google.Cloud.Firestore(当前为 1.0.0-beta20)。错误说
Grpc.Core.RpcException: Status(StatusCode=Unavailable, Detail="Name resolution failure")
我的代码是
public async Task PushAppointment(CcAppointment appointment)
{
var fireStoreDb = await FirestoreDb.CreateAsync("peakplan-fb-mobile");
var docRef = fireStoreDb.Collection("appointments");
await docRef.AddAsync(appointment);
}
Google Credentials JSON env var 已正确设置和加载。
我在异常消息之前得到这些日志:
D0530 02:26:56.253562 Grpc.Core.Internal.UnmanagedLibrary Attempting to load native library "/Users/gabrielwahle/.nuget/packages/grpc.core/1.19.0/lib/netstandard1.5/../../runtimes/osx/native/libgrpc_csharp_ext.x64.dylib"
D0530 02:26:56.347160 Grpc.Core.Internal.NativeExtension gRPC native library loaded successfully.
使用这些日志设置:
Environment.SetEnvironmentVariable("GRPC_TRACE", "api,cares_resolver,cares_address_sorting");
Environment.SetEnvironmentVariable("GRPC_VERBOSITY", "debug");
有没有人处理过这个错误?
解决方案
推荐阅读
- php - 如何在最后一个数组值之后加入字符串?
- javascript - 在不破坏我的代码的情况下删除一个函数
- python - 无法从内存中清除大量数据
- python - 用于提取特定变量和值的正则表达式
- android - 如何从 Firebase 创建 Java 对象
- git - Git:当用户连接到 git 时在服务器上运行脚本
- c# - 使用 EF6 存储数据时出现“不允许从数据类型 nvarchar(max) 到 varbinary 的隐式转换”错误
- java - Selenium Java-空值的文本字段验证和日期验证
- html - 如何将背景颜色固定到标题?
- bash - 使用 bash 变量作为文件参数