0

I have a fastAPI api hosted on appengine. it makes calls to firestore using firestore client. Sometimes, some (1 out of 50) of the calls fail with this error:

NB: I use latest version of grpcio, grpcio-tools and google-cloud-firestore.

AttributeError: 'NoneType' object has no attribute 'from_call'

at ._parse_grpc_error_details ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/api_core/exceptions.py:553 )
at .from_grpc_error ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/api_core/exceptions.py:605 )
at .error_remapped_callable ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/api_core/grpc_helpers.py:144 )
at .retry_target ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/api_core/retry.py:190 )
at .retry_wrapped_func ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/api_core/retry.py:288 )
at .__call__ ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py:154 )
at .batch_get_documents ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/services/firestore/client.py:870 )
at .get ( /layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/document.py:406 )
firsni
  • 856
  • 6
  • 12
  • I posted an answer, is it helpful. – Sandeep Vokkareni Aug 26 '22 at 13:39
  • your answer describes the error but doesn't help me solving it – firsni Aug 26 '22 at 15:28
  • As there is minimal information so i shared possibilities of error. If you can share the code, it means it will help to debug, or if you don't like to share due to security issues then you can reach out to the support team. Meanwhile you can check with the [document1](https://blog.finxter.com/fixed-attributeerror-nonetype-object-has-no-attribute-something/) and [document2](https://www.pythonpool.com/attributeerror-nonetype-object-has-no-attribute-group-solved/) where there are different scenarios and different solutions. – Sandeep Vokkareni Aug 29 '22 at 05:54

1 Answers1

0

"AttributeError: 'NoneType' object has no attribute 'from_calll’”

Is a python error when you are trying to invoke a method in this case from_call over a None object.

An AttributeError is raised in Python when you attempt to call the attribute of an object whose type does not support the method.

There are different reasons which can cause “AttributeError: 'NoneType' object has no attribute 'something'” in this document.

You can check with the documentation and Stackoverflow link for more insights on the issue.

I’m not sure which version of cloud firestore you are using but have a look on the cloud firestore version and the latest version is 2.6.1 which is compatible with python 3.7 onwards