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 — Pub/Sub empty topic batch fails · Issue #1955 · googleapis/google-cloud-python

Pub/Sub empty topic batch fails #1955

New issue
Copy link
New issue
Copy link
Closed
Closed
Pub/Sub empty topic batch fails#1955
Copy link
Assignees
yoshi-automation
Labels
api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@tcroiset
tcroiset
opened on Jul 4, 2016
Issue body actions
with topic.batch() as batch:
  for obj in rows:
    batch.publish(b'bla')

fails if rows is empty:

Traceback (most recent call last):
…
File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/topic.py", line 420, in exit
self.commit()
File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/topic.py", line 449, in commit
message_ids = api.topic_publish(self.topic.full_name, self.messages[:])
File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/connection.py", line 205, in topic_publish
method='POST', path='/%s:publish' % (topic_path,), data=data)
File "/usr/local/lib/python2.7/dist-packages/gcloud/connection.py", line 344, in api_request
error_info=method + ' ' + url)
BadRequest: 400 The value for message_count is too small. You passed 0 in the request, but the minimum value is 1. (POST https://pubsub.googleapis.com/v1/projects/karos-api/topics/api-prod:publish)

Activity

  1. daspecster
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Jul 4, 2016
  2. tseaver commented on Jul 4, 2016

    @tseaver
    tseaver
    on Jul 4, 2016
    Contributor
    More actions

    Thanks for the report! gcloud.pubsub.topic.Batch.commit should indeed be a no-op if there are no messages accumulated.

  3. daspecster
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jul 4, 2016
  4. daspecster
    added a commit that references this issue on Jul 4, 2016

    Fix pubsub context manager exit error. closes googleapis#1955

    This issue will close once commit 88243b0 is merged into the 'master' branch.
    88243b0
  5. daspecster
    closed this as completedin 88243b0on Jul 4, 2016
  6. JustinBeckwith
    assigned
    yoshi-automation
    on Feb 1, 2021
  7. parthea
    added a commit that references this issue on Mar 6, 2026

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

    15af5f2
  8. parthea
    added a commit that references this issue on Apr 1, 2026

    chore: implement add_op and del_op compilers (#1955)

    74af787
  9. 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

  • @yoshi-automation
    yoshi-automation

Labels

api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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.