GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — datastore v1beta3 doesn't handle errors properly · Issue #1617 · googleapis/google-cloud-python

datastore v1beta3 doesn't handle errors properly #1617

New issue
Copy link
New issue
Copy link
Closed
Closed
datastore v1beta3 doesn't handle errors properly#1617
Copy link
Assignees
pcostell
Labels
api: datastoreIssues related to the Datastore API.

Description

@pcostell
pcostell
opened on Mar 15, 2016
Issue body actions

In Datastore v1beta3, the error response is a serialized proto message Status. However, the error handling currently tries to decode it, which can fail with a unicode error.


  File "./main.py", line 20, in lookup
    print(client.get(key))
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/datastore/client.py", line 248, in get
    deferred=deferred)
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/datastore/client.py", line 289, in get_multi
    transaction_id=transaction and transaction.id,
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/datastore/client.py", line 122, in _extended_lookup
    transaction_id=transaction_id,
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/datastore/connection.py", line 197, in lookup
    _datastore_pb2.LookupResponse)
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/datastore/connection.py", line 115, in _rpc
    data=request_pb.SerializeToString())
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/datastore/connection.py", line 92, in _request
    raise make_exception(headers, content, use_json=False)
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/src/gcloud/gcloud/exceptions.py", line 181, in make_exception
    content = content.decode('utf-8')
  File "/Users/pcostello/.local/virtualenvs/gcloud-permissions-v1beta3/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa8 in position 20: invalid start byte

Activity

  1. pcostell commented on Mar 15, 2016

    @pcostell
    pcostell
    on Mar 15, 2016
    ContributorAuthor
    More actions

    I attached #1618 which shows what the expected response is. I can updated it and submit it if you want, but it's just a hack to show the issue.

  2. dhermes commented on Mar 16, 2016

    @dhermes
    dhermes
    on Mar 16, 2016
    Contributor
    More actions

    Thanks @pcostell. We discussed this in #1466 and I added it as a TODO in #1288 but hadn't gotten to it yet.

    Some good news is that googleapis-common-protos actually includes status_pb2 so we don't have to do anything extra to get it.

  3. pcostell commented on Mar 16, 2016

    @pcostell
    pcostell
    on Mar 16, 2016
    ContributorAuthor
    More actions

    Ah I totally forgot. It seems potentially more important than I realized since now users will fail with utf-8 decoding issues with no indication of the actual error.

  4. dhermes commented on Mar 16, 2016

    @dhermes
    dhermes
    on Mar 16, 2016
    Contributor
    More actions

    Yes. When reporting an error causes an error, that's a problem

  5. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    on Mar 18, 2016
  6. pcostell commented on Mar 29, 2016

    @pcostell
    pcostell
    on Mar 29, 2016
    ContributorAuthor
    More actions

    Fixed by #1638

  7. pcostell
    closed this as completedon Mar 29, 2016
  8. JustinBeckwith
    assigned
    pcostell
    on Feb 1, 2021
  9. parthea
    added a commit that references this issue on Nov 26, 2025

    fix: update secret (#1617)

    0cb82bf
  10. parthea
    added a commit that references this issue on Mar 9, 2026

    feat(zb-experimental): implement state_lookup (#1617)

    b10ea23
  11. parthea
    added a commit that references this issue on Apr 1, 2026

    feat: Support write api as loading option (#1617)

    6186eaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pcostell
    pcostell

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.