Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while trying to access ML Studio from the UI #47

Closed
dosiennik opened this issue Jun 14, 2022 · 7 comments
Closed

Error while trying to access ML Studio from the UI #47

dosiennik opened this issue Jun 14, 2022 · 7 comments
Assignees
Labels
type: bug Something isn't working
Projects

Comments

@dosiennik
Copy link
Contributor

Describe the bug

I am getting the following error when try to click on the ML Studio link in the data.all UI:

sagemakerstudio_ bug

How to Reproduce

  1. Setup ML Studio in the data.all UI
  2. Try to access it by clicking on the ML Studio Name

Expected behavior

No response

Your project

No response

Screenshots

No response

OS

mac

Python version

3.8

AWS data.all version

Additional context

No response

@dosiennik dosiennik added the type: bug Something isn't working label Jun 14, 2022
@LEUNGUU
Copy link
Contributor

LEUNGUU commented Jun 16, 2022

The root cause I find is that the pivot role does not have enough permission to get the sagemaker user profile. Below are the error messages.
Screen Shot 2022-06-16 at 21 50 07
After adding related permissions to the role, ML studio can be seen from the UI.
PR is #50

@dosiennik
Copy link
Contributor Author

dosiennik commented Jun 21, 2022

Thanks, I moved a bit forward with the mentioned fix although it still doesn't work for me. It ends up with the following error when I am trying to access SageMaker generated pre-signed url:

SageMaker is unable to use your associated ExecutionRole [arn:aws:iam:::role/dataall-int-pihvzcf8] to create app. Verify that your associated ExecutionRole has permission for 'sagemaker:CreateApp'.

Looks like the role assigned to the SageMaker UserProfile doesn't have a privilege to create an app although I see the following in its policy:

{
            "Condition": {
                "StringEquals": {
                    "aws:RequestTag/Team": [
                        "DAAdministrators"
                    ]
                }
            },
            "Action": "sagemaker:Create*",
            "Resource": "*",
            "Effect": "Allow"
        }
    When I add the following createApp privilege explicitly to the role:
        {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "sagemaker:CreateApp",
            "Resource": "*"
        }
    ]
}

Then it works. Not sure what is the root cause, is it related somehow to the tagging? Shouldn't the tags from the UserProfile be propagated to the application? Looks like the Team tag is not propagated to the SageMaker App but the IAM Role requires the tag hence the action is denied.

@LEUNGUU
Copy link
Contributor

LEUNGUU commented Jun 22, 2022

@dosiennik Hello. Thanks for your reply. I dig into it and below is my findings.

  • The meaning of below policy is to allow request to create sagemaker related resource only when the request contains the tag {Team: DAAdministrators}. But what we use now is create_presigned_domain_url, which will launch a default app without the required tags. That is why we have the policy but it doesn't work.
{
           "Condition": {
               "StringEquals": {
                   "aws:RequestTag/Team": [
                       "DAAdministrators"
                   ]
               }
           },
           "Action": "sagemaker:Create*",
           "Resource": "*",
           "Effect": "Allow"
       }
  • I also check another one called aws:ResourceTag. This determine whether to allow access to the resource based on the tags that are attached to the resource. So I changed the _ RequestTag_ to ResourceTag, but it still doesn't work. I think this is normal because we cannot control the access to what we don't have now.

So I propose a simple solution that we can remove the condition to make it work for now. Later when we add the creation of sagemaker domain we can orchestrate all these things, such as domain, user profile and app.

Reference

access_tags

@dosiennik
Copy link
Contributor Author

@LEUNGUU thanks a lot for checking and replying. Yeah this will fix it since it works when I did such a change manually for testing.

It is actually odd considering UserProfile's tags definition:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-userprofile.html

Especially at the part: 'Tags that you specify for the User Profile are also added to all apps that the User Profile launches.'

I checked the tags on the user profile, they are there as expected but seems like they are not propagated to the SageMaker app.

Anyway I agree that the proposed fix will solve the issue although not fully sure about the root cause.

@dlpzx dlpzx self-assigned this Jun 22, 2022
@dlpzx dlpzx added this to Features requested in v1.2.0 via automation Jun 22, 2022
@dlpzx dlpzx moved this from Features requested to In progress in v1.2.0 Jun 22, 2022
@LEUNGUU
Copy link
Contributor

LEUNGUU commented Jun 22, 2022

@dlpzx How about the PR? Or you will propose another solution?

@dlpzx dlpzx moved this from In progress to Features requested in v1.2.0 Jun 24, 2022
@dlpzx
Copy link
Contributor

dlpzx commented Jun 27, 2022

The PR passed all controls and I just merged it. Thank you for contributing :)

@dlpzx dlpzx closed this as completed Jun 27, 2022
v1.2.0 automation moved this from Features requested to Done Jun 27, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

3 participants