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

Cloud Run + IAP Error 404

Hello, I'm getting a 404 error on Cloud Run (Error: Page not found. The requested URL was not found on this server.), this happens when I set the internal access to internal with the allow traffic from the HTTP load balancer option. For authentication, I set it to allow unauthenticated. I set up a serverless VPC with the 10.8.0.0 subnet and I still get the same error. I tried adding the load balancer, setting up the domain and the DNS zone but I keep getting the same error (I'm trying to implement IAP with Cloud Run).

The tutorial I followed: https://www.youtube.com/watch?v=LGobxFyu3zw&ab_channel=66degrees

Thanks.

1 1 3,866
1 REPLY 1

Hi @fcori ,

There are many reasons why you are getting the 404 error on Cloud Run. You may have to check the following:
a. The logs in the Google Cloud Console for the HTTP(S) Load Balancer, look for any error messages or unusual patterns.
b. Temporarily disable IAP and see if you can access Cloud Run directly through the load balancer. This can help identify whether the issue is specific to IAP.
c. Use the gcloud command-line tool to test access to Cloud Run. Run the following command, replacing SERVICE_URL with your Cloud Run service URL:

gcloud compute ssh YOUR_VM_INSTANCE --zone=YOUR_ZONE --project=YOUR_PROJECT --internal-ip --ssh-flag="-L 8080:SERVICE_URL"

 After running this command, you can access your Cloud Run service locally by visiting http://localhost:8080 in your web browser. This can help you determine if the issue is with the load balancer or Cloud Run.

d. As a last resort, consider recreating the HTTP(S) Load Balancer. Sometimes, there might be issues with the load balancer configuration that are not immediately apparent.