get_base_python_image_uri() returns URIs for unsupported Python versions
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- aws, python
- Domain
- cloud, machine-learning
Research direction
Find get_base_python_image_uri() in the SageMaker Python SDK V3 code and read its docstring, which says the supported values are 310 and 38. Check the nearby tests for how Python versions and image URIs are handled. Done means unsupported versions such as 311 are rejected clearly, while 310 and 38 still produce their expected URIs.
Written by the indexing model from the issue text.
Description
PySDK Version
- PySDK V2 (2.x)
- PySDK V3 (3.x)
Describe the bug
The get_base_python_image_uri() function returns image URIs for Python versions that don't have corresponding base images in ECR. When these URIs are used in SageMaker jobs, they fail with image not found errors.
To reproduce
from sagemaker.core.image_uris import get_base_python_image_uri
# Request Python 3.11 base image - THIS FAILS
uri_311 = get_base_python_image_uri(region="us-east-1", py_version="311")
print(f"Python 3.11 URI: {uri_311}")
# Attempt to use this URI in a SageMaker job will fail
# Request Python 3.10 base image - THIS WORKS
uri_310 = get_base_python_image_uri(region="us-east-1", py_version="310")
print(f"Python 3.10 URI: {uri_310}")
# Works fine with SageMaker jobs
Only Python 3.8 and 3.10 have corresponding base images in ECR. Attempting to use Python 3.11, 3.13, or any other unsupported version results in a failure when the SageMaker job tries to pull the image.
Expected behavior
The function should either:
- Only accept Python versions for which base images actually exist in ECR (currently 3.8 and 3.10)
- Raise a clear
ValueErrorlisting the supported Python versions - Update the docstring to document which Python versions are supported
Screenshots or logs
Error occurs only when using unsupported Python versions (e.g., 3.11):
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the CreateTrainingJob operation: Cannot find the requested image: 012345678901.dkr.ecr.us-west-2.amazonaws.com/sagemaker-base-python-311:1.0 with tag: 1.0 and digest: null. Please check if your ECR image exists and role arn:aws:iam::123456789012:role/SM-Training-ABCDEFGHIJ has proper pull permissions for SageMaker: ecr:BatchCheckLayerAvailability, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer
The issue is that the base image sagemaker-base-python-311 does not exist in ECR. Using Python 3.10 works without this error.
System information
- SageMaker Python SDK version: 3.x
- Framework name: N/A (base Python image issue)
- Framework version: N/A
- Python version: 3.11, 3.13 (attempted), 3.10 working
- CPU or GPU: N/A
- Custom Docker image: N/A
Additional context
The function's docstring states "Can be 310 or 38", but the function accepts any string value for py_version without validation. This creates a discrepancy between documented and actual supported versions, and affects automated image discovery.
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 1.3k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 65
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/sagemaker-python-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/sagemaker-python-sdk#6554 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] ModelTrainer with no input channels emits InputDataConfig: [], which CreatePipeline rejects (min=1) — v2 omitted the keyPossibly taken @sagemaker-bot claimed this 35 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aws/sagemaker-python-sdk#6156 · 2 comments ·
Maintainers usually reply within 1 day
-
sagemaker-train should depend on mlflow-skinny, following sagemaker-mlflow 0.5.0Possibly taken @mohamedzeidan2021 claimed this 36 days ago. Open
Difficulty 2/5 Half a day Newbie friendliness 72/100
aws/sagemaker-python-sdk#6152 ·
Maintainers usually reply within 1 day
-
`ModelTrainer` bug with method to load hyperparameters from file for Amazon Nova RecipePossibly taken @sagemaker-bot claimed this 35 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws/sagemaker-python-sdk#5770 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws/sagemaker-python-sdk#5588 · 1 comment ·
Maintainers usually reply within 1 day
All issues in aws/sagemaker-python-sdk
Similar issues
-
DBFS append mode silently overwrites existing filesPossibly taken @IlyaKhalafi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
fsspec/filesystem_spec#2429 ·
Maintainers usually reply within 1 day
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failurePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
volcengine/OpenViking#7014 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
fedora-copr/copr#4600 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ansys/pydpf-core#3620 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day