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 — Subscription.pull() fails with KeyError · Issue #899 · googleapis/google-cloud-python

Subscription.pull() fails with KeyError #899

New issue
Copy link
New issue
Copy link
Closed
#901
Closed
Subscription.pull() fails with KeyError#899
#901
Copy link
Assignees
tseaver
Labels
api: pubsubIssues related to the Pub/Sub API.

Description

@campoy
campoy
opened on May 27, 2015
Issue body actions

Hi,

My code below fails with a KeyError coming from the library:

  sub = Subscription(SUBSCRIPTION_NAME, Topic(INCOMING_TOPIC_NAME))

  while True:
    try:
      msgs = sub.pull()
      ...
    except:
      msg = 'poll %s: %s' % (SUBSCRIPTION_NAME, traceback.format_exc())
      print msg

Fails with the message:

poll extractors: Traceback (most recent call last):
  File "main.py", line 46, in main
    msgs = sub.pull()
  File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/subscription.py", line 176, in pull
    for info in response['receivedMessages']]
KeyError: 'receivedMessages'

This seems like a bug on the pubsub library code.

Activity

  1. dhermes commented on May 27, 2015

    @dhermes
    dhermes
    on May 27, 2015
    Contributor
    More actions

    Indeed it does! Thanks @campoy for filing.

    I'm wondering how to reproduce a response without that key, but an easy "fix" (for us) is to just use

    response.get('receivedMessages', ())
  2. tseaver
    added
    api: pubsubIssues related to the Pub/Sub API.
    on May 27, 2015
  3. tseaver commented on May 27, 2015

    @tseaver
    tseaver
    on May 27, 2015
    Contributor
    More actions

    FWIW: this is the hardening I mentioned in #893.

  4. tseaver
    self-assigned this
    on May 29, 2015
  5. tseaver
    closed this as completedin #901on May 29, 2015
  6. tseaver
    added a commit that references this issue on May 29, 2015

    Merge pull request #901 from tseaver/899-pubsub-subscription_pull_wo_…

    c28fce8
  7. atulep
    added 2 commits that reference this issue on Apr 6, 2023

    Speech version bump [(#899)](GoogleCloudPlatform/python-docs-samples#899

    6d2a1d4

    Speech version bump [(#899)](GoogleCloudPlatform/python-docs-samples#899

    8c12ac6
  8. atulep
    added a commit that references this issue on Apr 18, 2023

    Speech version bump [(#899)](GoogleCloudPlatform/python-docs-samples#899

    4faf346
  9. parthea
    added a commit that references this issue on Oct 22, 2023

    Speech version bump [(#899)](GoogleCloudPlatform/python-docs-samples#899

    a473130
  10. gcf-owl-bot
    added a commit that references this issue on Apr 30, 2024

    feat: Update Compute Engine API to revision 20240421 (#899)

    259b953
  11. parthea
    added a commit that references this issue on May 11, 2024

    feat: [google-cloud-compute] Update Compute Engine API to revision 20…

    f515bc6
  12. parthea
    added a commit that references this issue on Aug 21, 2025

    chore: Update gapic-generator-python to v1.23.2 (#899)

    ce38f84
  13. parthea
    added a commit that references this issue on Sep 16, 2025

    chore: Update gapic-generator-python to v1.23.2 (#899)

    89aefd3
  14. parthea
    added 4 commits that reference this issue on Nov 22, 2025

    fix: add lock to flow control (#899)

    d4da10a

    chore: release 0.48.0 (#899)

    93b5a9c

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

    4bcd16f

    docs: Allow 14 week backup retention for Firestore daily backups (#899)

    e50126b
  15. parthea
    added 4 commits that reference this issue on Mar 2, 2026

    ci: use python 3.8 for pubsublite samples testing (#899)

    09dbe50

    chore(deps): update dependency numpy to v1.21.2 (#899)

    49b684d

    chore(deps): update dependency google-cloud-storage to v2.6.0 (#899)

    36bd973

    feat: Leader Aware Routing (#899)

    8e50351
  16. parthea
    added a commit that references this issue on Sep 8, 2026

    docs: migrate code from googleapis/python-bigquery (#18303)

    23f9a74
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.