Complete a 3 Question Survey and Earn a re:Post Badge
Help improve AWS Support Official channel in re:Post and share your experience - complete a quick three-question survey to earn a re:Post badge!
SageMaker AI 노트북 인스턴스 또는 SageMaker Studio 도메인에서 사전 서명된 URL을 시작할 때 오류가 발생하는 이유는 무엇입니까?
Amazon SageMaker AI 노트북 인스턴스 또는 Amazon SageMaker Studio 도메인에서 사전 서명된 URL을 시작하고 싶지만 오류가 표시됩니다.
해결 방법
참고: AWS Command Line Interface(AWS CLI) 명령을 실행할 때 오류가 발생하면 AWS CLI의 오류 해결을 참조하십시오. 또한 최신 AWS CLI 버전을 사용하고 있는지 확인하십시오.
SageMaker AI 노트북 인스턴스 또는 SageMaker Studio 도메인에서 사전 서명된 URL을 시작할 때 다음 오류 메시지가 표시될 수 있습니다.
- "Invalid or Expired Auth Token. Request a new presigned URL to continue using SageMaker."
- "User: arn:aws:sts::account id:assumed-role/IAM role/IAM user is not authorized to perform: sagemaker:CreatePresignedNotebookInstanceUrl on resource: arn:aws:sagemaker:Region:account id:notebook-instance/notebook instance because no identity-based policy allows the sagemaker:CreatePresignedNotebookInstanceUrl action"
- "User: arn:aws:sts::account id:assumed-role/IAM role/SageMaker is not authorized to perform: sagemaker:CreatePresignedDomainUrl on resource: arn:aws:sagemaker:Region:account id:user-profile/domain id/user profile name because no identity-based policy allows the sagemaker:CreatePresignedDomainUrl action"
이러한 문제를 해결하려면 표시된 오류 메시지에 대한 해결 단계를 완료하십시오.
"Invalid or Expired Auth Token" 오류
CreatePresignedNotebookInstanceUrl 또는 CreatePresignedDomainUrl의 SessionExpirationDurationInSeconds 파라미터가 최대 기간인 12시간을 초과하면 Invalid of Expired Auth Token 오류가 표시됩니다. 이 문제를 해결하려면 웹 브라우저에서 쿠키 및 세션 데이터를 지웁니다. 그런 다음 SageMaker AI 콘솔, AWS CLI 또는 Python SDK를 사용하여 사전 서명된 새 URL을 만듭니다.
SageMaker AI 노트북 인스턴스
콘솔을 사용하려면 다음 단계를 완료합니다.
- SageMaker AI 콘솔을 엽니다.
- 탐색 창의 애플리케이션 및 IDE에서 노트북을 선택합니다.
- 노트북 인스턴스를 선택합니다.
- Jupyter 열기 또는 JupyterLab 열기를 선택합니다.
AWS CLI를 사용하려면 create-presigned-notebook-instance-url 명령을 실행합니다.
aws sagemaker create-presigned-notebook-instance-url --notebook-instance-name example-notebook-instance-name --session-expiration-duration-in-seconds example-session-expiration-duration
참고: example-notebook-instance-name 및 example-session-expiration-duration을 해당하는 값으로 바꾸십시오.
Python SDK Boto3를 사용하려면 create-presigned-notebook-instance-url 명령을 실행합니다.
import boto3 client = boto3.client('sagemaker') response = client.create_presigned_notebook_instance_url( NotebookInstanceName=example-notebook-name, SessionExpirationDurationInSeconds=example-session-expiration-duration )
참고: example-notebook-name 및 example-session-expiration-duration을 해당하는 값으로 바꾸십시오.
AWS CLI 또는 Python SDK가 생성하는 사전 서명된 URL은 5분 동안만 유효합니다. 5분 후에는 사전 서명된 새 URL을 생성해야 합니다.
SageMaker Studio 도메인
콘솔을 사용하려면 다음 단계를 완료합니다.
- SageMaker AI 콘솔을 엽니다.
- 탐색 창의 관리자 구성에서 도메인을 선택합니다.
- 도메인을 선택합니다.
- 사용자 프로파일을 선택하고, 사용자 프로파일 이름을 선택합니다.
- 시작을 선택하고, Studio를 선택합니다.
AWS CLI를 사용하려면 create-presigned-domain-url 명령을 실행합니다.
aws sagemaker create-presigned-domain-url --domain-id example-domain-id --user-profile-name example-user-profile-name --session-expiration-duration-in-seconds example-session-expiration-duration
참고: example-domain-id, example-user-profile-name, example-session-expiration-duration을 해당하는 값으로 바꾸십시오.
Python SDK Boto3를 사용하려면 create-presigned-domain-url 명령을 실행합니다.
import boto3 client = boto3.client('sagemaker') response = client.create_presigned_domain_url( DomainId=example-domain-id, UserProfileName=example-user-profile-name, SessionExpirationDurationInSeconds=example-session-expiration-duration, )
참고: example-domain-id, example-user-profile-name, example-session-expiration-duration을 해당하는 값으로 바꾸십시오.
AWS CLI 또는 Python SDK가 생성하는 사전 서명된 URL은 5분 동안만 유효합니다. 5분 후에는 사전 서명된 새 URL을 생성해야 합니다.
"Not authorized to perform" 오류
SageMaker AI 노트북 또는 SageMaker Studio 도메인을 시작하려면 AWS Identity and Access Management(IAM) 역할에 사전 서명된 URL을 만들 권한이 있어야 합니다.
SageMaker AI 노트북 인스턴스의 경우 sagemaker:CreatePresignedNotebookInstanceUrl 작업을 IAM 역할의 ID 기반 정책에 추가합니다. SageMaker Studio 도메인의 경우 sagemaker:CreatePresignedDomainUrl 작업을 IAM 정책에 추가합니다.
관련 정보
Amazon Virtual Private Cloud(Amazon VPC) 인터페이스 엔드포인트를 통해 노트북 인스턴스에 연결
