My container cannot connect to Private Network resources at startup
Problem
When my Serverless Container instance starts, I get errors such as:
- "No route to host" error message
- "Connection timeout" error message
- Other connection failures when trying to reach resources in the same Private Network (PN) (such as databases, Instances, etc.)
Cause
The Serverless Container instance starts on a node where the PN is not yet fully available.
Solutions
Since a September 2026 update, the container instance waits for the PN router (169.254.169.254) to be reachable before starting. This update greatly reduces connection issues, but does not guarantee that all resources in the PN are reachable.
You can follow these solutions to ensure reliable connectivity at startup.
Solution 1: Implement connection retry logic (recommended)
-
Configure connection retries: If your container tries to connect to a resource in the PN at startup, implement retry logic with configurable timeouts.
-
Configure startup probes: Set up the container startup probe to return a
200status code only when all required PN resources are reachable. This prevents traffic from being routed to a container instance before it is fully ready. -
Set appropriate timeouts: Configure connection timeouts to allow sufficient time for the network to become available (up to 3 minutes).
Solution 2: Use dedicated Private Networks
The issue rarely occurs when both the container and the resource it needs to reach are in different PNs (but within the same VPC).
- In a VPC, create a PN dedicated to your containers.
- Place your containers in this dedicated PN.
- In the same VPC, create another PN for the resources your containers need to reach (databases, Instances, etc.).
- Place the resources in this separate PN.
Solution 3: Use a different region
If you can, deploy your containers in a different region to avoid this issue.
Going further
- Use Private Networks with Serverless Containers
- Containers and Private Networks integration
- Monitor container logs and metrics
- Serverless Containers concepts