Thanks to visit codestin.com
Credit goes to github.com

Skip to content

google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument. #706

@leonardara

Description

@leonardara

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version: 2.0.42-debian10
  • Python version: python --version: 3.9.1
  • pip version: pip --version: 22.0.3
  • google-cloud-pubsub version: pip show google-cloud-pubsub: 2.12.1

Code example

# Wrap subscriber in a 'with' block to automatically call close() when done.
with subscriber:
    try:
        # When `timeout` is not set, result() will block indefinitely,
        # unless an exception is encountered first.
        streaming_pull_future.result(timeout=timeout)
    except TimeoutError:
        streaming_pull_future.cancel()  # Trigger the shutdown.
        streaming_pull_future.result()  # Block until the shutdown is complete.

Stack trace

File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 433, in result
    return self.__get_result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument.

This is a bit weird, my code is basically very similar to the one i copied from the GCP docs, and i cannot reproduce this issue locally, that means locally i have run many times, it is all ok, but once i deployed the code to GCP Dataproc, end of each run i get the above google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument. error, hitting my head on wall, pls help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: pubsubIssues related to the googleapis/python-pubsub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions