Repository navigation
Firestore: what possible cause of this exception: InternalServerError: 500 Received RST_STREAM with error code 0 #282
Copy link
Copy link
Closed
Labels
Description
[READ] Step 1: Are you in the right place?
- For issues or feature requests related to the code in this repository
file a Github issue.- If this is a feature request make sure the issue title starts with "FR:".
- For general technical questions, post a question on StackOverflow
with the firebase tag. - For general Firebase discussion, use the firebase-talk
google group. - For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Operating System version: Ubuntu 18.04 + openerp 7___
- Firebase SDK version: _____
- Library version: _from pip freeze:
firebase-admin==2.16.0 funcsigs==1.0.2 future==0.16.0 futures==3.2.0 gax-google-logging-v2==0.8.3 gax-google-pubsub-v1==0.8.3 gcloud==0.18.3 gdata==2.0.18 google-api-core==1.9.0 google-auth==1.6.3 google-cloud==0.34.0 google-cloud-core==0.29.1 google-cloud-firestore==0.32.1 google-cloud-storage==1.15.0 google-gax==0.16.0 google-resumable-media==0.3.2 googleapis-common-protos==1.5.9 grpc-google-logging-v2==0.11.1 grpc-google-pubsub-v1==0.11.1 - Firebase Product: firestore___ (auth, database, storage, etc)
[REQUIRED] Step 3: Describe the problem
I'm developing a system to store orders into openerp that came from a mobile app.
So I've integrated a firestore listener on a query snapshot on "orders" collection,
BookingAppFirestore.uniqdb.collection('orders') .where('new_order', '==', True) .where('nxscm_order_id', '==', None) .on_snapshot(self.new_orders_on_snapshot)
Sometimes during the executions of my proofs I get this exception when an order is wrote on firestore and is received from the listener.
Steps to reproduce:
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
the exception trace from openerp log system
Exception in thread Thread-OnRpcTerminated:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/nix/Sviluppo/venvs/odoo-dev/local/lib/python2.7/site-packages/google/cloud/firestore_v1/watch.py", line 290, in close
raise reason
InternalServerError: 500 Received RST_STREAM with error code 0
2019-04-26 10:00:50,011 9102 INFO ? google.cloud.firestore_v1.watch: RPC termination has signaled manager shutdown.
2019-04-26 10:00:50,011 9102 ERROR db_dev google.api_core.bidi: Thread-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":"@1556272850.010768238","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1095,"grpc_message":"Received RST_STREAM with error code 0","grpc_status":13}"
> and will exit.
Traceback (most recent call last):
File "/home/nix/Sviluppo/venvs/odoo-dev/local/lib/python2.7/site-packages/google/api_core/bidi.py", line 543, in _thread_main
response = self._bidi_rpc.recv()
File "/home/nix/Sviluppo/venvs/odoo-dev/local/lib/python2.7/site-packages/google/api_core/bidi.py", line 454, in recv
return self._recoverable(self._recv)
File "/home/nix/Sviluppo/venvs/odoo-dev/local/lib/python2.7/site-packages/google/api_core/bidi.py", line 413, in _recoverable
raise exc
_Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Received RST_STREAM with error code 0"
debug_error_string = "{"created":"@1556272850.010768238","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1095,"grpc_message":"Received RST_STREAM with error code 0","grpc_status":13}"
>
2019-04-26 10:00:50,011 9102 INFO db_dev google.api_core.bidi: Thread-ConsumeBidirectionalStream exiting
// TODO(you): code here to reproduce the problem
Reactions are currently unavailable
Activity
google-oss-bot commentedon Apr 26, 2019
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
hiranya911 commentedon Apr 26, 2019
@tseaver @crwilcox do you have any thoughts?
olejl77 commentedon May 1, 2019
I'm also experiencing this issue both on my Kubuntu developer machine and my target platform Raspberry Pi. The problem is that when it happens I don't receive any updates from Firestore anymore.
What would be the proper way of detecting this and recover from it?
tseaver commentedon May 1, 2019
Per the HTTP/2 spec, an
RST_STREAMframe with error codeNO_ERROR(0x0) is a signal from the peer to close the stream gracefully. We should loop in the Firestore back-end folks (summoning @BenWhitehead) to figure out why the server is closing the stream.toby commentedon May 9, 2019
We're also experiencing this issue on several platforms. Are there any hooks to handle the close stream message that the client library users can leverage to attempt a reconnect?
Like @olejl77, we receive no further updates once this error has been thrown.
BenWhitehead commentedon May 9, 2019
@gbonline @olejl77 @toby Can you provide any details about the environment you're running
firebase-admin-pythonfrom? Are you connecting from a GCE/GKE node or from outside GCP?gbonline commentedon May 10, 2019
Hi, my environment is outside GCP: I'm developing a module for Odoo/Openerp v 7.0 which use pyhton 2.7, in a parallels vm where guest so is ubuntu18.04, the vm have a bridged network.
So in ubuntu I installed the firebase-admin-python and build code to manage the connection with the json configuaration file.
then I've a class that it keeps the some query listeners, below is the initialization part.
Usually i start the vm ,start odoo, so my module is running, then I move my attention to develop the mobile app: this app read data from firestore, then write a order to firestore 'orders' collection and this order is received in odoo by the listener.
Sometimes I've the exception, but I don't know when it happens. I read the exception in the odoo log.
the last exception occurred now without any connections
toby commentedon May 10, 2019
Hi @BenWhitehead,
We're using
firebase-admin-pythoninside of Docker and experiencing this issue in the Google Cloud Compute Engine (on a container VM) and on our local development machines.Python version: 3.7.3
pip freeze:
The past three times I've tested, following error occurs exactly 60 minutes after registering for
on_snapshoton a collection:gbonline commentedon May 13, 2019
Hi
I confirm that the exception also happens to me 60 minutes after the subscription on_snapshot to collection
BenWhitehead commentedon May 13, 2019
@gbonline @toby thanks for the details, I'll get back to you when I have more info from the backend team.
BenWhitehead commentedon May 13, 2019
Okay, after checking a few things it looks like this may be related to the GRPC client being used. There is an update to the client that was made several weeks ago. Would it be possible for you to try out the newest version of
google-cloud-firestore1.1.0which was released on May 1st? (Specifically you're wanting to havegrpcioversion1.20.1or newer.)Updating from 0.31.0 you may also need to update some import paths to use the new versions:
google.cloud.firestore_v1beta1->google.cloud.firestore_v1toby commentedon May 13, 2019
@BenWhitehead thank you for looking into this. I've updated the versions of
google-cloud-firestore,grpcioandfirebase-admin(see attachedpip freeze) but unforunately I'm still getting the error after 60 minutes. I've included the most recent stack trace:12 remaining items
BenWhitehead commentedon Dec 6, 2019
Investigative work is being done internally to track down why this is happening and what will be a safe fix to it.
As of right now I believe we have been able to reproduce the behavior with a python code base and are now determining the appropriate fix.
AlphaWong commentedon Dec 16, 2019
same here. the connection dropped after 60 mins
AlphaWong commentedon Dec 16, 2019

here is my log also.requirement
seanpmaddox commentedon Dec 16, 2019
I can confirm we're seeing the exact same issue, in our prototype there are 4 docs being watched which is why there are 4 error streams posted below. We are outside of GCP, running under Python 3.5.3 with the following relevant content from pip freeze
firebase-admin==3.2.0
gcp-devrel-py-tools==0.0.15
google-api-core==1.14.3
google-api-python-client==1.7.8
google-auth==1.6.3
google-auth-httplib2==0.0.3
google-cloud-core==1.0.3
google-cloud-firestore==1.6.0
google-cloud-pubsub==0.40.0
google-cloud-storage==1.23.0
google-resumable-media==0.5.0
googleapis-common-protos==1.6.0
grpc-google-iam-v1==0.11.4
grpcio==1.20.1
Thread-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":"@1576297721.599474431","description":"Error received from peer ipv4:172.217.0.42:443","file":"src/core/lib/surface/call.cc","file_line":1041,"grpc_message":"Received RST_STREAM with error 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
Thread-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":"@1576297721.645791309","description":"Error received from peer ipv4:172.217.0.42:443","file":"src/core/lib/surface/call.cc","file_line":1041,"grpc_message":"Received RST_STREAM with error 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
Thread-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":"@1576297721.674135559","description":"Error received from peer ipv4:172.217.0.42:443","file":"src/core/lib/surface/call.cc","file_line":1041,"grpc_message":"Received RST_STREAM with error 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
Thread-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":"@1576299333.815859727","description":"Error received from peer ipv4:172.217.0.42:443","file":"src/core/lib/surface/call.cc","file_line":1041,"grpc_message":"Received RST_STREAM with error 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
seongkim0228 commentedon Dec 24, 2019
+1
seanpmaddox commentedon Dec 24, 2019
@BenWhitehead Hi Ben - is there an official bug ID or other case for this issue and a site where we're able to see latest status or is this issue logged on github and github the only place for us to keep track of status?
thx - sean
BenWhitehead commentedon Dec 26, 2019
@seanpmaddox Hello, this issue (and the related issues linked to here) are the publicly accessible issues that are available at this time.
Unfortunately we don't yet have a tested & verified solution we're ready to release. We do have some of my Python expert colleagues as well as gRPC experts and folks from the backend team working on coming up with a solution we'll be happy with. There are a few options we're looking at, but due to the length of time it takes to reproduce progress getting the solution to users is slow.
When we have a proposed solution available, it should be linked to this issue so this is a good place to keep an eye on things.
seanpmaddox commentedon Dec 27, 2019
@BenWhitehead thank you Ben. I don't suppose any of the folks will be at CES in a few weeks and will/able to discuss?
Hopeful a solution is identified, tested & verified over the next 3 months so we can avoid going into production with a known issue like this. Our system will have as many as 48 document snapshots on each controller device which is running this API...if each watch has to be restarted every hour that is 1100+ reads per device and it starts to add up quickly when you're talking thousands of devices.
thx - sean
BenWhitehead commentedon Dec 30, 2019
Proposed fix: googleapis/google-cloud-python#9995
BenWhitehead commentedon Dec 30, 2019
@seanpmaddox I won't be at CES, and I'm not sure as to other folks schedules. Per the linked PR above, it seems this has been tracked down to retry config on error codes.
crwilcox commentedon Jan 2, 2020
https://pypi.org/project/google-cloud-firestore/1.6.1/ is released and contains the change to widen retries.
hiranya911 commentedon Jul 31, 2020
Closing this based on the fixes that have been made to the google-cloud-firestore package.
ShreyashAnpat commentedon May 27, 2021
i have facing same problem , jot in to android studio and sign in android studio with same email account . and give the permissions and refresh the database