aws-samples / aws-samples/amazon-sagemaker-build-train-deploy

Endpoint creation fails

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
185
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Endpoint creation fails with:

```
[2025-02-21 11:58:56 +0000] [26] [ERROR] Error handling request /ping
Traceback (most recent call last):
File "/miniconda3/lib/python3.9/site-packages/sagemaker_containers/_functions.py", line 93, in wrapper
return fn(*args, **kwargs)
File "/opt/ml/code/inference.py", line 37, in model_fn
obj = cloudpickle.load(file)
TypeError: code() takes at most 16 arguments (18 given)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/miniconda3/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 55, in handle
self.handle_request(listener_name, req, client, addr)
File "/miniconda3/lib/python3.9/site-packages/gunicorn/workers/ggevent.py", line 143, in handle_request
super().handle_request(listener_name, req, sock, addr)
File "/miniconda3/lib/python3.9/site-packages/gunicorn/workers/base_async.py", line 106, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/miniconda3/lib/python3.9/site-packages/sagemaker_sklearn_container/serving.py", line 140, in main
user_module_transformer, execution_parameters_fn = import_module(serving_env.module_name,
File "/miniconda3/lib/python3.9/site-packages/sagemaker_sklearn_container/serving.py", line 126, in import_module
user_module_transformer.initialize()
File "/miniconda3/lib/python3.9/site-packages/sagemaker_containers/_transformer.py", line 185, in initialize
self._model = self._model_fn(_env.model_dir)
File "/miniconda3/lib/python3.9/site-packages/sagemaker_containers/_functions.py", line 95, in wrapper
six.reraise(error_class, error_class(e), sys.exc_info()[2])
File "/miniconda3/lib/python3.9/site-packages/six.py", line 702, in reraise
raise value.with_traceback(tb)
File "/miniconda3/lib/python3.9/site-packages/sagemaker_containers/_functions.py", line 93, in wrapper
return fn(*args, **kwargs)
File "/opt/ml/code/inference.py", line 37, in model_fn
obj = cloudpickle.load(file)
sagemaker_containers._errors.ClientError: code() takes at most 16 arguments (18 given)
169.254.178.2 - - [21/Feb/2025:11:58:56 +0000] "GET /ping HTTP/1.1" 500 141 "-" "AHC/2.0"
```

Contributor guide

Open the contributing guide

Research direction

The traceback points to /opt/ml/code/inference.py line 37, where cloudpickle.load(file) runs during SageMaker endpoint startup. Reproduce the failure around the /ping request and determine the relevant runtime or serialized-model compatibility issue. Done means model loading completes and /ping no longer returns HTTP 500; no test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.