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.
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.
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
you can find it on the UI or do aws sagemaker list-domains
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)
]
}
}
}
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
2
Answers
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.
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
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 $$$)
Create a file
update-domain-input.json
update theCustomImages
list remove the problematic image (but keep others if you have any)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