【问题标题】:Getting io.grpc.StatusException from Firebase Firestore从 Firebase Firestore 获取 io.grpc.StatusException
【发布时间】:2018-07-17 10:39:11
【问题描述】:

我经常从 Firestore 中得到这个运行时异常。下面我附上了堆栈跟踪。我正在使用:

com.google.firebase:firebase-firestore:17.0.1

 Caused by io.grpc.StatusException: DEADLINE_EXCEEDED: The datastore operation timed out, or the data was temporarily unavailable. 
at io.grpc.Status.asException(SourceFile:534) 
at com.google.firebase.firestore.g.zzs.zza(SourceFile:98) 
at com.google.firebase.firestore.b.zzd.zza(SourceFile:122)
at com.google.firebase.firestore.b.zzab.zza(SourceFile:321) 
at com.google.firebase.firestore.b.zzf.zza(SourceFile:236) 
at com.google.firebase.firestore.f.zzo.zza(SourceFile:6527) 
at com.google.firebase.firestore.f.zzv.zzb(SourceFile:2089) 
at com.google.firebase.firestore.f.zza$zzb.zza(SourceFile:73)
at com.google.firebase.firestore.g.zzm$1.onMessage(SourceFile:77) 
at io.grpc.ForwardingClientCallListener.onMessage(SourceFile:36) 
at io.grpc.ForwardingClientCallListener.onMessage(SourceFile:36) 
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(SourceFile:498)
at io.grpc.internal.ContextRunnable.run(SourceFile:37) 
at io.grpc.internal.SerializingExecutor.run(SourceFile:123) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
at com.google.firebase.firestore.g.zza$zza.run(SourceFile:190) at java.lang.Thread.run(Thread.java:818)

我不确定,但我认为当我在 firestore 的 onComplete 回调中调用 task.getResult() 时会收到此异常。 Collection() 方法。

【问题讨论】:

标签: java android firebase google-cloud-firestore


【解决方案1】:

试着检查一下。如果您没有登录您的APP,请尝试将读取设置为TRUE Firestore Rule Setting

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
    }
  }
}

【讨论】:

  • 我收到这个错误是因为我在调用 task.getResult() 之前没有检查 task.isSuccessful() 吗?
  • 嘿@saurabhlahoti,你找到答案了吗?
  • 是的 .. 发生这种情况是因为我的应用中有多个 firebase 项目,而我没有提供正确的项目 ID 来访问特定的 firestore
猜你喜欢
  • 2018-11-06
  • 1970-01-01
  • 2020-02-02
  • 2019-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多