aws / aws/sagemaker-python-sdk

TypeError: StoredFunction.__init__() got an unexpected keyword argument 'hmac_key'

Đang mở
#5,495 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
component: pipelines type: bug
Ngôn ngữ chính
Python
Star
2.3k
Fork
1.3k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
35

Mô tả

**PySDK Version**
- [ ] PySDK V2 (2.x)
- [x] PySDK V3 (3.x)

**Describe the bug**
Upon using the step decorator, I receive errors supposedly at function bootstrap time. The logs erroneously indicate the step was run successfully.

**To reproduce**
```
from sagemaker.mlops.local.local_pipeline_session import LocalPipelineSession
from sagemaker.mlops.workflow.function_step import step
from sagemaker.mlops.workflow.pipeline import Pipeline

@step(
image_uri="public.ecr.aws/sagemaker/sagemaker-distribution:3.7.0-cpu",
instance_type="ml.m5.large",
)
def preprocess() -> None:
print("Preprocessing step")

if __name__ == "__main__":
name = "test"
res_preprocess = preprocess()
session = LocalPipelineSession()
pipeline = Pipeline(
name=name,
steps=[preprocess()],
sagemaker_session=session,
)
session.create_pipeline(pipeline=pipeline, pipeline_description="foo")
session.start_pipeline_execution(PipelineName=name)

```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots or logs**
Remote:

Image

local:
```
pzu6ht9kua-algo-1-frkcn | /app/.venv/lib/python3.11/site-packages/sagemaker/train/remote_function/invoke_function.py:104: DeprecationWarning: sagemaker.train.remote_function.core.stored_function has been moved to sagemaker.core.remote_function.core.stored_function. Please update your imports. This shim will be removed in a future version.
pzu6ht9kua-algo-1-frkcn | from sagemaker.train.remote_function.core.stored_function import StoredFunction
pzu6ht9kua-algo-1-frkcn | 2026-01-19 13:55:14,079 sagemaker.remote_function ERROR Error encountered while invoking the remote function.
pzu6ht9kua-algo-1-frkcn | Traceback (most recent call last):
pzu6ht9kua-algo-1-frkcn | File "/app/.venv/lib/python3.11/site-packages/sagemaker/train/remote_function/invoke_function.py", line 144, in main
pzu6ht9kua-algo-1-frkcn | _execute_remote_function(
pzu6ht9kua-algo-1-frkcn | File "/app/.venv/lib/python3.11/site-packages/sagemaker/train/remote_function/invoke_function.py", line 106, in _execute_remote_function
pzu6ht9kua-algo-1-frkcn | stored_function = StoredFunction(
pzu6ht9kua-algo-1-frkcn | ^^^^^^^^^^^^^^^
pzu6ht9kua-algo-1-frkcn | TypeError: StoredFunction.__init__() got an unexpected keyword argument 'hmac_key'
pzu6ht9kua-algo-1-frkcn exited with code 0
Aborting on container exit...
Container pzu6ht9kua-algo-1-frkcn Stopping
Container pzu6ht9kua-algo-1-frkcn Stopped
[01/19/26 14:55:15] INFO ===== Job Complete ===== image.py:323
[01/19/26 14:55:16] INFO Pipeline step 'preprocess-1e842e1e-0a59-4828-8c6c-7bb549f0600d' SUCCEEDED. pipeline_entities.py:180
INFO Pipeline execution eb1dabc4-48b3-4e79-b6e5-229d92df098e SUCCEEDED
```

**System information**
A description of your system. Please provide:
- **SageMaker Python SDK version**: 3.3.1
- **Framework name (eg. PyTorch) or algorithm (eg. KMeans)**: n/a
- **Framework version**: n/a
- **Python version**: 3.11
- **CPU or GPU**: cpu
- **Custom Docker image (Y/N)**: N

**Additional context**
It appears l.110 in `invoke_function.py` is the source of the bug: https://github.com/aws/sagemaker-python-sdk/blob/master/sagemaker-train/src/sagemaker/train/remote_function/invoke_function.py#L110

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Inspect sagemaker-train/src/sagemaker/train/remote_function/invoke_function.py around line 110, along with the StoredFunction import and constructor shown in the traceback. Reproduce the failure with the provided step decorator and LocalPipelineSession example. Done means bootstrap no longer raises the hmac_key TypeError and a failed container is not reported as a successful pipeline step.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
machine-learning
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.