googleapis / python-analytics-data

This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-analytics-data
Apache License 2.0
159 stars 36 forks source link

504 Deadline Exceeded RPC errors #340

Closed robflaherty closed 1 year ago

robflaherty commented 1 year ago

I've been using this library for months without any problems but now the server calls have become unresponsive. I'm not 100% sure but I think it may have started after upgrading my Mac OS to Ventura.

I've tried different versions of Python, different service accounts, and just using the Hello World sample code from the GA4 docs and nothing works.

When I use the Node JS library for the analytics API, I get a response but it hangs after the response and never closes. That suggests to me it's a problem with a lower level API (?) but I don't know how to debug that.

If anyone has any ideas or can point me in a direction it would be much appreciated!

Mac OS, Ventura 13.2, Intel processor

Traceback (most recent call last):
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 72, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/grpc/_channel.py", line 946, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.DEADLINE_EXCEEDED
    details = "Deadline Exceeded"
    debug_error_string = "UNKNOWN:Deadline Exceeded {grpc_status:4, created_time:"2023-02-08T21:24:02.080488-05:00"}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/robflaherty/Code/ga4-test/test.py", line 36, in <module>
    sample_run_report()
  File "/Users/robflaherty/Code/ga4-test/test.py", line 30, in sample_run_report
    response = client.run_report(request)
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/google/analytics/data_v1beta/services/beta_analytics_data/client.py", line 518, in run_report
    response = rpc(
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py", line 113, in __call__
    return wrapped_func(*args, **kwargs)
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/google/api_core/timeout.py", line 120, in func_with_timeout
    return func(*args, **kwargs)
  File "/Users/robflaherty/Code/ga4-test/venv/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 74, in error_remapped_callable
    raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.DeadlineExceeded: 504 Deadline Exceeded
Package                  Version
------------------------ ---------
cachetools               5.3.0
certifi                  2022.12.7
charset-normalizer       3.0.1
google-analytics-data    0.16.1
google-api-core          2.11.0
google-auth              2.16.0
googleapis-common-protos 1.58.0
grpcio                   1.51.1
grpcio-status            1.51.1
idna                     3.4
pip                      20.1.1
proto-plus               1.22.2
protobuf                 4.21.12
pyasn1                   0.4.8
pyasn1-modules           0.2.8
requests                 2.28.2
rsa                      4.9
setuptools               47.1.0
six                      1.16.0
urllib3                  1.26.14
robflaherty commented 1 year ago

After a few weeks of this it appears to have resolved itself in the last hour. 🤷‍♂️

Edit: it worked briefly but is now erroring again. This has to be a service issue with the API or a problem with my network.