"pubsub error INVALID_ARGUMENT" when using a Cloud Functions HTTPS endpoint in the same project

1,306 views
Skip to first unread message

Lazhar Ichir

unread,
Jan 10, 2018, 6:40:53 AM1/10/18
to Google Cloud Pub/Sub Discussions
My project has a bunch of Google Cloud Functions that are triggered by HTTPS POST requests either from my API Gateway, or by other services. Some functions have an enqueuing potential so the user can give my API Gateway a list of things to do, the API gateway adds these to PubSub, and I want PubSub to then push these to my Google Cloud Functions (using the HTTPS trigger, not the PubSub-Functions trigger.)

However, when I create a subscription in my console for my topic, I get a pubsub error INVALID_ARGUMENT when entering https://us-central1-MYPROJECT.cloudfunctions.net/MY-FUNCTION-ENDPOINT. Because I want my function to handle API gateway calls as well as pubsub pushes, I do not want to use the PubSub trigger.

Can you please allow PubSub to push to a Functions HTTPS endpoint in the same Google Cloud Project? 

Alex Mordkovich

unread,
Jan 10, 2018, 10:54:50 AM1/10/18
to Lazhar Ichir, Google Cloud Pub/Sub Discussions
Hi Lazhar,
Could you please provide the full error message that you get with the INVALID_ARGUMENT error code? Also please take a look at https://cloud.google.com/pubsub/docs/push#configuring-http-endpoints

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/053773b8-aa7d-4f6e-9e7d-2409f0958176%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

aman bhargava

unread,
Jul 25, 2018, 3:39:58 PM7/25/18
to Google Cloud Pub/Sub Discussions
Did your issue got resolved. I am doing similar thing and facing same issue as mentioned by you.

George (Cloud Platform Support)

unread,
Jul 26, 2018, 2:17:52 PM7/26/18
to Google Cloud Pub/Sub Discussions
Google Cloud Functions is a serverless execution environment for building and connecting cloud services. You simply deploy a function bound to the event you want. In your case, the event may be a Pub/Sub push message. On the other hand, HTTP Functions are used when you want to directly invoke your function via HTTP(S). To allow for HTTP semantics, HTTP function signatures accept HTTP-specific arguments. You indicated that you have such functions in use. Your request here that the same function should react equally well to an event such as a push message, as well as to an HTTP(S) call. Have you considered writing and deploying two different functions with the same desired functionality, one tied to the Pub/Sub event, the other ready for HTTP(S) calls? What use-case requires that one and the same function be used in the two different way above? A detailed use-case, preferably in step-by-step manner, would greatly help to assess your request, as well as with eventual implementation. 
Reply all
Reply to author
Forward
0 new messages