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 — make_exception fails when json.loads fails · Issue #626 · googleapis/google-cloud-python

make_exception fails when json.loads fails #626

New issue
Copy link
New issue
Copy link
Closed
#628
Closed
make_exception fails when json.loads fails#626
#628
Copy link
Assignees
dhermes
Labels
api: coreapi: datastoreIssues related to the Datastore API.

Description

@dhermes
dhermes
opened on Feb 12, 2015
Issue body actions

See report from @pdknsk

Activity

  1. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    api: core
    on Feb 12, 2015
  2. dhermes
    added this to the This milestone has been deleted milestone on Feb 12, 2015
  3. dhermes commented on Feb 12, 2015

    @dhermes
    dhermes
    on Feb 12, 2015
    ContributorAuthor
    More actions

    @pdknsk Can you execute this code and give the output:

    from gcloud import datastore
    from gcloud.datastore import _datastore_v1_pb2 as datastore_pb
    
    datastore.set_defaults()
    
    # Create whatever entity you used with datastore.put([...]) in your
    # stacktrace
    
    batch = datastore.Batch()
    batch.put(entity)
    
    request_pb = datastore_pb.CommitRequest()
    request_pb.mode = datastore_pb.CommitRequest.NON_TRANSACTIONAL
    request_pb.mutation.CopyFrom(batch.mutation)
    
    data = request_pb.SerializeToString()
    
    headers = {
        'Content-Type': 'application/x-protobuf',
        'Content-Length': str(len(data)),
        'User-Agent': 'gcloud/0.4.0-bug-test',
    }
    
    api_url = batch.connection.build_api_url(
        dataset_id=batch.dataset_id, method='commit')
    
    new_headers, content = batch.connection.http.request(
        uri=api_url, method='POST', headers=headers, body=data)
    
    print 'new_headers:'
    print new_headers
    
    print 'content:'
    print content
  4. dhermes commented on Feb 12, 2015

    @dhermes
    dhermes
    on Feb 12, 2015
    ContributorAuthor
    More actions

    Either that or you could just provide the could you used to create the entity that caused the failure and I can handle from there.

  5. pdknsk commented on Feb 12, 2015

    @pdknsk
    pdknsk
    on Feb 12, 2015
    More actions
    >>> print new_headers
    {'status': '400', 'alternate-protocol': '443:quic,p=0.08', 'content-length': '24', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'expires': 'Thu, 12 Feb 2015 23:42:34 GMT', 'vary': 'Origin, X-Origin', 'server': 'GSE', '-content-encoding': 'gzip', 'cache-control': 'private, max-age=0', 'date': 'Thu, 12 Feb 2015 23:42:34 GMT', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'text/html; charset=UTF-8'}
    >>> print content
    Entity value is indexed.
  6. dhermes commented on Feb 12, 2015

    @dhermes
    dhermes
    on Feb 12, 2015
    ContributorAuthor
    More actions

    OK that's simple to fix.

    Thanks.

  7. dhermes
    added a commit that references this issue on Feb 13, 2015

    Making json.loads() optional in gcloud.exceptions.make_exception.

    This issue will close once commit c3e1351 is merged into the 'master' branch.
    c3e1351
  8. dhermes
    closed this as completedin #628on Feb 13, 2015
  9. tseaver commented on Feb 13, 2015

    @tseaver
    tseaver
    on Feb 13, 2015
    Contributor
    More actions

    I sure don't know why the backend wouldn't return JSON for its errors (or at least document the error response format).

  10. dhermes commented on Feb 13, 2015

    @dhermes
    dhermes
    on Feb 13, 2015
    ContributorAuthor
    More actions

    Datastore is an RPC service. One might expect it to return proto messages as errors, but not JSON.

  11. tseaver commented on Feb 13, 2015

    @tseaver
    tseaver
    on Feb 13, 2015
    Contributor
    More actions

    Documenting what it returns (status codes, body format) is more important than the specific format.

  12. JustinBeckwith
    assigned
    dhermes
    on Feb 1, 2021
  13. vchudnov-g
    added a commit that references this issue on Sep 20, 2023

    chore(deps): update dependency google-cloud-dialogflow to v2.20.0 (#626)

    23cd3e7
  14. parthea
    added a commit that references this issue on Aug 21, 2025

    chore(deps): update dependency ipywidgets to v8.1.0 (#626)

    2fbecbd
  15. parthea
    added a commit that references this issue on Sep 16, 2025

    chore(deps): update dependency ipywidgets to v8.1.0 (#626)

    139f0fa
  16. parthea
    added 5 commits that reference this issue on Nov 22, 2025

    chore(deps): update all dependencies (#626)

    3364c3c

    fix: fix typo attribue -> attribute (#627)

    447ab18

    fix(deps): Require proto-plus >= 1.22.3 (#626)

    bf0a84e

    fix: avoid losing the original '_include_email' parameter in imperson…

    b49b868

    chore: release 1.24.0 (#656)

    a4c7d60
  17. parthea
    added 7 commits that reference this issue on Mar 2, 2026

    fix: process ErrorInfo / GRPC errors for ack/modack only when exactly…

    a04f8e0

    feat: Extended DB API parameter syntax to optionally provide paramete…

    4ccdac4

    chore: release 2.15.0 (#637)

    bc6ddef

    ci: add build for docfx and refactor settings for unit tests (#626)

    6f28ef3

    chore(deps): update dependency googleapis-common-protos to v1.70.0 (#626

    6bfb66a

    samples: add cloud client samples from python-docs-samples (#626)

    2b99c9d

    feat: add support for python 3.10 (#626)

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

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

api: coreapi: 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.