-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 MergeFrom error publish message #5903
Comments
Seems to be a problem on the pubsub.PublisherClient.from_service_account_json.
Sorry, but now I don't have a lot of time to debug the "why". |
I don't think there can be any connection between the $ pip show google-cloud-pubsub |
Version: google-cloud-pubsub==0.37.2 |
I just got the same error, |
@paulorcf It looks as though you are bypassing the "main" API for publishing messages ( The error message you report indicates that one of the items you are passing in The recommended path would be: from google.cloud import pubsub_v1
client = pubsub_v1.PublisherClient()
topic_path = client.topic_path('my-project-123'. 'my-topic-name')
data = b'BYTES OF MESSAGE DATA'
client.publish(topic_path, data, attr='ATTR VALUE') Please feel free to reopen / follow up if you can show the reproduction case where your app passes values using this pattern. |
I believe they showed their code in the original post, re-pasting it here, it's the same I used. It's the client = pubsub.PublisherClient.from_service_account_json('account.json')
topic_path = client.topic_path('project_name', 'topic_name')
data = b'The rain in Wales falls mainly on the snails.'
response = client.publish(topic, data) |
@ericgj we have passing system test for Can you provide the complete traceback, along with the value you are passing to |
Working:
Not Working:
TRACEBACK:
|
OK, I can reproduce here. The issue is that |
@theacodes I believe this is the issue you tried to fix in #5826. Can you shed any light here? |
Looks like #5826 returns a |
The '_gapic.add_methods' decorator doesn't quite get them right, so blacklist them from it and create them locally. Closes #5903.
Thanks for looking into that and getting that fixed |
🏷 pub/sub
SO: Linux/Ubuntu 16.04
api_core_version = 1.3.0
client_library_version = None
gapic_version = 0.37.2
grpc_version = 1.14.2
python_version = 3.6.4
Version: google-cloud-pubsub==0.37.2
Error:
response = client.publish(topic_path, data) File "venvpy/lib/python3.6/site-packages/google/cloud/pubsub_v1/gapic/publisher_client.py", line 393, in publish messages=messages, TypeError: Parameter to MergeFrom() must be instance of same class: expected google.pubsub.v1.PubsubMessage got int.
The text was updated successfully, but these errors were encountered: