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

Saving large values to indexed properties raises _Rendezvous exception #2422

Closed
Bogdanp opened this issue Sep 26, 2016 · 1 comment
Closed
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@Bogdanp
Copy link

Bogdanp commented Sep 26, 2016

Given this code:

from google.cloud import datastore
from google.cloud.datastore import Entity

client = datastore.Client()
with client.transaction() as xact:
    e = Entity(client.key("Test", "123"))
    e.update({"x": "a" * 1500000})
    xact.put(e)

version 0.19 of this library raises the following exception on .put:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    xact.put(e)
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/google/cloud/datastore/batch.py", line 302, in __exit__
    self.commit()
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/google/cloud/datastore/transaction.py", line 167, in commit
    super(Transaction, self).commit()
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/google/cloud/datastore/batch.py", line 274, in commit
    self._commit()
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/google/cloud/datastore/batch.py", line 251, in _commit
    self.project, self._commit_request, self._id)
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/google/cloud/datastore/connection.py", line 584, in commit
    response = self._datastore_api.commit(project, request)
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/google/cloud/datastore/connection.py", line 314, in commit
    return self._stub.Commit(request_pb)
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/grpc/_channel.py", line 481, in __call__
    return _end_unary_response_blocking(state, False, deadline)
  File "/Users/bogdan/.virtualenvs/bread/lib/python2.7/site-packages/grpc/_channel.py", line 432, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.INVALID_ARGUMENT, The value of property "x" is longer than 1048487 bytes.)>

Previously, this used to raise gcloud.exceptions.BadRequest. It seems like this exception should be caught by the library and a more appropriate one should be raised in its stead.

EDIT: It turns out the following snippet has the same issue so this is not transaction specific:

from google.cloud import datastore
from google.cloud.datastore import Entity

client = datastore.Client()
e = Entity(client.key("Test", "123"))
e.update({"x": "a" * 1500000})
client.put(e)

EDIT 2: This does not work either, raising the same exception:

from google.cloud import datastore
from google.cloud.datastore import Entity

client = datastore.Client()
e = Entity(client.key("Test", "123"), exclude_from_indexes=("x",))
e.update({"x": "a" * 1500000})
client.put(e)
@Bogdanp Bogdanp changed the title Saving large values to indexed properties inside transactions raises _Rendezvous exception Saving large values to indexed properties raises _Rendezvous exception Sep 26, 2016
@dhermes dhermes self-assigned this Sep 26, 2016
@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Sep 26, 2016
@dhermes
Copy link
Contributor

dhermes commented Sep 26, 2016

@Bogdanp Thanks for the heads up. We currently just have an ad-hoc translation for such errors, so it's kind of a "wait and see".

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.
Projects
None yet
Development

No branches or pull requests

2 participants