EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

HTTP Error 500: Internal Server Error

Open antonkrasov opened this issue 7 months ago • 0 comments

Hi guys,

Just recently started getting: "HTTP Error 500: Internal Server Error", on prod.

Full trace:


Downloading detection model, please wait. This may take several minutes depending upon your network connection.
--
Traceback (most recent call last):
  File "/pkg/modal/_runtime/container_io_manager.py", line 688, in handle_user_exception
    yield
  File "/pkg/modal/_container_entrypoint.py", line 440, in main
    service = import_single_function_service(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pkg/modal/_runtime/user_code_imports.py", line 236, in import_single_function_service
    module = importlib.import_module(function_def.module_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/root/experiment_template.py", line 16, in <module>
    from pipeline_v2.steps.easy_ocr_pages_step import EasyOCRPagesStep
  File "/root/pipeline_v2/steps/easy_ocr_pages_step.py", line 10, in <module>
    reader = easyocr.Reader(["en"], gpu=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/easyocr/easyocr.py", line 92, in __init__
    detector_path = self.getDetectorPath(detect_network)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/easyocr/easyocr.py", line 253, in getDetectorPath
    download_and_unzip(self.detection_models[self.detect_network]['url'], self.detection_models[self.detect_network]['filename'], self.model_storage_directory, self.verbose)
  File "/usr/local/lib/python3.12/site-packages/easyocr/utils.py", line 628, in download_and_unzip
    urlretrieve(url, zip_path, reporthook=reporthook)
  File "/usr/local/lib/python3.12/urllib/request.py", line 240, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
                            ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 521, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 630, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 559, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 639, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error
Jun 17  12:41:45.301 | Runner failed with exception: <HTTPError 500: 'Internal Server Error'>


Any ideas what's wrong? Thanks!

antonkrasov avatar Jun 17 '25 19:06 antonkrasov