You ran create-endpoint, the status stayed Creating for 20 minutes or more, and then it changed to Failed. Nothing serves traffic, and the pipeline that deployed the model is red. This post goes through the checks in order: read the failure reason, find the logs, then match the error to a fix.
Step 1: read FailureReason
The endpoint keeps the reason it failed. Read that before you change anything.
EP=my-llm-endpoint
aws sagemaker describe-endpoint --endpoint-name "$EP" \
--query '{Status:EndpointStatus,Reason:FailureReason,Config:EndpointConfigName}'
Then look at what the endpoint was asked to run:
CFG=$(aws sagemaker describe-endpoint --endpoint-name "$EP" --query EndpointConfigName --output text)
aws sagemaker describe-endpoint-config --endpoint-config-name "$CFG" \
--query 'ProductionVariants[].{Variant:VariantName,Model:ModelName,Type:InstanceType,Count:InitialInstanceCount,Startup:ContainerStartupHealthCheckTimeoutInSeconds,Download:ModelDataDownloadTimeoutInSeconds}'
MODEL=$(aws sagemaker describe-endpoint-config --endpoint-config-name "$CFG" --query 'ProductionVariants[0].ModelName' --output text)
aws sagemaker describe-model --model-name "$MODEL" \
--query '{Image:PrimaryContainer.Image,Data:PrimaryContainer.ModelDataUrl,Role:ExecutionRoleArn,Vpc:VpcConfig}'
Keep the image URI, the S3 path of the model artifacts and the execution role ARN. Most fixes below need one of them.
Step 2: find the container logs
Every endpoint writes container stdout and stderr to a CloudWatch Logs group named after the endpoint. There is one log stream per variant and instance.
aws logs describe-log-streams --log-group-name "/aws/sagemaker/Endpoints/$EP" \
--query 'logStreams[].logStreamName'
aws logs tail "/aws/sagemaker/Endpoints/$EP" --since 2h
The logs tell you where it stopped:
- No log group, or no streams. The container never started. Look at image pull, model download, IAM and capacity (the table below).
- Logs end with a stack trace. The model server crashed. Common causes are a missing file in
model.tar.gz, a missing Python dependency or out-of-memory while loading weights. - Logs show the model still loading when they stop. The server was healthy in itself but too slow. SageMaker stopped waiting for it. This is the ping health check timeout.
Symptom, cause and fix
| FailureReason or log symptom | Likely cause | Fix |
|---|---|---|
The primary container for production variant AllTraffic did not pass the ping health check | Container doesn't answer GET /ping with 200 on port 8080, or the model takes longer to load than the startup timeout | Fix the server, or raise ContainerStartupHealthCheckTimeoutInSeconds |
| Model download timed out or failed | Large artifacts, slow download or wrong S3 path | Check ModelDataUrl, raise ModelDataDownloadTimeoutInSeconds, check disk space |
| Access denied on S3 or KMS | Execution role can't read the bucket or decrypt the object | Add s3:GetObject (and kms:Decrypt for SSE-KMS) to the execution role |
| Image can't be pulled | Wrong image URI or tag, role lacks ECR permissions, or repository policy blocks a cross-account pull | Check the URI. Grant the ECR read actions and a repository policy for the other account |
ResourceLimitExceeded ... for endpoint usage | Account quota for that instance type is lower than the count you asked for | Request a quota increase or use a type you have quota for |
| Capacity error for the instance type (wording varies) | No capacity for that GPU type in the Region right now | Retry later, try another instance type or Region |
| Container exits soon after starting | Crash on load: bad artifact layout, missing package, out of memory | Reproduce it locally with the same image and artifacts |
Fix ping health check failures
SageMaker starts your image with the serve argument and expects an HTTP server on port 8080 with two routes: GET /ping and POST /invocations. Model artifacts are unpacked into /opt/ml/model. The endpoint only reaches InService when /ping returns 200 within the startup window. After that, each ping has only a few seconds to answer.
Test the same image locally before you change timeouts:
aws ecr get-login-password --region eu-west-1 | \
docker login --username AWS --password-stdin 123456789012.dkr.ecr.eu-west-1.amazonaws.com
mkdir -p /tmp/model && tar -xzf model.tar.gz -C /tmp/model
docker run --rm -p 8080:8080 -v /tmp/model:/opt/ml/model \
123456789012.dkr.ecr.eu-west-1.amazonaws.com/my-llm:1.4.2 serve
# in a second shell
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/ping
If /ping never answers, the image is the problem. Check the port, the listen address (it must be 0.0.0.0, not 127.0.0.1) and the serve entry point. If it answers after several minutes, the model is just slow to load. Raise the startup timeout in a new endpoint config:
aws sagemaker create-endpoint-config \
--endpoint-config-name my-llm-cfg-v2 \
--production-variants '[{
"VariantName": "AllTraffic",
"ModelName": "my-llm-model",
"InstanceType": "ml.g5.2xlarge",
"InitialInstanceCount": 1,
"ContainerStartupHealthCheckTimeoutInSeconds": 1800,
"ModelDataDownloadTimeoutInSeconds": 1800
}]'
For allowed ranges, see the ProductionVariant API reference. For large models that are slow to load, AWS also documents VolumeSizeInGB for extra disk. It only applies to some instance types, so check your type before you set it.
Tip
Make your model server return 200 on
/pingonly after the weights are loaded, and keep the handler cheap. A ping that runs a real inference can go over the health check's response time under load, and then SageMaker replaces a working instance.
Fix model download and permission errors
Check that the artifact exists and is the size you expect:
aws s3 ls s3://my-models/llm/1.4.2/model.tar.gz --human-readable
Then check what the execution role is actually allowed to do:
ROLE=arn:aws:iam::123456789012:role/SageMakerExecRole
aws iam simulate-principal-policy --policy-source-arn "$ROLE" \
--action-names s3:GetObject \
--resource-arns arn:aws:s3:::my-models/llm/1.4.2/model.tar.gz \
--query 'EvaluationResults[].{Action:EvalActionName,Decision:EvalDecision}'
aws iam simulate-principal-policy --policy-source-arn "$ROLE" \
--action-names ecr:GetAuthorizationToken ecr:BatchGetImage ecr:GetDownloadUrlForLayer \
--query 'EvaluationResults[].{Action:EvalActionName,Decision:EvalDecision}'
The simulator doesn't evaluate bucket policies, KMS key policies or ECR repository policies. If it says allowed and the deployment still fails, look at those next:
- SSE-KMS artifacts. The key policy must let the execution role call
kms:Decrypt. - Model with
VpcConfig. The subnets need a route to S3, either an S3 gateway endpoint or a NAT gateway. A private subnet with neither will time out on the download. - Cross-account image. The ECR repository policy in the image account must allow the pulling account.
Fix quota and capacity errors
Endpoint instance quotas are per instance type and per Region. Check the quota you have:
aws service-quotas list-service-quotas --service-code sagemaker \
--query "Quotas[?contains(QuotaName, 'ml.g5.2xlarge for endpoint usage')].{Name:QuotaName,Value:Value,Code:QuotaCode}"
Instances already used by other endpoints count against the same quota. A quota of 4 with three instances running elsewhere leaves room for one. Request an increase with aws service-quotas request-service-quota-increase --service-code sagemaker --quota-code <code> --desired-value <n>. Increases for GPU types are not instant, so request them well before a launch.
Recover the endpoint
A Failed endpoint does not serve traffic and can't be fixed in place. Delete it, then create it again with the corrected config:
aws sagemaker delete-endpoint --endpoint-name "$EP"
aws sagemaker wait endpoint-deleted --endpoint-name "$EP"
aws sagemaker create-endpoint --endpoint-name "$EP" --endpoint-config-name my-llm-cfg-v2
aws sagemaker wait endpoint-in-service --endpoint-name "$EP"
The waiter gives up after a fixed number of polls. For a model that takes a long time to load, it can stop before the endpoint does. Poll describe-endpoint yourself if that happens.
Warning
Updates are different. If
update-endpointfails on an endpoint that wasInService, SageMaker rolls back and the old config keeps serving. Do not delete that endpoint to "retry". You would turn a failed update into an outage. ReadFailureReason, fix the new config and runupdate-endpointagain. If the status isUpdateRollbackFailed, open a support case.
Prevent it next time
- Run the image locally with the real artifacts in CI and check
curl /pingbefore anything is deployed. - Set
ContainerStartupHealthCheckTimeoutInSecondsandModelDataDownloadTimeoutInSecondson purpose for large models. Base them on load times you measured, not on the defaults. - Deploy new versions with
update-endpoint(or blue/green deployment guardrails) to existing endpoints, so a bad config rolls back instead of failing. - Track instance quota per Region next to your capacity plan, and include endpoints in other teams' accounts if you share quota.
- Alert on endpoints that stay in
CreatingorUpdatinglonger than your normal deploy time. An EventBridge rule on SageMaker endpoint state changes gives you theFailedevent quickly.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get