Configure platform gateway route timeouts
In Ansible Automation Platform 2.7, all API access to platform components goes through platform gateway. Gateway-level timeout settings control how long platform gateway waits for backend services to respond before closing a connection.
If you experience timeout errors when uploading container images or collections to automation hub, increase gateway route timeouts to allow more time for the upload to complete.
As all traffic now routes through platform gateway, gateway-level settings for request body size limits and connection timeouts apply to uploads that previously went directly to automation hub.
Collection uploads and container image uploads have different size characteristics and are affected by different gateway settings.
Collection upload limits Copy linkLink copied!
Collections uploaded to automation hub are typically under 20 MB for public content and under 200 MB for private automation hub. These uploads are affected by the gateway request body size limit.
Platform gateway controls request body size through the GRPC_SERVER_MAX_RECEIVE_MESSAGE_LENGTH setting (default: 20 MiB, minimum: 4 MiB), which is enforced by the Envoy proxy. This default matches automation hub's 20 MB limit, so collection uploads work without additional configuration.
For collections larger than 20 MB, such as large private content, increase GRPC_SERVER_MAX_RECEIVE_MESSAGE_LENGTH by setting the environment variable to match your largest expected collection size. When increasing this value, also increase ENVOY_PER_CONNECTION_BUFFER_LIMIT_BYTES (default: 25 MiB) to remain at least 5 MiB above the request body size limit.
For containerized deployments, the installer variable gateway_nginx_client_max_body_size (default: 5m) controls nginx body size limits. Since nginx sits in front of Envoy in containerized topologies, this limit is applied first. If collection uploads fail with HTTP 413 errors on containerized deployments, increase this value to at least 20m to match automation hub's default.
Container image uploads Copy linkLink copied!
Container images for execution environments can exceed 4 GB. These uploads use chunked transfer encoding, so they are primarily affected by gateway route timeout settings rather than body size limits.
When to configure gateway settings Copy linkLink copied!
Adjust platform gateway settings when you experience upload errors or timeouts after routing traffic through platform gateway in Ansible Automation Platform 2.7.
Symptoms requiring configuration changes Copy linkLink copied!
Adjust platform gateway settings if you experience:
- HTTP 413 Request Entity Too Large errors when uploading collections: increase
GRPC_SERVER_MAX_RECEIVE_MESSAGE_LENGTHandENVOY_PER_CONNECTION_BUFFER_LIMIT_BYTES(andgateway_nginx_client_max_body_sizefor containerized deployments). - Timeout errors during container image pushes: increase route timeout values.
- Incomplete transfers or interrupted uploads: increase route timeout values.
Affected operations Copy linkLink copied!
| Operation | Primary setting | Size range |
|---|---|---|
| Collection uploads to automation hub | GRPC_SERVER_MAX_RECEIVE_MESSAGE_LENGTH |
Up to 200 MB |
Container image push (podman push, docker push) |
Route timeout | 1-10+ GB |
| Execution environment uploads | Route timeout | 1-10+ GB |
| Bulk content synchronization | Route timeout | Varies |
Configure gateway routes using the ansible.platform collection Copy linkLink copied!
You can configure platform gateway route timeouts during installation or redeployment to support large file uploads to automation hub.
Before you begin Copy linkLink copied!
- The
ansible.platformcollection is installed. - You have administrator access to the deployment environment.
- For Red Hat OpenShift Container Platform deployments, you have cluster administrator privileges.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
Upload a large container image to automation hub:
$ podman push <large-image> <gateway-host>/automation-hub/<repository>/<image>:<tag>
Confirm that the upload completes without timeout errors.
Configure gateway routes using the API Copy linkLink copied!
You can adjust route timeouts on existing deployments to support large file uploads to automation hub.
Before you begin Copy linkLink copied!
- You have platform gateway administrator access.
- You have an OAuth2 token with administrative privileges.
- Platform gateway is deployed and operational.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
Verify the new timeout settings are active:
$ curl -k -X GET \
-H "Authorization: Bearer <token>" \
https://<gateway_host>/api/gateway/v1/routes/
Upload a large container image to automation hub and verify completion without errors.
Configure Ansible Lightspeed route timeouts Copy linkLink copied!
If you use Red Hat Ansible Lightspeed and need to adjust streaming timeouts, configure the request_timeout_seconds and idle_timeout_seconds fields on the Lightspeed route.
Before you begin Copy linkLink copied!
- You have platform gateway administrator access.
- The
ansible.platformcollection is installed.
About this task Copy linkLink copied!
These fields replace the max_stream_duration and stream_idle_timeout global proxy settings that were available in Ansible Automation Platform 2.6.
| Removed setting (2.6) | Replacement field (2.7) | Default |
|---|---|---|
max_stream_duration |
request_timeout_seconds |
3600 |
stream_idle_timeout |
idle_timeout_seconds |
60 |
Procedure Copy linkLink copied!
Results Copy linkLink copied!
Verify the updated timeout settings by querying the route through the API:
$ curl -s -k \
-H "Authorization: Bearer <token>" \
https://<gateway-host>/api/gateway/v1/routes/ \
| python3 -m json.tool
Locate the Lightspeed route and confirm that effective_timeout_seconds and effective_idle_timeout_seconds reflect the expected values.
Gateway timeout recommendations Copy linkLink copied!
Platform gateway route timeout values determine how long the gateway waits for requests to complete before terminating the connection.
Recommended timeout values by upload size Copy linkLink copied!
| Expected upload size | Recommended timeout | Use case |
|---|---|---|
| Up to 1 GB | 600 seconds (10 minutes) | Small execution environments |
| 1-4 GB | 1800 seconds (30 minutes) | Medium execution environments |
| 4-10 GB | 3600 seconds (1 hour) | Large execution environments |
| Over 10 GB | 7200 seconds (2 hours) | Enterprise execution environments |
Calculating timeout values Copy linkLink copied!
If your environment requires specific settings, use the following formula to calculate a timeout value:
- Measure your upload bandwidth by timing a test file upload.
- Calculate the base timeout:
timeout_seconds = (file_size_in_GB x 1024) / (bandwidth_in_MB_per_second) - Add a 25% buffer to the result:
recommended_timeout = timeout_seconds x 1.25 - Round the result up to the nearest multiple of 300 seconds (5 minutes).
Performance considerations Copy linkLink copied!
Increasing timeout values might lead to the following issues:
- Increased memory usage: The gateway maintains connection state for all active uploads.
- Connection pool exhaustion: Many concurrent long-running uploads can consume all available connections.
- Delayed error detection: Network issues might take longer to surface.
Best practices Copy linkLink copied!
- Set timeouts based on the largest file size you expect to upload.
- Monitor gateway resource usage during large uploads to automation hub.
- Schedule large uploads during off-peak hours.
- Use multiple smaller images instead of a single large image when possible.