Skip to content

SageMaker Studio refuses to open with error "SageMaker is not authorized to perform GetTaskCredentials"

0

Hello,

I'm trying to get SageMaker Studio setup for some non-admin users to access it. Unfortunately, I'm running into trouble that I can't figure out.

Specifically, when opening the SageMaker AI app, after a few seconds it always replaces the screen with "Error acquiring credentials", with the details "Credentials: Bad Request".

When looking at my web inspector, I can see two API requests are made before that screen is shown, to /api/creds, both respond with HTTP 400, and a response body of just

"Invalid input: SageMaker is not authorized to perform GetTaskCredentials. Possible reasons:1. Check if you have a trust relationship for 'sagemaker.amazonaws.com' to assume the role2. If you are using feature requiring Tag:Session, please check if the sts:TagSession is configured properly."

This is followed by a log line of

Object { statusCode: 400, message: "Bad Request", reason: 5 }

I have tried searching for an IAM permission of "GetTaskCredentials", but I can't seem to find any service with a permission called "GetTaskCredentials". I did grant both the execution role and the user role sts:TagSession on resource *, which didn't seem to help either.

For some additional context, this is a pretty basic SageMaker Domain that we created using the console, and linked it to our SSO setup. I am trying to access SageMaker Studio as a user with AdministratorAccess permissions, and the SageMaker execution role is what was generated by the domain setup, plus SageMakerAllAccess.

I'm not really sure how to get around this error, and it's preventing us from using SageMaker Studio, any help or tips would be greatly appreciated!

2 Answers
0

Did you enable Trusted Identity Propagation when you created the domain? If yes, make sure you update the corresponding execution role according to this doc: https://docs.aws.amazon.com/sagemaker/latest/dg/trustedidentitypropagation-setup.html (I have exactly the same error when enabling TIP and using the default generated role policy. After the update the problem is gone).

AWS

answered 6 months ago

-1

This error occurs when SageMaker Studio cannot acquire the necessary credentials due to IAM permission issues. Based on the error message, there are two likely causes:

  1. Missing trust relationship: The execution role used by SageMaker Studio needs to have a trust relationship that allows the SageMaker service (sagemaker.amazonaws.com) to assume the role. Check your execution role's trust policy to ensure it includes this trust relationship.

  2. Missing or improperly configured tag permissions: SageMaker Studio requires the ability to use session tags. Even though you've added sts:TagSession permission, there might be other configuration issues.

Here are some steps to troubleshoot:

  1. Verify the trust relationship in your execution role. It should include:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "sagemaker.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
  1. For user profiles in SageMaker Studio, ensure they are properly tagged. When creating a user profile, it should be tagged with the SageMaker Studio user name using the tag key studiouserid. The principal (user or role) should also have a matching tag with the key studiouserid.

  2. Attach a policy to the user role that includes the necessary permissions for creating presigned URLs:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AmazonSageMakerPresignedUrlPolicy",
"Effect": "Allow",
"Action": [
"sagemaker:CreatePresignedDomainUrl"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"sagemaker:ResourceTag/studiouserid": "${aws:PrincipalTag/studiouserid}"
}
}
}
]
}
  1. Try clearing your browser cookies and cache, or use an incognito/private browsing window, as authentication tokens might be expired or invalid.

  2. If you're still experiencing issues, you can try generating a presigned URL using the AWS CLI to access SageMaker Studio:

aws sagemaker create-presigned-domain-url --domain-id your-domain-id --user-profile-name your-profile-name

If these steps don't resolve the issue, you may need to contact AWS Support for further assistance, as there might be specific configuration requirements for your SSO setup with SageMaker Studio.
Sources
Permissions management - SageMaker Studio Administration Best Practices
Troubleshooting Amazon SageMaker AI Identity and Access - Amazon SageMaker AI
Unable to Access SageMaker Studio | AWS re:Post

answered a year ago

  • The trust relationship for the execution role is properly configured (which, I would hope would always be the case because it was generated by AWS).

    Additionally, I cannot create a presigned domain url because the domain's auth mode is SSO.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.