HumanSignal / HumanSignal/label-studio-ml-backend
[Bug] An error occurred when running gliner
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 490
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
使用 docker-compose up 启动,在label-studio 点击任务,则docker 出现报错了。
```
[2026-03-25 07:07:52,034] [INFO] [model::lazy_init::39] Loading Pretrained Model from gliner_medium-v2.1
gliner | config.json not found in /data/models/gliner_medium-v2.1
gliner | [2026-03-25 07:07:52,039] [WARNING] [huggingface_hub.hub_mixin::from_pretrained::232] config.json not found in /data/models/gliner_medium-v2.1
gliner | [2026-03-25 07:07:52,052] [DEBUG] [urllib3.connectionpool::_new_conn::1049] Starting new HTTPS connection (1): huggingface.co:443
gliner | [2026-03-25 07:07:54,884] [INFO] [model::lazy_init::45] No Pretrained Model Found. Loading GLINER model urchade/gliner_medium-v2.1
gliner | [2026-03-25 07:07:54,887] [DEBUG] [urllib3.connectionpool::_new_conn::1049] Starting new HTTPS connection (2): huggingface.co:443
gliner | [2026-03-25 07:07:59,952] [ERROR] [label_studio_ml.exceptions::exception_f::53] Traceback (most recent call last):
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 464, in _make_request
gliner | self._validate_conn(conn)
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
gliner | conn.connect()
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 796, in connect
gliner | sock_and_verified = _ssl_wrap_socket_and_match_hostname(
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 975, in _ssl_wrap_socket_and_match_hostname
gliner | ssl_sock = ssl_wrap_socket(
gliner | ^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl_.py", line 483, in ssl_wrap_socket
gliner | ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/util/ssl_.py", line 527, in _ssl_wrap_socket_impl
gliner | return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/ssl.py", line 517, in wrap_socket
gliner | return self.sslsocket_class._create(
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/ssl.py", line 1104, in _create
gliner | self.do_handshake()
gliner | File "/usr/local/lib/python3.11/ssl.py", line 1382, in do_handshake
gliner | self._sslobj.do_handshake()
gliner | ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1016)
gliner |
gliner | During handling of the above exception, another exception occurred:
gliner |
gliner | Traceback (most recent call last):
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 787, in urlopen
gliner | response = self._make_request(
gliner | ^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 488, in _make_request
gliner | raise new_e
gliner | urllib3.exceptions.SSLError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1016)
gliner |
gliner | The above exception was the direct cause of the following exception:
gliner |
gliner | Traceback (most recent call last):
gliner | File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 644, in send
gliner | resp = conn.urlopen(
gliner | ^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 841, in urlopen
gliner | retries = retries.increment(
gliner | ^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 535, in increment
gliner | raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /microsoft/deberta-v3-base/resolve/main/tokenizer_config.json (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1016)')))
gliner |
gliner | During handling of the above exception, another exception occurred:
gliner |
gliner | Traceback (most recent call last):
gliner | File "/app/model.py", line 40, in lazy_init
gliner | self.model = GLiNER.from_pretrained(str(pathlib.Path(self.MODEL_DIR, self.finetuned_model_path)), local_files_only=True)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
gliner | return fn(*args, **kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/hub_mixin.py", line 277, in from_pretrained
gliner | instance = cls._from_pretrained(
gliner | ^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/gliner/model.py", line 804, in _from_pretrained
gliner | gliner = cls(config, tokenizer=tokenizer, encoder_from_pretrained=False)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/gliner/model.py", line 53, in __init__
gliner | tokenizer = AutoTokenizer.from_pretrained(config.model_name)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/transformers/models/auto/tokenization_auto.py", line 767, in from_pretrained
gliner | tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/transformers/models/auto/tokenization_auto.py", line 600, in get_tokenizer_config
gliner | resolved_config_file = cached_file(
gliner | ^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/transformers/utils/hub.py", line 398, in cached_file
gliner | resolved_file = hf_hub_download(
gliner | ^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
gliner | return fn(*args, **kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1261, in hf_hub_download
gliner | metadata = get_hf_file_metadata(
gliner | ^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
gliner | return fn(*args, **kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 1667, in get_hf_file_metadata
gliner | r = _request_wrapper(
gliner | ^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 385, in _request_wrapper
gliner | response = _request_wrapper(
gliner | ^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 408, in _request_wrapper
gliner | response = get_session().request(method=method, url=url, **params)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
gliner | resp = self.send(prep, **send_kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
gliner | r = adapter.send(request, **kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/huggingface_hub/utils/_http.py", line 67, in send
gliner | return super().send(request, *args, **kwargs)
gliner | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gliner | File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 675, in send
gliner | raise SSLError(e, request=request)
gliner | requests.exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /microsoft/deberta-v3-base/resolve/main/tokenizer_config.json (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1016)')))"), '(Request ID: 668e17d3-fd7e-4c2f-a2e7-4c888f8d3bbc)')
```
docker-compose.yml :
```
version: "3.8"
services:
gliner:
container_name: gliner
image: humansignal/ml-backend:v0
build:
context: .
args:
TEST_ENV: ${TEST_ENV}
environment:
# specify these parameters if you want to use basic auth for the model server
- BASIC_AUTH_USER=
- BASIC_AUTH_PASS=
# set the log level for the model server
- LOG_LEVEL=DEBUG
# any other parameters that you want to pass to the model server
- ANY=PARAMETER
# specify the number of workers and threads for the model server
- WORKERS=1
- THREADS=8
# specify the model directory (likely you don't need to change this)
- MODEL_DIR=/data/models
# Path to your saved finetuned model
- FINETUNED_MODEL_PATH=gliner_medium-v2.1
# Specify the Label Studio URL and API key to access
# uploaded, local storage and cloud storage files.
# Do not use 'localhost' as it does not work within Docker containers.
# Use prefix 'http://' or 'https://' for the URL always.
# Determine the actual IP using 'ifconfig' (Linux/Mac) or 'ipconfig' (Windows).
- LABEL_STUDIO_URL=http://192.168.204.106:8385/labelstudio
- LABEL_STUDIO_API_KEY=eWPMSlO-5yE
extra_hosts:
- "host.docker.internal:host-gateway" # for macos and unix
ports:
- "9090:9090"
volumes:
- "./data/server:/data"
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with docker-compose.yml and /app/model.py at the lazy_init call shown in the traceback. Check how /data/models/gliner_medium-v2.1 is expected to be populated and reproduce the failure with docker-compose up while observing the Hugging Face download attempt. Done means the GLiNER service can load the configured model and process a Label Studio task without the reported SSL error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, python
- Domain
- backend, devops, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100