firebase / firebase-admin-python

Firebase Admin Python SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
988 stars 300 forks source link

Call to Firestore getting timed out from the docker container. #776

Open Shubham-Garg20 opened 3 months ago

Shubham-Garg20 commented 3 months ago

I'm facing an issue while creating a single record in the Google Firestore document from the docker, whereas the same code works fine in my local.

Below is the error I am getting:

2024-03-06 08:44:30,390 [google.auth.transport.requests|365|140737231338496|Thread-1] | requests.py:__call__:185 (DEBUG) - Making request: POST https://oauth2.googleapis.com/token
2024-03-06 14:15:29 Traceback (most recent call last):
2024-03-06 14:15:29   File "/usr/local/bin/gunicorn", line 8, in <module>
2024-03-06 14:15:29     sys.exit(run())
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
2024-03-06 14:15:29     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 236, in run
2024-03-06 14:15:29     super().run()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 72, in run
2024-03-06 14:15:29     Arbiter(self).run()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 58, in __init__
2024-03-06 14:15:29     self.setup(app)
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 118, in setup
2024-03-06 14:15:29     self.app.wsgi()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2024-03-06 14:15:29     self.callable = self.load()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2024-03-06 14:15:29     return self.load_wsgiapp()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2024-03-06 14:15:29     return util.import_app(self.app_uri)
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
2024-03-06 14:15:29     mod = importlib.import_module(module)
2024-03-06 14:15:29   File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
2024-03-06 14:15:29     return _bootstrap._gcd_import(name[level:], package, level)
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
2024-03-06 14:15:29   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
2024-03-06 14:15:29   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/__init__.py", line 4, in <module>
2024-03-06 14:15:29     from . import api  # noqa: E402
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/api/__init__.py", line 1, in <module>
2024-03-06 14:15:29     from . import resources
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/api/resources/__init__.py", line 1, in <module>
2024-03-06 14:15:29     from . import acm_client, acm_server, topic_management
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/api/resources/acm_client.py", line 6, in <module>
2024-03-06 14:15:29     from async_client_messaging_app.db import firestore
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/db/firestore.py", line 5, in <module>
2024-03-06 14:15:29     from async_client_messaging_app import app
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/app.py", line 21, in <module>
2024-03-06 14:15:29     firebase_app.initialize_firebase()
2024-03-06 14:15:29   File "/a360/async_client_messaging_api/src/async_client_messaging_app/settings/firebase_manager.py", line 54, in initialize_firebase
2024-03-06 14:15:29     doc_ref.set({"first": "Ada", "last": "Lovelace", "born": 1815})
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/cloud/firestore_v1/document.py", line 167, in set
2024-03-06 14:15:29     write_results = batch.commit(**kwargs)
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/cloud/firestore_v1/batch.py", line 59, in commit
2024-03-06 14:15:29     commit_response = self._client._firestore_api.commit(
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/cloud/firestore_v1/services/firestore/client.py", line 1371, in commit
2024-03-06 14:15:29     response = rpc(
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py", line 131, in __call__
2024-03-06 14:15:29     return wrapped_func(*args, **kwargs)
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/retry/retry_unary.py", line 293, in retry_wrapped_func
2024-03-06 14:15:29     return retry_target(
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/retry/retry_unary.py", line 153, in retry_target
2024-03-06 14:15:29     _retry_error_helper(
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/retry/retry_base.py", line 212, in _retry_error_helper
2024-03-06 14:15:29     raise final_exc from source_exc
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/retry/retry_unary.py", line 144, in retry_target
2024-03-06 14:15:29     result = target()
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/timeout.py", line 120, in func_with_timeout
2024-03-06 14:15:29     return func(*args, **kwargs)
2024-03-06 14:15:29   File "/usr/local/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable
2024-03-06 14:15:29     raise exceptions.from_grpc_error(exc) from exc
2024-03-06 14:15:29 google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded

Any leads for fixing this would be appreciated?

google-oss-bot commented 3 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.