Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid push endpoint error during Google Pub/Sub subscription creation

I've gone through all the prereqs on Google's site.

  1. Got and installed a SSL cert (from Let's Encrypt) on server.

  2. Registered and verified the domain (yes, the https url) on Google Search Console (like https://example.org).

  3. Added to the domain to my API Credential's Domain Verification.

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.

like image 701
ehfeng Avatar asked Jan 09 '16 23:01

ehfeng


1 Answers

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

like image 50
ehfeng Avatar answered Nov 15 '22 11:11

ehfeng