SAM Doctor

ERROR REFERENCE

The endpoint could not route the request to a known AWS service

The request reported UnknownService while calling an AWS operation. Check the endpoint URL, service target, protocol, client, and Region before changing permissions.

WHAT IT MEANS

The service target was not registered there

An error occurred (UnknownService) when calling the PutMetricData operation: Unknown service target

A custom endpoint, proxy, or local emulator may not recognize the AWS service target or wire protocol used by the SDK. A stale client or wrong service endpoint can produce the same AWS-shaped response. This is not evidence of an IAM denial, and it does not prove that AWS lacks the service.

NEXT CHECK

Verify routing at the point of failure

  1. Preserve the request identity. Record the service, operation, endpoint URL, Region, SDK or CLI version, protocol target, and HTTP status from the same log.
  2. Check the endpoint. Confirm that the URL is intended for the service and that any proxy or emulator registers that service and the protocol the client sends.
  3. Retry the intended path. Test against the real AWS endpoint or update the emulator/client after correcting the routing mismatch before changing deployment permissions.

AUTOMATE THE TRIAGE

Keep the check in your normal workflow

SAM Doctor recognizes an AWS UnknownService operation marker with low confidence and keeps the advice investigative. Runs locally; no AWS access, no log upload.

python -m pip install sam-doctor
sam-doctor diagnose deployment.log --format markdown

RELATED