Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Paperless-ngx: 2.0.0: MissingDependencyError: gs #4696

Closed
epcos71 opened this issue Nov 29, 2023 · 10 comments
Closed

[BUG] Paperless-ngx: 2.0.0: MissingDependencyError: gs #4696

epcos71 opened this issue Nov 29, 2023 · 10 comments
Labels
dependencies Pull requests that update a dependency file not a bug not a bug in paperless-ngx

Comments

@epcos71
Copy link

epcos71 commented Nov 29, 2023

Description

When I upload a new document by consume directory or upload dialog, the following error occurs and the upload did not happen:

[2023-11-29 10:36:45,951] [DEBUG] [paperless.parsing.tesseract] Calling OCRmyPDF with args: {'input_file': PosixPath('/tmp/paperless/paperless-ngxj6di44a5/Vorgabedokumente Prozess.pdf'), 'output_file': PosixPath('/tmp/paperless/paperless-zssxqkea/archive.pdf'), 'use_threads': True, 'jobs': 4, 'language': 'deu', 'output_type': 'pdfa', 'progress_bar': False, 'skip_text': True, 'clean': True, 'deskew': True, 'rotate_pages': True, 'rotate_pages_threshold': 12.0, 'sidecar': PosixPath('/tmp/paperless/paperless-zssxqkea/sidecar.txt')}

[2023-11-29 10:36:46,057] [ERROR] [paperless.consumer] Error occurred while consuming document Vorgabedokumente Prozess.pdf: MissingDependencyError: gs

Traceback (most recent call last):

  File "/opt/paperless/src/paperless_tesseract/parsers.py", line 321, in parse

    ocrmypdf.ocr(**args)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/api.py", line 374, in ocr

    check_options(options, plugin_manager)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/_validation.py", line 248, in check_options

    _check_plugin_options(options, plugin_manager)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/_validation.py", line 241, in _check_plugin_options

    plugin_manager.hook.check_options(options=options)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_hooks.py", line 493, in __call__

    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py", line 115, in _hookexec

    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 113, in _multicall

    raise exception.with_traceback(exception.__traceback__)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 77, in _multicall

    res = hook_impl.function(*args)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/builtin_plugins/ghostscript.py", line 51, in check_options

    check_external_program(

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/subprocess/__init__.py", line 341, in check_external_program

    raise MissingDependencyError(program)

ocrmypdf.exceptions.MissingDependencyError: gs

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/opt/paperless/src/documents/consumer.py", line 441, in try_consume_file

    document_parser.parse(self.path, mime_type, self.filename)

  File "/opt/paperless/src/paperless_tesseract/parsers.py", line 388, in parse

    raise ParseError(f"{e.__class__.__name__}: {e!s}") from e

documents.parsers.ParseError: MissingDependencyError: gs

Steps to reproduce

  1. Upload a new document (e.g. pdf)
  2. Check the protocoll

Webserver logs

[2023-11-29 10:36:45,951] [DEBUG] [paperless.parsing.tesseract] Calling OCRmyPDF with args: {'input_file': PosixPath('/tmp/paperless/paperless-ngxj6di44a5/Vorgabedokumente Prozess.pdf'), 'output_file': PosixPath('/tmp/paperless/paperless-zssxqkea/archive.pdf'), 'use_threads': True, 'jobs': 4, 'language': 'deu', 'output_type': 'pdfa', 'progress_bar': False, 'skip_text': True, 'clean': True, 'deskew': True, 'rotate_pages': True, 'rotate_pages_threshold': 12.0, 'sidecar': PosixPath('/tmp/paperless/paperless-zssxqkea/sidecar.txt')}

[2023-11-29 10:36:46,057] [ERROR] [paperless.consumer] Error occurred while consuming document Vorgabedokumente Prozess.pdf: MissingDependencyError: gs

Traceback (most recent call last):

  File "/opt/paperless/src/paperless_tesseract/parsers.py", line 321, in parse

    ocrmypdf.ocr(**args)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/api.py", line 374, in ocr

    check_options(options, plugin_manager)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/_validation.py", line 248, in check_options

    _check_plugin_options(options, plugin_manager)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/_validation.py", line 241, in _check_plugin_options

    plugin_manager.hook.check_options(options=options)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_hooks.py", line 493, in __call__

    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py", line 115, in _hookexec

    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 113, in _multicall

    raise exception.with_traceback(exception.__traceback__)

  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 77, in _multicall

    res = hook_impl.function(*args)

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/builtin_plugins/ghostscript.py", line 51, in check_options

    check_external_program(

  File "/usr/local/lib/python3.9/dist-packages/ocrmypdf/subprocess/__init__.py", line 341, in check_external_program

    raise MissingDependencyError(program)

ocrmypdf.exceptions.MissingDependencyError: gs

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/opt/paperless/src/documents/consumer.py", line 441, in try_consume_file

    document_parser.parse(self.path, mime_type, self.filename)

  File "/opt/paperless/src/paperless_tesseract/parsers.py", line 388, in parse

    raise ParseError(f"{e.__class__.__name__}: {e!s}") from e

documents.parsers.ParseError: MissingDependencyError: gs

Browser logs

No response

Paperless-ngx version

2.0.0

Host OS

Proxmox LXC Ubunutu 23.0.4 (Upgrade from 1.17.4 via Proxmox Helper Script: https://tteck.github.io/Proxmox/)

Installation method

Other (please describe above)

Browser

No response

Configuration changes

No response

Other

No response

@epcos71 epcos71 added bug Bug report or a Bug-fix unconfirmed labels Nov 29, 2023
@epcos71 epcos71 changed the title [BUG] Paperless-ngx: 2.0.0: MissingDependencyError: gs Pa [BUG] Paperless-ngx: 2.0.0: MissingDependencyError: gs Nov 29, 2023
@stumpylog
Copy link
Member

Ocrmypdf thinks you are missing ghostscript. Are you? If you're not, make sure it's on the path, then I refer you to their issues for further help.

@epcos71
Copy link
Author

epcos71 commented Nov 29, 2023

It worked fine before i did the update from 1.17.4., so I think it is set properly. How can I check this?

@stumpylog
Copy link
Member

Get a bash or other shell inside the container. Does running gs or which gs work? Is it listed in dpkg -l

@stumpylog stumpylog added cant-reproduce and removed bug Bug report or a Bug-fix unconfirmed labels Nov 29, 2023
@epcos71
Copy link
Author

epcos71 commented Nov 29, 2023

yes, both work.

root@paperless-dm2:~# gs
GPL Ghostscript 9.53.3 (2020-10-01)
Copyright (C) 2020 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
GS>^C
root@paperless-dm2:~# which gs
/usr/bin/gs

@Dabylpmis
Copy link

I got exactly the same error after updating to 2.0.0. I checked paperless.conf
#PAPERLESS_GS_BINARY=/usr/bin/gs
It is commented out, but changes nothing when uncommented. According to which gs path is correct.

@stumpylog
Copy link
Member

Per their requirements, ocrmypdf requires Ghostscript 9.55 or newer at this time. So 9.53.3 is not a supported version.

@stumpylog stumpylog added dependencies Pull requests that update a dependency file not a bug not a bug in paperless-ngx and removed cant-reproduce labels Nov 29, 2023
@stumpylog stumpylog closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2023
@epcos71
Copy link
Author

epcos71 commented Nov 29, 2023

Fun Fact: Version 1.74.4 also worked with 9.53.3, so I don't think it is the reason.

@stumpylog
Copy link
Member

ocrmypdf was updated from ~14 to ~15, which included "Tightened version requirements for some dependencies" and "Generally speaking, Ubuntu 22.04 is our new baseline system". Jammy provides Ghostscript 9.55

@t0rb3n
Copy link

t0rb3n commented Nov 30, 2023

@epcos71 Not sure if you solved it by now but updating the container to Debian 12 and running the update script again solved the issue for me. See my comment

Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file not a bug not a bug in paperless-ngx
Projects
None yet
Development

No branches or pull requests

4 participants