docling-project / docling-project/docling

Multiprocessing hitting `No such file or directory: '/home/runner/.EasyOCR//model/temp.zip'` with `EasyOcrModel`

Open
#2,380 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug

In GitHub Actions, there seems to be some potential for caching issues without `EasyOcrModel`.

I am hitting several instances of this in CI:

```none
.venv/lib/python3.11/site-packages/docling/pipeline/standard_pdf_pipeline.py:49: in __init__
ocr_model = self.get_ocr_model(artifacts_path=self.artifacts_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/docling/pipeline/standard_pdf_pipeline.py:119: in get_ocr_model
return factory.create_instance(
.venv/lib/python3.11/site-packages/docling/models/factories/base_factory.py:57: in create_instance
return _cls(options=options, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/docling/models/easyocr_model.py:84: in __init__
self.reader = easyocr.Reader(
.venv/lib/python3.11/site-packages/easyocr/easyocr.py:92: in __init__
detector_path = self.getDetectorPath(detect_network)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
detect_network = 'craft'

def getDetectorPath(self, detect_network):
if detect_network in self.support_detection_network:
self.detect_network = detect_network
if self.detect_network == 'craft':
from .detection import get_detector, get_textbox
elif self.detect_network in ['dbnet18']:
from .detection_db import get_detector, get_textbox
else:
raise RuntimeError("Unsupport detector network. Support networks are craft and dbnet18.")
self.get_textbox = get_textbox
self.get_detector = get_detector
corrupt_msg = 'MD5 hash mismatch, possible file corruption'
detector_path = os.path.join(self.model_storage_directory, self.detection_models[self.detect_network]['filename'])
if os.path.isfile(detector_path) == False:
if not self.download_enabled:
raise FileNotFoundError("Missing %s and downloads disabled" % detector_path)
LOGGER.warning('Downloading detection model, please wait. '
'This may take several minutes depending upon your network connection.')
download_and_unzip(self.detection_models[self.detect_network]['url'], self.detection_models[self.detect_network]['filename'], self.model_storage_directory, self.verbose)
> assert calculate_md5(detector_path) == self.detection_models[self.detect_network]['md5sum'], corrupt_msg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E AssertionError: MD5 hash mismatch, possible file corruption
```

And:

```none
.venv/lib/python3.11/site-packages/docling/pipeline/standard_pdf_pipeline.py:49: in __init__
ocr_model = self.get_ocr_model(artifacts_path=self.artifacts_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/docling/pipeline/standard_pdf_pipeline.py:119: in get_ocr_model
return factory.create_instance(
.venv/lib/python3.11/site-packages/docling/models/factories/base_factory.py:57: in create_instance
return _cls(options=options, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.11/site-packages/docling/models/easyocr_model.py:84: in __init__
self.reader = easyocr.Reader(
.venv/lib/python3.11/site-packages/easyocr/easyocr.py:178: in __init__
download_and_unzip(model['url'], model['filename'], self.model_storage_directory, verbose)
.venv/lib/python3.11/site-packages/easyocr/utils.py:629: in download_and_unzip
with ZipFile(zip_path, 'r') as zipObj:
^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self =
file = '/home/runner/.EasyOCR//model/temp.zip', mode = 'r', compression = 0
allowZip64 = True, compresslevel = None

def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True,
compresslevel=None, *, strict_timestamps=True, metadata_encoding=None):
"""Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
or append 'a'."""
if mode not in ('r', 'w', 'x', 'a'):
raise ValueError("ZipFile requires mode 'r', 'w', 'x', or 'a'")

_check_compression(compression)

self._allowZip64 = allowZip64
self._didModify = False
self.debug = 0 # Level of printing: 0 through 3
self.NameToInfo = {} # Find file info given name
self.filelist = [] # List of ZipInfo instances for archive
self.compression = compression # Method of compression
self.compresslevel = compresslevel
self.mode = mode
self.pwd = None
self._comment = b''
self._strict_timestamps = strict_timestamps
self.metadata_encoding = metadata_encoding

# Check that we don't try to write with nonconforming codecs
if self.metadata_encoding and mode != 'r':
raise ValueError(
"metadata_encoding is only supported for reading files")

# Check if we were passed a file-like object
if isinstance(file, os.PathLike):
file = os.fspath(file)
if isinstance(file, str):
# No, it's a filename
self._filePassed = 0
self.filename = file
modeDict = {'r' : 'rb', 'w': 'w+b', 'x': 'x+b', 'a' : 'r+b',
'r+b': 'w+b', 'w+b': 'wb', 'x+b': 'xb'}
filemode = modeDict[mode]
while True:
try:
> self.fp = io.open(file, filemode)
^^^^^^^^^^^^^^^^^^^^^^^
E FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/.EasyOCR//model/temp.zip'
```

### Steps to reproduce

1. Run GitHub Actions once
2. Change the job's name (level below `jobs:`)
3. Run GitHub Actions again

### Docling version

```none
2025-10-03 18:44:05,575 - INFO - Loading plugin 'docling_defaults'
2025-10-03 18:44:05,576 - INFO - Registered ocr engines: ['easyocr', 'ocrmac', 'rapidocr', 'tesserocr', 'tesseract']
Docling version: 2.55.1
Docling Core version: 2.48.4
Docling IBM Models version: 3.9.1
Docling Parse version: 4.5.0
Python: cpython-313 (3.13.2)
Platform: macOS-15.6.1-arm64-arm-64bit-Mach-O
```

### Python version

3.13.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.