skip to Main Content

I am trying to attach custom image in SageMaker, it was working fine until I deleted couple of previous version, it started giving me errors as bellow and now I am unable to attach either new image or a new version for existing image.

enter image description here

2

Answers


  1. You’ll have to attach new image versions to SageMaker images before you attach them to the domain. On the left nav under SageMaker dashboard -> Images, you should be seeing a list of images. Create new versions here and you’ll then be able to attach these to the domain.

    SageMaker console left nav

    Login or Signup to reply.
  2. I had the same problem after trying everything and getting no helpful info from the aws support other than ‘open a support ticket’🙄
    I figured it out myself.

    (& Yes it is absolutely a bug on the aws side! It is caused by the missing image)

    First find your DomainId
    UI location
    you can find it on the UI or do aws sagemaker list-domains

    Get your domains current settings:

    aws sagemaker describe-domain --domain-id $DOMAIN_ID

    you will see an output like below.
    It will list CustomImages associated with that sagemaker domain. & status will likely be in a failed state.

    Save your output settings just in case!

    (I redacted ids with $$$)

        {
            "DomainArn": "arn:aws:sagemaker:$$$",
            "DomainId": "$$$$",
            "DomainName": "$$$",
            ...
            "Status": "Update_Failed",
            ...
            "FailureReason": "ResourceNotFoundError: Image with ARN arn:aws:sagemaker:$$$ does not exist",
            ...
                "KernelGatewayAppSettings": {
                    "CustomImages": [
                        {
                            "ImageName": "my_custom_image", # this is the image causing problem, you might have more images listed below
                            "ImageVersionNumber": 1,
                            "AppImageConfigName": "app-image-config-1"
                        }
                    ]
                }
            }
            ...
        }
    

    Create a file update-domain-input.json update the CustomImages list remove the problematic image (but keep others if you have any)

        {
        "DomainId": DOMAIN_ID,
        "DefaultUserSettings": {
            "KernelGatewayAppSettings": {
                "CustomImages": [
                    #... add your custom images here (remove the problematic one) 
                    # If you have no images you can just pass an empty array then add image from dashboard UI(easier)
                ]
            }
        }
    }
    

    aws --region ${REGION} sagemaker update-domain --cli-input-json file://update-domain-input.json

    now the error should disappear and you should be able to add any image from the UI.(or If you know the config settings for the image you want to add you can do it during the update-domain step above.)

    I pieced together this solution looking at this example

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search