aws / aws/sagemaker-python-sdk
Missing jumpstart region_config.json file on Sagemaker distribution (SDK v2)
- Vorherrschende Sprache
- Python
- Sterne
- 2.3k
- Forks
- 1.3k
- Ø Merge
- 1 T. 22 Std.
- Gemergte PRs (30 T.)
- 35
Beschreibung
**PySDK Version**
- PySDK V2 (2.257.0)
**Describe the bug**
Error being logged when trying to load src/sagemaker/jumpstart/region_config.json not included in the MANIFEST.in file.
**To reproduce**
1. Install Sagemaker SDK version 2.257.0 using Poetry
2. Install ddtrace (e.g. v3.16.2)
3. Deploy and boot a Python service with sagemaker and ddtrace dependency
4. sagemaker/jumpstart/constants.py loads this file at import time and, when it’s missing, logs an ERROR with exc_info=True and continues with an empty set—so the app doesn’t crash but monitoring (e.g. Datadog via ddtrace) reports the error.
**Expected behavior**
The region_config.json included in the distribution binaries, avoiding the jumpstart error logs instead of just ignoring it.
**Screenshots or logs**
`
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sagemaker/jumpstart/constants.py", line 69, in _load_region_config
with open(filepath) as f:
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ddtrace/appsec/_common_module_patches.py", line 135, in wrapped_open_CFDDB7ABBA9081B6
raise e.with_traceback(
File "/usr/local/lib/python3.11/site-packages/sagemaker/jumpstart/constants.py", line 69, in _load_region_config
with open(filepath) as f:
^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/sagemaker/jumpstart/region_config.json'
`
**System information**
- **SageMaker Python SDK version**: 2.257.0
- **Framework name (eg. PyTorch) or algorithm (eg. KMeans)**: N/A (FastAPI service)
- **Framework version**: (N/A)
- **Python version**: 3.11.9
- **CPU or GPU**: CPU
- **Custom Docker image (Y/N)**: N
**Additional context**
Possible solution we see is to add this line to add so the JumpStart region config is included in the source distribution (sdist):
`include src/sagemaker/jumpstart/region_config.json`
The sagemaker/jumpstart/constants.py loads this file at import time and, when it’s missing, logs an ERROR with exc_info=True and continues with an empty set—so the app doesn’t crash but monitoring (e.g. Datadog via ddtrace) reports the error.
Beitragsleitfaden
Rechercherichtung
Start with MANIFEST.in and src/sagemaker/jumpstart/region_config.json, then inspect how the package is built and distributed. Build the source distribution and verify that sagemaker/jumpstart/region_config.json is included so importing sagemaker.jumpstart.constants no longer logs the missing-file error.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, python
- Bereich
- cloud, machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 58/100