Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Run Function - Flask deployed to cloud run - Trigger using curl from Cloud shell

Hi Team,

I created cloud run function which is deployed to cloud run. We are only allowed internal + load balancing set up within our organization. When i try to trigger using curl command from cloud shell iam getting below error:

 
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>404 Not Found</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Not Found</h1>
<h2>The requested URL <code>/fn-createtablebq</code> was not found on this server.</h2>
<h2></h2>
</body></html>
 

how can i trigger the cloud function using curl command or make request to cloud function in this case?

 

0 1 213
1 REPLY 1

Hi @sunandinira,

Welcome to the Google Cloud Community!

A HTTP 404: Not Found error generally occurs when a server is reachable but cannot find the requested resource. This mostly happens due to a broken link, a moved or deleted page, or an incorrect URL.

To resolve this, follow these troubleshooting steps:

  1. Verify that the URL you are requesting is correct by checking the service detail page in the Google Cloud console or by running the following command:
    gcloud run services describe SERVICE_NAME | grep URL​
  2. Inspect where your app logic might be returning 404 error codes. If your app is returning the 404, it will be visible in Cloud Logging. If 404 is seen in Cloud Logging on only cold starts, then your app may not be ready for requests when the container begins listening on the configured port.
  3. Make sure your app does not start listening on its configured port before it is ready to receive requests by configuring a HTTP startup probe. This ensures your application has successfully listened on its configured port first before it is ready to serve requests. It would likely result in a longer cold start, but your app would not process requests until the startup probe is successful.
  4. Verify that the app does not return a 404 error code when you run it locally.

If these steps didn’t resolve the issue, feel free to check out our other options for support or update this thread.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.