Introduction to Cloud Run troubleshooting

This page describes the common troubleshooting strategies for Cloud Runerrors.Personalized Service Health publishesall Cloud Run incidents that stem from theunderlying Google Cloud infrastructure to identify Google Cloud service disruptionsimpacting your projects. You should also considersetting up alerts on Personalized Service Health events. For informationabout incidents affecting all Google Cloud services, see theGoogle Cloud Service Health dashboard.

See the following sections in theCloud Run troubleshooting guide for resolving issues related to your Cloud Run resource:

Cloud Run troubleshooting strategies

The following sections explain how you can apply general troubleshootingstrategies to resolve your error. If you continue to encounter errors even afterfollowing the steps in thetroubleshooting guide,seeWhat's next.

Output good logs using Cloud Logging

Troubleshooting your Cloud Run resource is easier if you have good logs for debugging. You should write logs in a way thatcorrelates your container logs with a request log.

With correlated logs, you can identify the request that needs further analysis,find the request trace, and analyze the root cause of the issue. For moreinformation on writing logs, seeWrite container logs.

Investigate instances using the Logs Explorer

Each request log in Cloud Run contains aninstanceId field that identifies an instance that handles yourrequest. Depending on theconcurrency value youspecify, a single instance can handle multiple requests at the same time.

When you have multiple instances emitting logs at once, you should filter yourinstances to identify the sequential requests that lead up to an instance crash.

Filtering an instance lets you debug specific performance issues relatedto cold starts or increased latencies. These issues could also be bound tovariables declared in a global scope, when the value is reused in subsequentconcurrent requests. An example of this is when you create a single connectionpool global object for the instance, and then use it within multiple requests.

To filter a specific instance in the Logs Explorer, follow these steps:

  1. In the Google Cloud console, go to the Logs Explorer page:

    Go to Logs Explorer

  2. Select an existing Google Cloud project at the top of the page, or create anew project.

  3. Select the resourceCloud Run Revision for a service, orCloud Run Job for a job.

  4. Expand a log entry to filter by a specific instance.

  5. Click the instance ID value, and selectShow matching entries.

While you investigate instances, you canuse Gemini Cloud Assist Investigations to gain additional insights into your logs.For more information about different ways to initiate aninvestigation by using the Logs Explorer, seeTroubleshoot issues with Gemini Cloud Assist Investigations in the Gemini documentation.

Resolve unexpected request latencies

If you encounter issues with latency, do the following:

  1. Check if the latency is affecting all requests to your Cloud Runresource or only a small percentage. Cloud Run is automatically integrated with Cloud Monitoringwith no setup or configuration required.

    To see individual request latency metrics, follow these steps:

    1. In the Google Cloud console, go to the Cloud Run page:

      Go to Cloud Run

    2. Select a service or a job from the lists available in left navigation.

    3. Click theMETRICS tab to show theRequest latencies dashboard.

    Toview latency metrics in Cloud Monitoring, select from theMetrics list,Cloud Run Revision > Request_latencies > Request latency.

    For a list of all available Cloud Run metrics and more in-depthdetails, seeGoogle Cloud metrics in Cloud Monitoring.

  2. Identify the request with high latency to understand the source of latency.You can use Cloud Trace or Cloud Logging to understand how long aparticular request has taken.

    To identify requests with high latency using Cloud Logging, apply thetraceSampled=true filter to correlate logs in Cloud Logging with tracesin Cloud Trace. For more information, seeIntegrate with Cloud Logging.

    Sometimes dependencies such as requests to other services might cause latencyissues. To identify such requests, you should have explicit logging targetingthe requests. If you don't output such logs, it could appear as a latencyissue originating from a Cloud Run service.

    Additionally, you should consider evaluating latency spikes in the context ofthe chosen time window. A spike's significance is relative; a large spikein a small window might be negligible in a larger window, and vice-versa.Therefore, the time window significantly impacts the interpretation oflatency data.

  3. Try increasing the number ofminimum instances to reduce latency for incoming requests,and avoid cold starts. You should also consider modifying your source code,andadjust the scaling settings tolimit the number of connections to a backing service.

    For more information, seeOptimizing performance.

Troubleshoot connectivity issues

If your Cloud Run service is experiencing connectivity issues, considerthese strategies and tools to diagnose the problem:

  • PCAP sidecar: For deepernetwork-level analysis,deploy a PCAP sidecar alongside yourCloud Run service. This sidecar container performs a packet captureusingtcpdump within the same network namespace. The sidecar decouplesfrom the main ingress container and doesn't require any modifications toperform a packet capture. Sidecars also use their own resources, whichpreventstcpdump from competing with the resources you allocate to theprimary service.

  • Network intelligence and connectivity tests forCloud RunrevisionsandCloud Run functions:Perform automated checks on the network path between your Cloud Runresource and an endpoint. This helps you findmisconfigurations that might block traffic to or from your Cloud Runresource when connecting to a VM instance, an IP address, or a Google-managedservice.

  • Review logs for your Cloud Run resource:Logs show error messages about connection problems, such as failures,timeouts, or refused connections. These logs often reveal if the connectionissue is with your application or the network.

Troubleshoot with Gemini assistance

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

You can useGemini Cloud Assistchat to analyze logs and troubleshoot errors. With Gemini assistance, youcan quickly pinpoint and resolve errors by leveraging the tool's log analysiscapabilities, saving valuable time and effort.

To use Gemini Cloud Assist from the Google Cloud console, dothe following:

  1. Ensure that Gemini Cloud Assist is set up for your Google Cloud user account and project.

  2. Set up your Cloud Run development environmentin your Google Cloud project and ensure you have the appropriatedeployment permissions.

  3. Go to the Cloud Run page in the Google Cloud console.

    Go to Cloud Run

  4. In the console toolbar, select a Google Cloud project. Use a projectassociated with a project ID you submitted after you were granted access toGemini Cloud Assist.

  5. ClicksparkOpen or close Gemini AI chat.

    The Gemini panel opens.

  6. If necessary, clickAccept if you agree to the terms.

  7. If you have a question about a specific application, provide context bygoing to the page that shows your resource before asking your question. Whengenerating a response, Gemini includes information about thecurrent console page and project.

  8. Enter a prompt in theGemini panel.

    The following table provide some example prompts for usingGemini Cloud Assist with Cloud Run.

    PromptType of response
    "Can you explain this error message I'm seeing in my Cloud Run container logs?"Without a specific error message in the prompt, the output provides troubleshooting guidance for common Cloud Run container log error messages.
    "Can you explain this error message I'm seeing in my logs for my Cloud Run service?

    HTTP 429 The request was aborted because there was no available instance. The Cloud Run service might have reached its maximum container instance limit or the service was otherwise not able to scale to incoming requests. This might be caused by a sudden increase in traffic, a long container startup time or a long request processing time."
    Explanation of the Cloud Run error message and how to address the error.
    "How do I fix the following error message when deploying my Cloud Run service?

    HTTP 404: Not found
    Common causes of the error and how to troubleshoot the error.
    "My Cloud Run service keeps crashing. What could be causing this?"Approach for investigating the cause and how to address the problem.
    "How do I know if a 5XX error surfaced in the logs was due to a Google infrastructure service outage?"Steps for determining the cause of the 5XX error.
    "How do I identify the cause of this error:com.google.apps.framework.request.BadRequestException Project PROJECT has serving status SYSTEM_DISABLED and cannot be modified?"Suggests that the Google Cloud project has been administratively disabled at the system level. Provides steps to investigate the cause further.
    "Why can I access my Cloud Run service from a browser if I have setingress=internal?"An explanation of the expected behavior when configuring theingress setting tointernal. Includes other scenarios where access might seem to work from your browser.

For more details, see the following resources:

Use Gemini Cloud Assist Investigations

In addition to interactive chat, Gemini Cloud Assist can perform moreautomated, in-depth analysis throughGemini Cloud Assist Investigations.This feature is integrated directly into workflows likeLogs Explorer, and is a powerful root-cause analysis tool.

When you initiate an investigation from an error or a specific resource,Gemini Cloud Assist analyzes logs, configurations, and metrics.It uses this data to produce ranked observations and hypotheses about probableroot causes, and then provides you with recommended next steps. If you have asupport package, you can also transfer theinvestigation results to a Google Cloud support case, providing additionalcontext that can help resolve your case faster.

For services or functions deployed fromsource code,investigations can also provide code fix suggestions in theCloud Run console's "Source" tab to help you resolve build anddeployment issues.

For more information about different ways to initiate an investigation, seeTroubleshoot issues with Gemini Cloud Assist Investigations in the Gemini documentation.

What's next

If you can't find a solution to your problem in the Cloud Rundocumentation, follow these steps:

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.