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 — Error passing 'fields' to pubsub GET API for subscription · Issue #799 · googleapis/google-cloud-python

Error passing 'fields' to pubsub GET API for subscription #799

New issue
Copy link
New issue
Copy link
Closed
Closed
Error passing 'fields' to pubsub GET API for subscription#799
Copy link
Assignees
tseaver
Labels
api: pubsubIssues related to the Pub/Sub API.

Description

@tseaver
tseaver
opened on Apr 6, 2015
Issue body actions
$ tox -e regression --notest
GLOB sdist-make: /home/tseaver/projects/agendaless/Google/src/gcloud-python/setup.py
regression inst-nodeps: /home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/dist/gcloud-0.4.3.zip
___________________________________ summary ____________________________________
  regression: skipped tests
  congratulations :)
$ .tox/regression/bin/python regression/run_regression.py --package=pubsub
test_create_subscription (pubsub.TestPubsub) ... ERROR
test_create_topic (pubsub.TestPubsub) ... ok
test_list_subscriptions (pubsub.TestPubsub) ... ok
test_list_topics (pubsub.TestPubsub) ... ok
test_message_pull_mode_e2e (pubsub.TestPubsub) ... ERROR

ERROR: test_create_subscription (pubsub.TestPubsub)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/regression/pubsub.py", line 74, in test_create_subscription
    self.assertFalse(subscription.exists())
  File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/regression/lib/python2.7/site-packages/gcloud/pubsub/subscription.py", line 112, in exists
    query_params={'fields': 'name'})
  File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/regression/lib/python2.7/site-packages/gcloud/connection.py", line 293, in api_request
    raise make_exception(response, content)
gcloud.exceptions.BadRequest: 400 Invalid JSON payload received. Unknown name "fields": Cannot bind query parameter.

I omitted a similar failure in another test: both are for a call to subscription.exists() where the expected value is False.

@dhermes this is the one I was working around in #794

@jgeewax maybe tag w/ "google bug"?

Activity

Next
  1. tseaver
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Apr 6, 2015
  2. dhermes commented on Apr 6, 2015

    @dhermes
    dhermes
    on Apr 6, 2015
    Contributor
    More actions

    Whoa! @tmatsuo note that fields is in the discovery doc, but does not actually work when used.

    @tseaver Shall we "fix" be re-implementing your previous commit? (PS Good thing exception handling is finally working the way we want :))

  3. tseaver commented on Apr 6, 2015

    @tseaver
    tseaver
    on Apr 6, 2015
    ContributorAuthor
    More actions

    Caused breakage in regression tests on master:

    https://travis-ci.org/GoogleCloudPlatform/gcloud-python/builds/57382647

    Interestingly, the second failure I saw does not appear there. #heisenbug

  4. tseaver commented on Apr 6, 2015

    @tseaver
    tseaver
    on Apr 6, 2015
    ContributorAuthor
    More actions

    It would be nice to have confirmation that fields is not expected to be passed for non-existing subscriptions. @tmatsuo can you comment?

  5. tmatsuo commented on Apr 6, 2015

    @tmatsuo
    tmatsuo
    on Apr 6, 2015
    Contributor
    More actions

    Actually it is the first time I'm aware of the fields query parameter.
    @tseaver
    Let me confirm, does this succeed with existing subscription, and fail with non-existing subscriptions?

  6. tseaver commented on Apr 6, 2015

    @tseaver
    tseaver
    on Apr 6, 2015
    ContributorAuthor
    More actions

    @tmatsuo I just tweaked our regression test to avoid the call for non-existing subscription, and saw the same failure for an existing subscription.

  7. tmatsuo commented on Apr 6, 2015

    @tmatsuo
    tmatsuo
    on Apr 6, 2015
    Contributor
    More actions

    I think this is a bug within the new API infrastructure. I'll file a bug internally.

  8. tseaver commented on Apr 6, 2015

    @tseaver
    tseaver
    on Apr 6, 2015
    ContributorAuthor
    More actions

    I can provoke the 400 by supplying name in the fields input on the try it page

  9. tmatsuo commented on Apr 6, 2015

    @tmatsuo
    tmatsuo
    on Apr 6, 2015
    Contributor
    More actions

    Thanks! Filed a bug with an id: 20091445 internally

  10. tmatsuo commented on Apr 6, 2015

    @tmatsuo
    tmatsuo
    on Apr 6, 2015
    Contributor
    More actions

    I got a response.

    """
    Could you try "$fields" instead?
    """

    Actually I don't like the answer, but could you try it as suggested, just to see if it works?

  11. tseaver
    closed this as completedin bafb197on Apr 7, 2015
  12. dhermes
    reopened this on Apr 7, 2015
  13. tseaver commented on Apr 7, 2015

    @tseaver
    tseaver
    on Apr 7, 2015
    ContributorAuthor
    More actions

    Using {"$fields": "name"} as query_params prevents the 400.

  14. tmatsuo commented on Apr 7, 2015

    @tmatsuo
    tmatsuo
    on Apr 7, 2015
    Contributor
    More actions

    Thanks for confirming.

    JFYI, if the fields -> $fields change is an official thing, we still need to fix bunch of things.

    • API explorer shows "fields" query param and there is no way to override it.
    • Documentations need to be updated
      • https://developers.google.com/discovery/v1/using
      • https://developers.google.com/discovery/v1/parameters

    Do you have any opinions about it?

  15. dhermes commented on Apr 7, 2015

    @dhermes
    dhermes
    on Apr 7, 2015
    Contributor
    More actions
    • It seems like a fix of something that wasn't broken.
    • The discovery document still says fields:
    "fields": {
     "type": "string",
     "description": "Selector specifying which fields to include in a partial response.",
     "location": "query"
    },
    • Does the APIs Explorer even have an owner?
    • Note that @tseaver said the API accepted fields when the subscription existed and $fields when it did not.
  16. 8 remaining items

  17. dhermes commented on Aug 28, 2015

    @dhermes
    dhermes
    on Aug 28, 2015
    Contributor
    More actions

    Closing this. Will re-open if it matters to us.

    The pub/sub folks shouldn't break users expectations though 😀

  18. dhermes
    closed this as completedon Aug 28, 2015
  19. JustinBeckwith
    assigned
    tseaver
    on Feb 1, 2021
  20. parthea
    added a commit that references this issue on Oct 21, 2023

    move monitoring samples from python-docs-samples (#51)

    d95f563
  21. parthea
    added 7 commits that reference this issue on Nov 24, 2025

    chore(deps): update dependency protobuf to v3.15.4 (#799)

    def4cac

    build: use mypy<1.15.0 until #799 is fixed (#800)

    8cc7ba1

    build: Add presubmits for Python 3.14 pre-release (#786)

    ce0ef43

    chore(main): release 2.14.0 (#799)

    9ade2c1

    chore(main): release 3.9.0 (#799)

    37c362f

    chore(python): exclude setup.py in renovate config (#799)

    6d052b5

    chore(main): release 3.9.0 (#799)

    c9baa95
  22. parthea
    added 4 commits that reference this issue on Mar 2, 2026

    chore(main): release 2.13.10 (#799)

    b3fb4e1

    fix: use a larger chunk size when loading data (#799)

    f99a2ef

    chore: exclude last_update from the THEN RETURN clause (#799)

    c22c93a

    chore: pin protobuf (#799)

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: pubsubIssues related to the Pub/Sub 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.