Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datastore: 'ServiceUnavailable: 503 Connect Failed' raised during commit #6121

Closed
maxbellec opened this issue Sep 27, 2018 · 8 comments
Closed
Assignees
Labels
api: datastore Issues related to the Datastore API. backend type: question Request for information or clarification. Not an issue.

Comments

@maxbellec
Copy link

maxbellec commented Sep 27, 2018

During our CI (run by Strider CD in a container), we put some entities on the Datastore. For reasons I don't understand, it often fails (~30% of the time) with a 503 error. Re-testing (relaunching a new container and running the tests) fixes it.
I'm not sure #5410 would fix this issue, since retrying with try/except in the code doesn't solve this.

versions

google-api-core==1.1.1
google-api-python-client==1.6.5
google-auth==1.4.1
google-cloud-core==0.28.1
google-cloud-storage==1.8.0
google-resumable-media==0.3.1
googleapis-common-protos==1.5.3

stacktrace

  File "/home/feeder/lib/database.py", line 213, in db_upsert_multi
    datastore_client.put_multi(entities)  # Commit
  File "/usr/local/lib/python3.6/site-packages/google/cloud/datastore/client.py", line 431, in put_multi
    current.commit()
  File "/usr/local/lib/python3.6/site-packages/google/cloud/datastore/batch.py", line 273, in commit
    self._commit()
  File "/usr/local/lib/python3.6/site-packages/google/cloud/datastore/batch.py", line 249, in _commit
    self.project, mode, self._mutations, transaction=self._id)
  File "/usr/local/lib/python3.6/site-packages/google/cloud/datastore_v1/gapic/datastore_client.py", line 426, in commit
    request, retry=retry, timeout=timeout, metadata=metadata)
  File "/usr/local/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py", line 139, in __call__
    return wrapped_func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/google/api_core/retry.py", line 260, in retry_wrapped_func
    on_error=on_error,
  File "/usr/local/lib/python3.6/site-packages/google/api_core/retry.py", line 177, in retry_target
    return target()
  File "/usr/local/lib/python3.6/site-packages/google/api_core/timeout.py", line 206, in func_with_timeout
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 61, in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "<string>", line 3, in raise_from
google.api_core.exceptions.ServiceUnavailable: 503 Connect Failed
@tseaver tseaver added type: question Request for information or clarification. Not an issue. api: datastore Issues related to the Datastore API. labels Sep 27, 2018
@DowneyTung
Copy link

I have the same issue with google vision api.

@tseaver
Copy link
Contributor

tseaver commented Oct 11, 2018

@maxbellec The traceback shows that the Commit API call was being funneled through the GAPIC retry machinery, but the exception type is not listed as being retryable in datastore_client_config.py: because the Commit method is marked non_idempotent, no exception types can be retried.

@DowneyTung please open a separate issue for the Vision API, showing your own traceback. Apologies: I see that you already opened #6190.

@DowneyTung
Copy link

@tseaver cool..thanks.. :)

@maxbellec
Copy link
Author

@tseaver thank you for looking into my issue. I'm still unsure about why that errors happens quite often in the first place. I'm especially surprised that it happens only in the CI tests, do you have any guess on what I could try?

@tseaver
Copy link
Contributor

tseaver commented Oct 12, 2018

@pcostell Can you suggest why the 503 is being raised from the Datastore API here? Should we be retrying the Commit call in that case?

@tseaver tseaver changed the title Datastore 503 error: google.api_core.exceptions.ServiceUnavailable: 503 Connect Failed Datastore: 'ServiceUnavailable: 503 Connect Failed' raised during commit Oct 18, 2018
@tseaver tseaver added the backend label Dec 5, 2018
@tseaver
Copy link
Contributor

tseaver commented Dec 5, 2018

Needs help from @pcostell or another resource from the back-end Datastore team.

@corradio
Copy link

corradio commented Dec 5, 2018

@maxbellec I think you can close this issue.
I'm working on the same team as @maxbellec and it turns out the error we got was because we were running against an emulator that wasn't fully started.
@tseaver you can also close the issue if needed.

@tseaver
Copy link
Contributor

tseaver commented Dec 5, 2018

@corradio Thanks very much for the follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. backend type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants