π§© 11. Troubleshootingο
Quick fixes and diagnostics for common setup and runtime issues when using the MATLAB AWS clients.
πΈ βAWS service β¦ is not available in region β¦βο
Originates from region validation in
BaseClient.Confirm the service supports your chosen region; try a supported region.
For Bedrock Runtime, prefer
us-east-1unless otherwise noted.
πΈ Missing region / βRegion must be setβο
Either rely on
getDefaultCredentialProvider()(which resolves a region), orPass
'region', "us-east-1"(or similar) to the client constructor.
πΈ Profile not foundο
If using
getProfileCredentialProvider, ensure the profile exists in~/.aws/credentialsor~/.aws/config.If using
AWS_PROFILE, confirm it matches an existing profile name.
πΈ JVM not available / MATLAB too oldο
If
usejava('jvm')is false or MATLAB < R2021b, initialization will fail.Start MATLAB with JVM enabled and upgrade to R2021b+ if possible.
πΈ AWS SDK v2 JARs not foundο
If classes like
software.amazon.awssdk.services.s3.S3Clientare missing:Ensure the AWS SDK v2 JARs are on the Java class path (
javaaddpathorclasspath.txt).Restart MATLAB after changing the class path.
πΈ IMDS (instance profile) timeoutsο
Outside AWS, IMDS is unreachable and timeouts are expected.
Locally, prefer profiles or environment variables.
On EC2/ECS, ensure network access to IMDS/ECS credential endpoints (IMDSv2 tokens, firewall).
πΈ Web identity token errors (IRSA/OIDC)ο
Set these environment variables before MATLAB starts:
AWS_ROLE_ARNAWS_WEB_IDENTITY_TOKEN_FILE(Optional)
AWS_ROLE_SESSION_NAME
Note:
setenvinside MATLAB does not affect the JVM environment.
πΈ JSON parsing issues or missing keysο
For
getJsonFileCredentialProvideror custom loaders, validate your JSON file:Required keys:
aws_access_key_id,aws_secret_access_key.Use MATLAB to verify structure and encoding:
jsondecode(fileread('credentials.json'));
πΈ HTTP proxy issuesο
If you need a proxy and CRT does not meet your needs:
Use the non-CRT path and implement
configProxyHttpClientto return a configured Apache HTTP client builder.Alternatively, set Java system properties if supported by your HTTP client stack.
πΈ CRT HTTP client quirksο
If using
'isCrt', true:Ensure CRT dependencies are on the class path.
If a proxy is required and not supported, switch
'isCrt'tofalseand use the Apache client path.
See also
Authentication overview: Authentication.md
Client initialization: ClientInitialize.md
Credential examples: CredentialProviderExample.md