Google Pub / Sub订阅创建期间无效的推送端点错误 [英] Invalid push endpoint error during Google Pub/Sub subscription creation
问题描述
我浏览了Google网站上的所有必备。
-
获得并在服务器上安装SSL证书(来自Let's Encrypt)。
> -
添加到我的API Credential的域名验证。
Got and installed a SSL cert (from Let's Encrypt) on server.
Registered and verified the domain (yes, the https url) on Google Search Console (like https://example.org).
Added to the domain to my API Credential's Domain Verification.
在Google Search Console上注册并验证网域(是,https网址)(例如 https://example.org
topic ='projects / myproject / subscriptions / mytopic'
sub ='projecs / myproject / subscription / mysub' $ b $ client.projects()。topics()。create(topic = topic,body = {})。execute()
client.projects()。订阅()。create(name = sub,body = {'topic':topic,'pushC onfig':{'pushEndpoint':' https://example.org/push-handler '}
$ /
我回来了:
googleapiclient.errors.HttpError:https://pubsub.googleapis.com/v1/projects/myproject/subscriptions/mysub?alt=json返回给出的无效推送端点(endpoint = https://example.org/push-handler )。请参阅 https://cloud.google.com/pubsub/subscriber#create 以了解更多信息。
另外,我无法从Google的Pub / Sub开发者控制台创建订阅,当我尝试时,我取回无法添加订阅通知我是此主题和项目的完整所有者,拥有读写权限,我可以添加没有问题的订阅。
关于为什么的任何想法?好像我不是>只有一个触及此项。
解决方案我把协议( https://example.org )在域名验证中,而不仅仅是example.org。它提供了一些很好的域验证工具VAL阻止这种情况。
https: //console.developers.google.com/apis/credentials/domainverification
I've gone through all the prereqs on Google's site.
topic='projects/myproject/subscriptions/mytopic'
sub='projecs/myproject/subscription/mysub'
client.projects().topics().create(topic=topic, body={}).execute()
client.projects().subscriptions().create(name=sub, body={'topic': topic, 'pushConfig': {'pushEndpoint': 'https://example.org/push-handler'}})
And I get back:
googleapiclient.errors.HttpError: https://pubsub.googleapis.com/v1/projects/myproject/subscriptions/mysub?alt=json returned "Invalid push endpoint given (endpoint=https://example.org/push-handler). Refer to https://cloud.google.com/pubsub/subscriber#create for more information.">
Also, I'm unable to create subscriptions from Google's Pub/Sub developer console. When I try, I get back a "Subscription cannot be added" notification. I am the full owner of this topic and project, with read and write permissions. I'm able to add pull subscriptions with no problem.
Any ideas on why? It seems like I'm not the only one hitting this.
解决方案Figured it out. I included the protocol (https://example.org) in the domain verification, instead of just example.org. It would have been nice of the domain verification tool provided some validation preventing this.
https://console.developers.google.com/apis/credentials/domainverification
这篇关于Google Pub / Sub订阅创建期间无效的推送端点错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!