Problem installing paperless-ngx

Hi all, im trying to install paperless-ngx in a jail.
I have found this guide:

so

  • i have create a base jail 13.2, assigning an ip
  • activate ssh to log from putty
  • create a file preinstall.sh with the ony dependency install, mentioned in the link
  • chmod +x preinstall.sh
  • ./preinstall.sh
  • portsnap fetch extract
  • cd /usr/ports/deskutils/py-paperless-ngx && make install
  • after that, install go in error due to dependency wrong, so i manually pkg install lang/tcl86 e pkg install unit-perl5.36-1.32.0
  • again cd /usr/ports/deskutils/py-paperless-ngx && make install

and in this point, the installation continue a lot, downloading a lot of GB of data… is supposed to act like this or im making a big mistake on install?

Not being available on FreeBSD 13.x (only 14.x, and later 15.x), is one of the reasons why TrueNAS Core being frozen on a “maintenance mode” limits the user’s software availability. :face_with_diagonal_mouth:

As @dan put it: Core is left to die on the vine.

Ideally, Core would be based on FreeBSD 14.x, with jails likewise at 14.1.

So it becomes self-fulfilling: Someone like you has to side-grade to SCALE just to use software that would otherwise be available if Core’s base was kept up-to-date. Then it’s marketed as “See? More and more users are adopting SCALE, with few of them showing interest in Core!”

Well no kidding! You don’t say. Color me shocked. :wink:

1 Like

The make install command takes a long time with some softwares so you are probably on the right track.

*grabs popcorn. sits down for the show.*

FUD pitch: FreeBSD is dead! Long live, Linux!
Translation: We need to cut dev costs and Linux was a “good 'nuf replacement” (AKA: most users won’t be able to tell the difference).

Also, in other news, I created a makefile so I’m starting my own Linux distribution (it’s basically Debian without Emacs). Anyone have a good Logo and name?

the installation has been going on for I think 8 hours now… maybe is growing a lot but after complete i can clean a lot of files… but he will ever end? xD

30 GiB and counting…? :flushed: I have datasets with actual archives that are smaller than that.

30g seems big.

It’s been awhile but you can setup your make.conf file to cut down on builds (builds take a while). However, sometimes it’s hit or miss (helps or doesn’t) on some packages.

I’ll try to dig up some good defaults for the make.conf if you’re interested.
make.conf(5) (freebsd.org)

If you are compiling from source 30G is totally possible. Some of those dependencies can be huge when decompressed. Make sure to run a make clean after!

2 Likes

^ Probably right. Some of those deps are pretty nasty.

set DEPS_LIST="py39-pip py39-bleach py39-concurrent-log-handler \
  py39-dj42-django-cors-headers py39-dj42-django-filter py39-filelock \
  py39-gunicorn py39-h2 py39-hiredis py39-httptools py39-langdetect \
  py39-mysqlclient py39-ocrmypdf py39-pdftotext py39-psycopg2 \
  py39-python-dotenv py39-python-gnupg py39-python-magic \
  py39-setproctitle py39-sqlite3 py39-uvicorn py39-uvloop py39-watchfiles \
  py39-websockets py39-whitenoise py39-whoosh py39-yaml \
  gnupg liberation-fonts-ttf optipng tesseract unpaper \
  blas openblas cmake gcc13 poppler-utils zbar ImageMagick7"

as the guide mention, after a lot of work (36gb of jail ahahah) i encounter this error during install:

File "/usr/ports/math/py-numpy/work-py311/numpy-1.26.4/numpy/distutils/misc_ut                                                                                                                                                             il.py", line 93, in get_num_build_jobs
cpu_count = len(os.sched_getaffinity(0))
                ^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: could not allocate a large enough CPU set

i made the patch as described, but seems not work for me :face_in_clouds:

edit: patch doesn’t working because the dependency im using are different, and the code is different too… so i hardcode that and the install is continuing
Screenshot 2024-06-28 223537

i really don’t know what im doing :rofl:

edit2: encountered second error mentioned in the guide, but this time patch work. had to apply the hardcode cpu count on /usr/local/lib/python3.11/site-packages/joblib/externals/loky/backend/context.py too… im back installing :face_exhaling:

edit3: Install complete :alien: after

  • like 12 hours of work
  • 38gb of space
    Screenshot 2024-06-28 231642
  • 27gb of ram in use on services
  • 100% load on cpu for almost of the time
    This was better than e stresstest for my machine…

now i have to

Please see `man paperless-ngx’ for details on how to configure paperless.
hope is something i can handle.

obv i will run a make clean asap

after this long journey, some other dependency to install, and thanks to this setup guide, i managed to finally start the service

as the screenshot show, and the guide say, all seems fine… but in reality, something not working:
Screenshot 2024-06-29 154811

im stuck there, i could have login but nothing more.
Someone have some tips to share about configuration? Because for sure im missing some vital point.
This is my config file:

PAPERLESS_CONSUMPTION_DIR=/usr/src/consume
PAPERLESS_DATA_DIR=/usr/src/data
PAPERLESS_EMPTY_TRASH_DIR=/usr/src/trash
PAPERLESS_MEDIA_ROOT=/usr/src/media
PAPERLESS_STATICDIR=/usr/src/static
PAPERLESS_LOGGING_DIR=/usr/src/logs

PAPERLESS_SECRET_KEY=****

PAPERLESS_REDIS=redis://localhost:6379

PAPERLESS_DBENGINE=sqlite
PAPERLESS_OCR_LANGUAGE=ita
PAPERLESS_TIME_ZONE=Europe/Rome

i wanna update the thread, hoping can be usefull for someone else wanna try paperless in Core.
For me (that im not so expert) installing this software has been really a pain… but at the end im really close to the goal.
The bare metal install documentation really dont help, imho missing a lot of things that probably who write the doc omit because “basic knowledge”… but ok :upside_down_face:

The guide mentioned in the post has been really usefull for avoid the cpu overflow error… but all dependency mentioned ecc are deprecated.
The only working way for me has been install last port, wich all of the +30gb of dependency, that make spent a lot of time on compiling (my little cpu doesnt help too on this).
Encountered some dependency conflict too, some service missing… but at the end after some try i manage to end install.
The gui problem has been resolved keeping the static dir variable as default (neither recollecting things on the path i choose seems fix).
Encountered a lot of permission problem, fixed with a lot of patience everytime every time I stumbled upon it.
At the moment i manage to start succesfully the web server, but i have some problem to configure the autostart of celery.
I managed to import files from gui, but not to recognize my existing documents.
I will keep trying, and in case update the thread.
I’m trying to track the steps, so i can share with everyone needs help

excuse me for my english is not my native language

Hi, I’ve been wanting to run mumpless in TrueNas for quite a while, but I’ve only got it partially, there’s a thread in reddit with the instructions of an installation bare metal, even a script for it to start automatically, the problem with this method is that the installation works partly because it’s not possible to consume the documents that are uploaded to the folders, this because of a package that requires and does not exist in BSD (“inotify_init1”)

at the time I proposed the installation and function perfect to the exception of what I said earlier, currently I wanted to try again the installation but not to make it work I don’t know if I should update a few days ago TrueNas, finally remember also that there is a package in FreeBSD of existing paperless, it is version 2.7, I think they already go in version 2.10 but it works very well only that it doesn’t work the WebUI

pkg install py39-paperless

this installs all the dependency and other things that are needed without mistakes, after must do the migration with:

python3 manage.py migrate

Then we create the super user:

python3 manage.py createsuperuser

and finally we run the server:

python3 manage.py runserver 0.0.0.0:8000

We entered the ip of the jail and the port 8000 and we managed to see the management page, easily right? but I can’t lift the WebUI so I’m stuck, maybe you have more luck, greetings.

Link reddit

Manual py39-paperless package (FreeBSD)

hi, why dont you try the last port as me?
Ok, is not a fast install :upside_down_face: but at least seems working in a 13.2 jail. I tried the older version too gasping into dependencie conflict too much; maybe give it a try in another jail.
Im using the 311 python, and if im not missing anything just be careful on

  • lang/tcl86 missing
  • py311-setuptools-scm-8.0.4 & py311-setuptools_scm7-7.1.0 conflict
  • perl5 missing
  • /usr/ports/math/py-numpy/work-py311/numpy-1.26.4/numpy/distutils/misc_util.py → row 93 hardcode the function
    * /usr/local/lib/python3.11/site-packages/joblib/externals/loky/backend/context.py → row 188 hardcode the function
  • python3 missing :sweat_smile:
  • /usr/local/bin/python3.11 -m pip install django because django missing :sweat_smile:

Im still in “testing” progress, and actually i have those problems to resolve:

  • I didnt manage to put my data folder outside of the jail (only consume and media, via mount points), because isn’t empty as the other. There is a way to backup the sqllite db?
  • i have problem to automatically launch the celery service: if i run it manually it works perfectly for a certain amount of time… but he stop and need to do it again (not viable).
cd /usr/local/lib/python3.11/site-packages/paperless
sudo -u paperless /usr/local/bin/celery --app paperless worker --loglevel INFO &

What i have tried to fix this:

  • nano /usr/local/etc/rc.d/paperless_celery
  • chmod +x /usr/local/etc/rc.d/paperless_celery
  • sudo nano /etc/rc.conf → paperless_celery_enable="YES"

this is paperless_celery content

#!/bin/sh

PROVIDE: paperless_celery

REQUIRE: LOGIN

KEYWORD: shutdown

. /etc/rc.subr

name=“paperless_celery”
rcvar=“paperless_celery_enable”

load_rc_config $name

: ${paperless_celery_enable:=“NO”}
: ${paperless_celery_user:=“paperless”}
: ${paperless_celery_command:=“/usr/local/bin/celery”}
: ${paperless_celery_flags:=“–app paperless worker --loglevel INFO”}

pidfile=“/var/run/${name}.pid”
command=“/usr/sbin/daemon”

start_cmd=“${name}_start”
stop_cmd=“${name}_stop”

paperless_celery_start() {
echo “Starting ${name}.”
/usr/bin/su -m ${paperless_celery_user} -c “${paperless_celery_command} ${paperless_celery_flags}” &
echo $! > ${pidfile}
}

paperless_celery_stop() {
echo “Stopping ${name}.”
pkill -f “${paperless_celery_command}”
rm -f ${pidfile}
}

run_rc_command “$1”

Screenshot 2024-07-06 085557

as you can see it doens work like manual start and i can’t understand why

#Edit: celery not consumer, i paste wrongs commandos sorry

Hello hello, good news

Perform the installation (bar metal) of the reddit guide again but with version 3.11 of python instead of the 3.9 they use in the guide, also use the latest version of paperless 2.10.2 and the most current release of TrueNas version 13.3, the result was successful with some details that I share with you:

-I have not been able to configure the service script so that it always runs, I don’t know why it is because I only changed the version of python but in short I think it is the least of the problems

-You say that the celery service stops from time to time, could you give me a time reference to test since I don’t always have my TrueNas on, I only turn it on when I use it, I have left the server on for about 3 hours and the service is still on. functioning so I don’t know if I have the same problem that you have.

-I have a permissions error that I have not been able to solve and it does not allow me to consume the documents. The error is as follows:

The big problem with a different version of python is the dependencies, since some are deprecated or have changed names slightly, but well it worked better for me than with the version they used on reddit, finally if you know how to solve the permissions problem I will thank you for a little feedback, thank you very much and greetings

1 Like

Hi buddy, glad that you are making it works better than me!
I will try to see the steps on the guide u follow, for see if i have miss something!
For me, celery stop working if i leave shell and try to consume a document.
For your problem:

i clearly remember to have encounter the same exactly error on jbig2, but i dont find the specific command i have used for fix it… for sure was assigning the permission to the paperless user on a folder, but i can’t remember what folder… (i have saved sudo chmod a+w /var/empty but i think was for the collectstatic) can you paste the complete error? I only remember that i pick the right folder from the error stack

Well I think I just broke down what I had, I was uninstalling and installing packages like an idiot, it was my fault now it gives me a gs error, I’m going to do a clean installation again copying all the packages I installed to make a guide and share it with you Maybe between the two of us we will be able to make it work once and for all, in any case I share the error message:

[2024-07-08 14:26:14,144] [ERROR] [paperless.tasks] ConsumeTaskPlugin failed: Examen_Desarrollo.pdf: Error occurred while consuming document Examen_Desarrollo.pdf: PermissionError: [Errno 13] Permission denied: 'gs'

Traceback (most recent call last):

  File "/usr/home/paperless/paperless-ngx/src/paperless_tesseract/parsers.py", line 368, in parse

    ocrmypdf.ocr(**args)

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/api.py", line 379, in ocr

    check_options(options, plugin_manager)

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_validation.py", line 237, in check_options

    _check_plugin_options(options, plugin_manager)

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_validation.py", line 230, in _check_plugin_options

    plugin_manager.hook.check_options(options=options)

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_hooks.py", line 513, in __call__

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

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_manager.py", line 120, in _hookexec

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

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_callers.py", line 139, in _multicall

    raise exception.with_traceback(exception.__traceback__)

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_callers.py", line 103, in _multicall

    res = hook_impl.function(*args)

          ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/builtin_plugins/ghostscript.py", line 53, in check_options

    check_external_program(

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/subprocess/__init__.py", line 324, in check_external_program

    found_version = version_checker()

                    ^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_exec/ghostscript.py", line 72, in version

    return Version(get_version(GS))

                   ^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/subprocess/__init__.py", line 158, in get_version

    proc = run(

           ^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/subprocess/__init__.py", line 62, in run

    proc = subprocess_run(args, env=env, check=check, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/subprocess.py", line 548, in run

    with Popen(*popenargs, **kwargs) as process:

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/subprocess.py", line 1026, in __init__

    self._execute_child(args, executable, preexec_fn, close_fds,

  File "/usr/local/lib/python3.11/subprocess.py", line 1955, in _execute_child

    raise child_exception_type(errno_num, err_msg, err_filename)

PermissionError: [Errno 13] Permission denied: 'gs'

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

Traceback (most recent call last):

  File "/home/paperless/.local/lib/python3.11/site-packages/asgiref/sync.py", line 349, in main_wrap

    raise exc_info[1]

  File "/usr/home/paperless/paperless-ngx/src/documents/consumer.py", line 577, in run

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

  File "/usr/home/paperless/paperless-ngx/src/paperless_tesseract/parsers.py", line 435, in parse

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

documents.parsers.ParseError: PermissionError: [Errno 13] Permission denied: 'gs'

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

Traceback (most recent call last):

  File "/usr/home/paperless/paperless-ngx/src/documents/tasks.py", line 151, in consume_file

    msg = plugin.run()

          ^^^^^^^^^^^^

  File "/usr/home/paperless/paperless-ngx/src/documents/consumer.py", line 608, in run

    self._fail(

  File "/usr/home/paperless/paperless-ngx/src/documents/consumer.py", line 302, in _fail

    raise ConsumerError(f"{self.filename}: {log_message or message}") from exception

documents.consumer.ConsumerError: Examen_Desarrollo.pdf: Error occurred while consuming document Examen_Desarrollo.pdf: PermissionError: [Errno 13] Permission denied: 'gs'

P.S.
I feel like we are close to success friend, we are close xD

try this:

sudo chmod +x /usr/local/lib/python3.11/site-packages/paperless/documents/consumer.py

just fix your path, i didnt use a symlink :sweat_smile:

sudo chmod +x /usr/home/paperless/paperless-ngx/src/documents/consumer.py

How do you set your script for the webserver?

Buddy, i fix something and broke something else xD

cd /usr/local/lib/python3.11/site-packages/paperless
/usr/local/bin/celery --app paperless worker --loglevel INFO & && /usr/local/bin/celery --app paperless beat --loglevel INFO &

Celery now seems not stop working, after i leave shell and upload a document (
But still not autostart from the web_server script, so if i stop or restart jail, should run this manually).
Despite i have error 500 on every preview of document, dont know why

[2024-07-09 14:54:33,662] [ERROR] [paperless.api] System status detected a possible problem while loading the classifier: Classifier file does not exist (yet). Re-training may be pending.

Traceback (most recent call last):

File “/usr/local/lib/python3.11/site-packages/paperless/documents/views.py”, line 1690, in get

raise FileNotFoundError(classifier_error)

FileNotFoundError: Classifier file does not exist (yet). Re-training may be pending.

EDIT: nvm, file permission issue, just running
chown -R paperless:paperless /var/db/paperless/media
solve… but really not so comfortable

Well, I was finally able to document all the packages and dependencies for python3.11. I want to share with you my progress to be able to better guide us to the solution since I believe that the way you did the installation is different from mine and that could give us different approaches. Firstly, I will share the installation steps with you:

-Jail 13.3-RELEASE-p4 (TrueNas)
-Python3.11
-Paperless 2.10.2

I leave you the commands, there should be no failure when trying to follow them:

### Actualizando sistema

pkg update
pkg upgrade


### Instalacion de paquetes:

pkg install cmake expect gcc ghostscript10 git gnupg icc-profiles-adobe-cs4 icc-profiles-basiccolor icc-profiles-openicc ImageMagick7-nox11 leptonica liberation-fonts-ttf libxslt libxml2 lzlib mime-support pngquant poppler-utils qpdf redis rust sqlite sqlite3 tesseract tesseract-data unpaper zbar zlib-ng zxing-cpp python311 py311-setuptools py311-wheel py311-numpy py311-cython openblas py311-gdbm py311-sqlite3 py311-tkinter

### Creacion de usuario y carpetas

pw groupadd paperless
pw useradd paperless -g paperless -s /bin/sh
mkdir -p /usr/home/paperless
chown -R paperless:paperless /usr/home/paperless
ln -sf /usr/home /home
install -g paperless -o paperless -d /usr/home/paperless/media
install -g paperless -o paperless -d /usr/home/paperless/data
install -g paperless -o paperless -d /usr/home/paperless/consume
install -g paperless -o paperless -d /usr/home/paperless/static
install -g paperless -o paperless -d /usr/home/paperless/trash


## ImageMagick
sed -i "" -e '/PDF/s/rights="none"/rights="read|write"/' /usr/local/etc/ImageMagick-7/policy.xml


## Redis
service redis enable
service redis start

## Paperless Fetch & Extract
fetch https://github.com/paperless-ngx/paperless-ngx/releases/download/v2.10.2/paperless-ngx-v2.10.2.tar.xz
tar -xvzf paperless-ngx-v2.10.2.tar.xz
mv paperless-ngx /usr/home/paperless
cd /usr/home/paperless/paperless-ngx

### Configuracion de paperless

ee paperless.conf

PAPERLESS_REDIS=redis://localhost:6379
PAPERLESS_DBENGINE=sqlite
PAPERLESS_CONSUMPTION_DIR=/usr/home/paperless/consume
PAPERLESS_DATA_DIR=/usr/home/paperless/data
PAPERLESS_TRASH_DIR=/usr/home/paperless/trash
PAPERLESS_MEDIA_ROOT=/usr/home/paperless/media
PAPERLESS_SECRET_KEY=Xyfd4Frfdfg4GFdo0Z0ny5c3
PAPERLESS_OCR_LANGUAGE=spa
PAPERLESS_CONVERT_BINARY=/usr/local/bin/convert
PAPERLESS_GS_BINARY=/usr/local/bin/gs
PAPERLESS_TIME_ZONE='America/Mexico_City'

### Intalacion de pip y configuracion de enlaces simbolicos

python3.11 -m ensurepip
python3.11 -m ensurepip --upgrade

ln -s /usr/local/bin/python3.11 /usr/local/bin/python3
ln -s /usr/local/bin/pip3.11 /usr/local/bin/pip3


### Paquetes pip dentro del usuario "paperless"

su - paperless

pip3 install anyio asgiref==3.7.2 channels channels-redis click click-didyoumean click-plugins click-repl concurrent-log-handler dateparser  django-celery-results django-compression-middleware django-filter django-extensions django-guardian djangorestframework-guardian flower imap-tools inotifyrecursive pathvalidate pdf2image python-ipware pyzbar tika-client drf-writable-nested django-multiselectfield python-dotenv whitenoise django-cors-headers django-allauth django-auditlog django-soft-delete python-magic filelock langdetect packaging tqdm whoosh pikepdf img2pdf python-gnupg setuptools wheel watchdog ocrmypdf

**CASO ESPECIAL (tarda en instalarse como 1h 30m)
pip3 install git+https://github.com/scikit-learn/scikit-learn.git


#### Setup

cd /usr/home/paperless/paperless-ngx/src
/usr/local/bin/python3 manage.py migrate
/usr/local/bin/python3 manage.py createsuperuser
/usr/local/bin/python3 manage.py runserver


#### Iniciar y probar servicios

python3 manage.py runserver 0.0.0.0:8000
python3 manage.py document_consumer
python3 -m celery --app paperless worker --loglevel INFO
python3 -m celery --app paperless beat --loglevel INFO


### Ejecutar todos los servicios en segundo plano

su - paperless
cd /usr/home/paperless/paperless-ngx/src
/usr/local/bin/python3 manage.py runserver 0.0.0.0:8000 &
/usr/local/bin/python3 manage.py document_consumer &
/usr/local/bin/python3 -m celery --app paperless worker --loglevel INFO &
/usr/local/bin/python3 -m celery --app paperless beat --loglevel INFO &

Finally the error when trying to upload a file is:

[2024-07-09 10:07:35,758] [ERROR] [paperless.tasks] ConsumeTaskPlugin failed: Examen_Desarrollo.pdf: Error occurred while consuming document Examen_Desarrollo.pdf: PermissionError: [Errno 13] Permission denied: 'jbig2'

Traceback (most recent call last):

  File "/usr/home/paperless/paperless-ngx/src/paperless_tesseract/parsers.py", line 368, in parse

    ocrmypdf.ocr(**args)

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/api.py", line 380, in ocr

    return run_pipeline(options=options, plugin_manager=plugin_manager)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_pipelines/ocr.py", line 223, in run_pipeline

    return _run_pipeline(options, plugin_manager)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_pipelines/ocr.py", line 190, in _run_pipeline

    optimize_messages = exec_concurrent(context, executor)

                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_pipelines/ocr.py", line 145, in exec_concurrent

    pdf, messages = postprocess(pdf, context, executor)

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_pipelines/_common.py", line 427, in postprocess

    return optimize_pdf(pdf_out, context, executor)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_pipeline.py", line 979, in optimize_pdf

    output_pdf, messages = context.plugin_manager.hook.optimize_pdf(

                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_hooks.py", line 513, in __call__

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

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_manager.py", line 120, in _hookexec

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

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_callers.py", line 139, in _multicall

    raise exception.with_traceback(exception.__traceback__)

  File "/home/paperless/.local/lib/python3.11/site-packages/pluggy/_callers.py", line 103, in _multicall

    res = hook_impl.function(*args)

          ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/builtin_plugins/optimize.py", line 151, in optimize_pdf

    'jbig2': jbig2enc.available(),

             ^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_exec/jbig2enc.py", line 22, in available

    version()

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/_exec/jbig2enc.py", line 17, in version

    return Version(get_version('jbig2', regex=r'jbig2enc (\d+(\.\d+)*).*'))

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/subprocess/__init__.py", line 158, in get_version

    proc = run(

           ^^^^

  File "/home/paperless/.local/lib/python3.11/site-packages/ocrmypdf/subprocess/__init__.py", line 62, in run

    proc = subprocess_run(args, env=env, check=check, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/subprocess.py", line 548, in run

    with Popen(*popenargs, **kwargs) as process:

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/subprocess.py", line 1026, in __init__

    self._execute_child(args, executable, preexec_fn, close_fds,

  File "/usr/local/lib/python3.11/subprocess.py", line 1955, in _execute_child

    raise child_exception_type(errno_num, err_msg, err_filename)

PermissionError: [Errno 13] Permission denied: 'jbig2'

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

Traceback (most recent call last):

  File "/home/paperless/.local/lib/python3.11/site-packages/asgiref/sync.py", line 349, in main_wrap

    raise exc_info[1]

  File "/usr/home/paperless/paperless-ngx/src/documents/consumer.py", line 577, in run

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

  File "/usr/home/paperless/paperless-ngx/src/paperless_tesseract/parsers.py", line 435, in parse

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

documents.parsers.ParseError: PermissionError: [Errno 13] Permission denied: 'jbig2'

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

Traceback (most recent call last):

  File "/usr/home/paperless/paperless-ngx/src/documents/tasks.py", line 151, in consume_file

    msg = plugin.run()

          ^^^^^^^^^^^^

  File "/usr/home/paperless/paperless-ngx/src/documents/consumer.py", line 608, in run

    self._fail(

  File "/usr/home/paperless/paperless-ngx/src/documents/consumer.py", line 302, in _fail

    raise ConsumerError(f"{self.filename}: {log_message or message}") from exception

documents.consumer.ConsumerError: Examen_Desarrollo.pdf: Error occurred while consuming document Examen_Desarrollo.pdf: PermissionError: [Errno 13] Permission denied: 'jbig2'
1 Like