-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PubSub: Bad error message when message attribute is too long #7906
Copy link
Copy link
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.backendtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Environment details
- Specify the API at the beginning of the title (for example, "BigQuery: ...")
General, Core, and Other are also allowed as types
PubSub
- OS type and version
Ubuntu 16.04.6 LTS (Xenial Xerus)
- Python version and virtual environment information:
python --version
Python 2.7.12
- google-cloud- version:
pip show google-<service>orpip freeze
google-cloud-pubsub==0.40.0
Steps to reproduce
- Send a message with an attribute that is too long.
- The error message will be bad. It will say "One of the attributes in the request has a 2000 that is too long. The length is 1024 characters, but the maximum allowed is value. Refer to https://cloud.google.com/pubsub/quotas for more information." instead of "One of the attributes in the request has a value that is too long. The length is 2000 characters, but the maximum allowed is 1024. Refer to https://cloud.google.com/pubsub/quotas for more information."
Code example
from google.cloud import pubsub_v1
publisher = pubsub_v1.PublisherClient()
path = publisher.topic_path(PROJECT_ID, TOPIC_PATH)
future = publisher.publish(path, '', foo=('a'*2000))
raise future.exception()Stack trace
>>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/repro.py", line 9, in <module>
raise future.exception()
google.api_core.exceptions.InvalidArgument: 400 One of the attributes in the request has a 2000 that is too long. The length is 1024 characters, but the maximum allowed is value. Refer to https://cloud.google.com/pubsub/quotas for more information.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.backendtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.