Assigned
Status Update
Comments
va...@google.com <va...@google.com>
je...@google.com <je...@google.com> #2
Hello,
Thank you for reaching out.
This issue was forwarded to our product team. Please keep in mind that this issue has to be analyzed and considered by the product team and I can't provide you ETA for it to be delivered. However, you can keep track of the status by following this thread.
Kind Regards
je...@google.com <je...@google.com> #3
Is there any update on this issue?
Description
Details:
Service Environment: FastAPI service running on a production server.
Problem: The API sometimes returns authentication errors. The issue is inconsistent but appears only in the production environment.
Working Conditions: The same service account JSON file works without issues on localhost and dev servers.
Troubleshooting Steps Taken:
Verified that the service account JSON file is correctly configured.
Attempted to resolve the issue by creating multiple service accounts, but the problem persists.
Error Traceback:
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen
File "<frozen jpocr.card_processing>", line 261, in __call__
File "<frozen myocr.visionocr>", line 42, in extract_text_google
File "/home/myocr_env/lib/python3.10/site-packages/google/cloud/vision_helpers/decorators.py", line 112, in inner
response = self.annotate_image(
File "/home/myocr_env/lib/python3.10/site-packages/google/cloud/vision_helpers/__init__.py", line 76, in annotate_image
r = self.batch_annotate_images(
File "/home/myocr_env/lib/python3.10/site-packages/google/cloud/vision_v1/services/image_annotator/client.py", line 566, in batch_annotate_images
response = rpc(
File "/home/myocr_env/lib/python3.10/site-packages/google/api_core/gapic_v1/method.py", line 131, in __call__
return wrapped_func(*args, **kwargs)
File "/home/myocr_env/lib/python3.10/site-packages/google/api_core/grpc_helpers.py", line 81, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.ServiceUnavailable: 503 failed to connect to all addresses; last error: UNKNOWN: ipv4:
2024-08-18 07:16:35,315 - uvicorn - ERROR - Response Message: 401 Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See
18
Additional Context:
The issue only occurs intermittently and exclusively in the production environment.
I have validated that the service account credentials and API configurations are correct.
Network issues have been ruled out as the server is capable of making other network requests reliably.