下記記事でやっていた処理だけど、寝る前に実行して、朝起きるころ見るとエラーを吐いて止まっている。
まだ解決してないけど、メモ。
Raspberry PiでPython3を使ってFirestoreにクエリする - GAミント至上主義
マシンはRaspberry Pi Zero WH。
OSは
pi@raspberrypi:~/led8 $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.9 (stretch)
Release: 9.9
Codename: stretch
関係ありそうなパッケージのバージョンは下記。
firebase-admin==2.17.0
google-api-core==1.13.0
google-api-python-client==1.7.9
google-auth==1.6.3
google-auth-httplib2==0.0.3
google-cloud-core==1.0.2
google-cloud-firestore==1.2.0
google-cloud-storage==1.16.1
google-resumable-media==0.3.2
googleapis-common-protos==1.6.0
googleapis.github.io
エラー出力は下記。
hread-ConsumeBidirectionalStream caught unexpected exception <_Rendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Received RST_STREAM with error code 0"
debug_error_string = "{"created":"@1562627421.743478058","description":"Error received from peer ipv6:[2404:6800$
4004:801::200a]:443","file":"src/core/lib/surface/call.cc","file_line":1046,"grpc_message":"Received RST_STREAM with err$
r code 0","grpc_status":13}"
> and will exit.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/google/api_core/bidi.py", line 633, in _thread_main
response = self._bidi_rpc.recv()
File "/usr/local/lib/python3.5/dist-packages/google/api_core/bidi.py", line 544, in recv
return self._recoverable(self._recv)
File "/usr/local/lib/python3.5/dist-packages/google/api_core/bidi.py", line 503, in _recoverable
raise exc
File "/usr/local/lib/python3.5/dist-packages/google/api_core/bidi.py", line 493, in _recoverable
return method(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/google/api_core/bidi.py", line 541, in _recv
return next(call)
File "/usr/local/lib/python3.5/dist-packages/grpc/_channel.py", line 364, in __next__
return self._next()
File "/usr/local/lib/python3.5/dist-packages/grpc/_channel.py", line 358, in _next
raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Received RST_STREAM with error code 0"
debug_error_string = "{"created":"@1562627421.743478058","description":"Error received from peer ipv6:[2404:6800:
4004:801::200a]:443","file":"src/core/lib/surface/call.cc","file_line":1046,"grpc_message":"Received RST_STREAM with erro
r code 0","grpc_status":13}"
>
Exception in thread Thread-OnRpcTerminated:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.5/dist-packages/google/cloud/firestore_v1/watch.py", line 290, in close
raise reason
google.api_core.exceptions.InternalServerError: 500 Received RST_STREAM with error code 0
検索するとPub/Subなどでも同じようなエラーを出すようで、Firestore特有の問題ではなさそう。
https://github.com/googleapis/google-cloud-python/issues/4234
Threadingを使っているので、簡単にはtryでExceptionを受け取ることができない。