Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pub/Sub publish error (Invalid value at 'messages[0].data' (TYPE_BYTES)) #247

Closed
niwa-kazutomo opened this issue Jul 1, 2016 · 1 comment
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@niwa-kazutomo
Copy link

Hi,

I use "google_api_python_client-1.5.1" from pip.
I try Pub/Sub message publish to topic.

topics.publish(topic='topicId',
               body={
                     'messages': [{
                                   'messageId': str(uuid.uuid4()),
                                   'data': base64.encodestring('Hello')
                                  }]
                     }).execute()

error occurred, and return this message.

googleapiclient.errors.HttpError: <HttpError 400 when requesting https://pubsub.googleapis.com/v1/projects/projectId/topics/topicId:publish?alt=json returned "Invalid value at 'messages[0].data' (TYPE_BYTES), "SGVsbG8=

I looks like this issue.
googleapis/google-cloud-ruby#713

@niwa-kazutomo
Copy link
Author

Oh, base64.encodestring metod add line feed code.

I change useing method, fixed it.

base64.b64encode('Hello')

akrherz pushed a commit to akrherz/google-api-python-client that referenced this issue Apr 1, 2019
Remove section from tox that is YAML formatted.
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants