text: Title: [BUG] Error occurred while consuming big pdf document SubprocessOutputError tesseract get_deskew
  Body: ### Description
  
  After I successfully imported loads of PDFs, I now try to upload a big PDF with 170 MB and 114 pages.
  
  After some minutes of processing an error appears when running tesseract.
  
  I already tried putting `'tesseract_timeout': 1800` which didn't help.
  
  I tried finding the `/tmp/ocrmypdf.io.2fpa9ots/000022_rasterize.png` to rerun the command on my own, but wasn't able to find it in any of the Paperless docker containers.
  
  ### Steps to reproduce
  
  Drag & Drop the PDF file into the web page and wait for the processing to run for a few minutes.
  
  ### Webserver logs
  
  ```bash
  [2025-02-08 17:09:52,920] [INFO] [paperless.consumer] Consuming 20250208_155934.PDF
  
  [2025-02-08 17:09:52,965] [DEBUG] [paperless.consumer] Detected mime type: application/pdf
  
  [2025-02-08 17:09:52,978] [DEBUG] [paperless.consumer] Parser: RasterisedDocumentParser
  
  [2025-02-08 17:09:52,980] [DEBUG] [paperless.consumer] Parsing 20250208_155934.PDF...
  
  [2025-02-08 17:09:53,027] [INFO] [paperless.parsing.tesseract] pdftotext exited 0
  
  [2025-02-08 17:09:53,132] [DEBUG] [paperless.parsing.tesseract] Calling OCRmyPDF with args: {'input_file': PosixPath('/tmp/paperless/paperless-ngx18j4guwj/20250208_155934.PDF'), 'output_file': PosixPath('/tmp/paperless/paperless-cmazb6rc/archive.pdf'), 'use_threads': True, 'jobs': '4', 'language': 'deu+eng', 'output_type': 'pdfa', 'progress_bar': False, 'color_conversion_strategy': 'RGB', 'skip_text': True, 'clean': True, 'deskew': True, 'rotate_pages': True, 'rotate_pages_threshold': 12.0, 'sidecar': PosixPath('/tmp/paperless/paperless-cmazb6rc/sidecar.txt'), 'tesseract_timeout': 1800}
  
  [2025-02-08 17:09:53,519] [INFO] [ocrmypdf._pipelines.ocr] Start processing 4 pages concurrently
  
  [2025-02-08 17:09:54,801] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:09:54,801] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:09:54,801] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:09:54,802] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:09:54,936] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:09:54,936] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:09:54,936] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:09:54,936] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:09:55,425] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 4.51 - no change
  
  [2025-02-08 17:09:55,444] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 15.13 - rotation appears correct
  
  [2025-02-08 17:10:20,990] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:10:20,990] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:10:20,990] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:10:20,990] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:10:21,361] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 11.87 - no change
  
  [2025-02-08 17:10:36,136] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 11.58 - no change
  
  [2025-02-08 17:10:41,760] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 11.87 - no change
  
  [2025-02-08 17:11:06,505] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 10.01 - no change
  
  [2025-02-08 17:11:39,599] [WARNING] [ocrmypdf._exec.tesseract] [tesseract] lots of diacritics - possibly poor OCR
  
  [2025-02-08 17:11:40,989] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 1.61 - no change
  
  [2025-02-08 17:11:50,335] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 11.64 - no change
  
  [2025-02-08 17:11:52,248] [WARNING] [ocrmypdf._exec.tesseract] [tesseract] lots of diacritics - possibly poor OCR
  
  [2025-02-08 17:11:53,194] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 6.17 - no change
  
  [2025-02-08 17:11:54,100] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 10.52 - no change
  
  [2025-02-08 17:12:09,975] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:12:09,976] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:12:09,976] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:12:09,976] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:12:30,485] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 10.14 - no change
  
  [2025-02-08 17:12:31,139] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Image too small to scale!! (2x36 vs min width of 3)
  
  [2025-02-08 17:12:31,139] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Line cannot be recognized!!
  
  [2025-02-08 17:12:31,139] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Image too small to scale!! (2x36 vs min width of 3)
  
  [2025-02-08 17:12:31,139] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Line cannot be recognized!!
  
  [2025-02-08 17:12:32,418] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:12:32,418] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:12:32,419] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:12:32,419] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:12:36,605] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 10.93 - no change
  
  [2025-02-08 17:12:39,684] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 6.72 - no change
  
  [2025-02-08 17:13:00,726] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 7.65 - no change
  
  [2025-02-08 17:13:14,728] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:13:14,728] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:13:14,728] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:13:14,728] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:13:18,729] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 11.09 - no change
  
  [2025-02-08 17:13:19,787] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:13:19,787] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Too few characters. Skipping this page
  
  [2025-02-08 17:13:19,787] [ERROR] [ocrmypdf._exec.tesseract] [tesseract] Error during processing.
  
  [2025-02-08 17:13:19,788] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 0.00 - no change
  
  [2025-02-08 17:13:23,342] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Empty page!!
  
  [2025-02-08 17:13:29,250] [INFO] [ocrmypdf._pipeline] page is facing ⇧, confidence 8.29 - no change
  
  [2025-02-08 17:13:29,592] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Empty page!!
  
  [2025-02-08 17:13:45,015] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Empty page!!
  
  [2025-02-08 17:13:45,015] [INFO] [ocrmypdf._exec.tesseract] [tesseract] Empty page!!
  
  [2025-02-08 17:14:04,896] [WARNING] [ocrmypdf._exec.tesseract] [tesseract] lots of diacritics - possibly poor OCR
  
  [2025-02-08 17:14:13,230] [DEBUG] [paperless.parsing.tesseract] Deleting directory /tmp/paperless/paperless-cmazb6rc
  
  [2025-02-08 17:14:13,242] [ERROR] [paperless.consumer] Error occurred while consuming document 20250208_155934.PDF: SubprocessOutputError: . See logs for more information.
  
  Traceback (most recent call last):
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_exec/tesseract.py", line 201, in get_deskew
  
      p = run(args_tesseract, stdout=PIPE, stderr=STDOUT, timeout=timeout, check=True)
  
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/subprocess/__init__.py", line 62, in run
  
      proc = subprocess_run(args, env=env, check=check, **kwargs)
  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/subprocess.py", line 571, in run
  
      raise CalledProcessError(retcode, process.args,
  
  subprocess.CalledProcessError: Command '['tesseract', '-l', 'deu+eng', '--psm', '2', '/tmp/ocrmypdf.io.2fpa9ots/000022_rasterize.png', 'stdout']' returned non-zero exit status 1.
  
  
  The above exception was the direct cause of the following exception:
  
  
  Traceback (most recent call last):
  
    File "/usr/src/paperless/src/paperless_tesseract/parsers.py", line 382, in parse
  
      ocrmypdf.ocr(**args)
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/api.py", line 380, in ocr
  
      return run_pipeline(options=options, plugin_manager=plugin_manager)
  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 214, in run_pipeline
  
      return _run_pipeline(options, plugin_manager)
  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 181, in _run_pipeline
  
      optimize_messages = exec_concurrent(context, executor)
  
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 117, in exec_concurrent
  
      executor(
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_concurrent.py", line 78, in __call__
  
      self._execute(
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/builtin_plugins/concurrency.py", line 144, in _execute
  
      result = future.result()
  
               ^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
  
      return self.__get_result()
  
             ^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
  
      raise self._exception
  
    File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 59, in run
  
      result = self.fn(*self.args, **self.kwargs)
  
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 78, in _exec_page_sync
  
      ocr_image_out, pdf_page_from_image_out, orientation_correction = process_page(
  
                                                                       ^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/_common.py", line 417, in process_page
  
      ocr_image, preprocess_out = make_intermediate_images(
  
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/_common.py", line 370, in make_intermediate_images
  
      preprocess_out = preprocess(
  
                       ^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/_common.py", line 340, in preprocess
  
      image = preprocess_deskew(image, page_context)
  
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipeline.py", line 595, in preprocess_deskew
  
      deskew_angle_degrees = ocr_engine.get_deskew(input_file, page_context.options)
  
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/builtin_plugins/tesseract_ocr.py", line 259, in get_deskew
  
      return tesseract.get_deskew(
  
             ^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_exec/tesseract.py", line 212, in get_deskew
  
      raise SubprocessOutputError() from e
  
  ocrmypdf.exceptions.SubprocessOutputError
  
  
  The above exception was the direct cause of the following exception:
  
  
  Traceback (most recent call last):
  
    File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 327, in main_wrap
  
      raise exc_info[1]
  
    File "/usr/src/paperless/src/documents/consumer.py", line 477, in run
  
      document_parser.parse(self.working_copy, mime_type, self.filename)
  
    File "/usr/src/paperless/src/paperless_tesseract/parsers.py", line 405, in parse
  
      raise ParseError(
  
  documents.parsers.ParseError: SubprocessOutputError: . See logs for more information.
  
  [2025-02-08 17:14:13,247] [ERROR] [paperless.tasks] ConsumeTaskPlugin failed: 20250208_155934.PDF: Error occurred while consuming document 20250208_155934.PDF: SubprocessOutputError: . See logs for more information.
  
  Traceback (most recent call last):
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_exec/tesseract.py", line 201, in get_deskew
  
      p = run(args_tesseract, stdout=PIPE, stderr=STDOUT, timeout=timeout, check=True)
  
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/subprocess/__init__.py", line 62, in run
  
      proc = subprocess_run(args, env=env, check=check, **kwargs)
  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/subprocess.py", line 571, in run
  
      raise CalledProcessError(retcode, process.args,
  
  subprocess.CalledProcessError: Command '['tesseract', '-l', 'deu+eng', '--psm', '2', '/tmp/ocrmypdf.io.2fpa9ots/000022_rasterize.png', 'stdout']' returned non-zero exit status 1.
  
  
  The above exception was the direct cause of the following exception:
  
  
  Traceback (most recent call last):
  
    File "/usr/src/paperless/src/paperless_tesseract/parsers.py", line 382, in parse
  
      ocrmypdf.ocr(**args)
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/api.py", line 380, in ocr
  
      return run_pipeline(options=options, plugin_manager=plugin_manager)
  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 214, in run_pipeline
  
      return _run_pipeline(options, plugin_manager)
  
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 181, in _run_pipeline
  
      optimize_messages = exec_concurrent(context, executor)
  
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 117, in exec_concurrent
  
      executor(
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_concurrent.py", line 78, in __call__
  
      self._execute(
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/builtin_plugins/concurrency.py", line 144, in _execute
  
      result = future.result()
  
               ^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
  
      return self.__get_result()
  
             ^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
  
      raise self._exception
  
    File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 59, in run
  
      result = self.fn(*self.args, **self.kwargs)
  
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/ocr.py", line 78, in _exec_page_sync
  
      ocr_image_out, pdf_page_from_image_out, orientation_correction = process_page(
  
                                                                       ^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/_common.py", line 417, in process_page
  
      ocr_image, preprocess_out = make_intermediate_images(
  
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/_common.py", line 370, in make_intermediate_images
  
      preprocess_out = preprocess(
  
                       ^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipelines/_common.py", line 340, in preprocess
  
      image = preprocess_deskew(image, page_context)
  
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_pipeline.py", line 595, in preprocess_deskew
  
      deskew_angle_degrees = ocr_engine.get_deskew(input_file, page_context.options)
  
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/builtin_plugins/tesseract_ocr.py", line 259, in get_deskew
  
      return tesseract.get_deskew(
  
             ^^^^^^^^^^^^^^^^^^^^^
  
    File "/usr/local/lib/python3.12/site-packages/ocrmypdf/_exec/tesseract.py", line 212, in get_deskew
  
      raise SubprocessOutputError() from e
  
  ocrmypdf.exceptions.SubprocessOutputError
  
  
  The above exception was the direct cause of the following exception:
  
  
  Traceback (most recent call last):
  
    File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 327, in main_wrap
  
      raise exc_info[1]
  
    File "/usr/src/paperless/src/documents/consumer.py", line 477, in run
  
      document_parser.parse(self.working_copy, mime_type, self.filename)
  
    File "/usr/src/paperless/src/paperless_tesseract/parsers.py", line 405, in parse
  
      raise ParseError(
  
  documents.parsers.ParseError: SubprocessOutputError: . See logs for more information.
  
  
  The above exception was the direct cause of the following exception:
  
  
  Traceback (most recent call last):
  
    File "/usr/src/paperless/src/documents/tasks.py", line 154, in consume_file
  
      msg = plugin.run()
  
            ^^^^^^^^^^^^
  
    File "/usr/src/paperless/src/documents/consumer.py", line 509, in run
  
      self._fail(
  
    File "/usr/src/paperless/src/documents/consumer.py", line 151, in _fail
  
      raise ConsumerError(f"{self.filename}: {log_message or message}") from exception
  
  documents.consumer.ConsumerError: 20250208_155934.PDF: Error occurred while consuming document 20250208_155934.PDF: SubprocessOutputError: . See logs for more information.
  ```
  
  ### Browser logs
  
  ```bash
  
  ```
  
  ### Paperless-ngx version
  
  2.14.5
  
  ### Host OS
  
  Ubuntu 22.04.5
  
  ### Installation method
  
  Docker - official image
  
  ### System status
  
  ```json
  
  ```
  
  ### Browser
  
  _No response_
  
  ### Configuration changes
  
  PAPERLESS_TIME_ZONE=Europe/Berlin
  PAPERLESS_OCR_LANGUAGE=deu+eng
  PAPERLESS_SECRET_KEY=XXX
  PAPERLESS_CONSUMER_RECURSIVE=true
  PAPERLESS_FILENAME_DATE_ORDER=DMY
  PAPERLESS_TASK_WORKERS=4
  PAPERLESS_THREADS_PER_WORKER=4
  PAPERLESS_OCR_USER_ARGS: '{"tesseract_timeout": 1800}'
  
  ### Please confirm the following
  
  - [x] I believe this issue is a bug that affects all users of Paperless-ngx, not something specific to my installation.
  - [x] This issue is not about the OCR or archive creation of a specific file(s). Otherwise, please see above regarding OCR tools.
  - [x] I have already searched for relevant existing issues and discussions before opening this report.
  - [x] I have updated the title field above with a concise description.