Problem installing paperless-ngx

The special case of:

pip3 install git+https://github.com/scikit-learn/scikit-learn.git

It is a package called scikit-learn

For some reason if I install it in the traditional way pip3 install scikit-learn gives me an error, however the way I installed it it installs correctly

Tomorrow i will follow your step, because im not confident on have the db inside the jail and wanna reinstall It again in any wayā€¦ And i can Say you something more!

I finally solved the problem with the help of your comments. What I did was grant the following permissions:


chown -R paperless:paperles /usr/home/paperless/paperless-ngx/src/documents/
chmod -R u+rwX /usr/home/paperless/paperless-ngx/src/documents/consumer.py

With this it is now possible to upload PDF files without problems:

Now I have problems with the .txt files:

  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: PaperlessTrueNas.txt: Unexpected error while consuming document PaperlessTrueNas.txt: cannot open resource

well I think we are making more progress, greetings and I hope you have better results, Iā€™m already tired of this installation

not so much, this morning i messed up with snapshot and i donk know how i lose 2 jailsā€¦ 1 was unused but the other was paperlessā€¦
So i take a long breath, and try to follow your steps: all fine until i gasp into a rust problem during the cripthography install.
Canā€™t resolve, iā€™m tryng to repeat the steps into a 13.3 release jail

Buddy, your instrucion above are sexy :crazy_face: :crazy_face:ā€¦ i manage to reinstall all in like 30 minutesā€¦ clean and clear, really thanks.
You really donā€™t know how much time i spent on install via portā€¦ an agony building all dependency.
I will make some other test and keep you updated

My friend, itā€™s nice to know that you were able to install without problems. I also suffered a lot at the time. Currently we only have the problem of consuming .txt files. I look forward to your tests, greetings

here i am.
Still have problem to setup the auto start of services on jail start, but nvm for now.
I have tested with success the consume of pdf, jpeg and png, on txt i have the same error as you: for me the cause is in that function
document_parser.get_thumbnail
the bare metal guide say

fonts-liberation for generating thumbnails for plain text files

but i see in the dependency we have liberation-fonts-ttf well installed (neither try *pkg install x11-fonts/liberation-fonts-ttf sort effect).

I really dont remember to have tried consume txt on the old port installation, but if im right ā†’ the pkg is the same, prob will fail the same

edit: probably im wrong. I check that those library can be involved

pdf2image
pyzbar
tika-client
python-magic

and they are all listed in your notesā€¦ so im again at starting point :disappointed_relieved:

I already have the scripts for autostart, I asked chatgpt for help hahahaha, I share them with you, I found an issue of the .txt consumption error on github but it is from the year 2020 and supposedly it was corrected for the next release that was already quite a few years ago, so I find myself lost again, greetings

ee /usr/local/etc/rc.d/paperless
#!/bin/sh
# PROVIDE: paperless
# REQUIRE: DAEMON redis
# KEYWORD: shutdown

. /etc/rc.subr

name="paperless"
rcvar="${name}_enable"
pidfile="/var/run/${name}.pid"
start_cmd="${name}_start"
stop_cmd="${name}_stop"

paperless_start() {
    echo "Starting paperless service" >> /var/log/paperless_service.log
    su - paperless -c '/usr/local/sbin/paperless'
}

paperless_stop() {
    echo "Stopping paperless service" >> /var/log/paperless_service.log
    kill $(cat ${pidfile})
}

load_rc_config $name
run_rc_command "$1"

ee /usr/local/sbin/paperless
#!/bin/sh
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 

sudo chmod +x /usr/local/etc/rc.d/paperless
sudo chmod +x /usr/local/sbin/paperless

sysrc paperless_enable="YES"
service paperless start

plain text files are not being consumed

I think the first script can be improved quite a bit using the daemon but honestly I donā€™t know anything about shellscripting

Hi buddy, i have resolved this issue.
I think can be considered a bug, because the configuration guide say it take that value as default, but he doenst.
Try the step above for fix (work for me):

cd /usr/home/paperless/paperless-ngx
nano paperless.conf
add --> PAPERLESS_THUMBNAIL_FONT_NAME=/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf

check if the path is correct for you.
Check if is enough, i have tried a lot of thing and maybe this cannot be resolutive alone (like permission ecc)

hint from here

edit: have a similar script too, but at jail restart he fail or dont loadā€¦ launching paperless service start as su paperless work fineā€¦ donā€™t know what im doing wrong maybe later ill post you

edit2: next step for me is configure Tika for consume office documents (doc, xls, ecc). Have you already tried?

The package is readily available for FreeBSD 13.

  1. Switch your package repo to ā€œlatestā€ instead of ā€œquarterlyā€:
mkdir -p /usr/local/etc/pkg/repos
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' > /usr/local/etc/pkg/repos/FreeBSD.conf
pkg update
  1. Then perform a pkg install py311-paperless-ngx

That should ā€œjust workā€.

Only downside: you must run FreeBSD 13.3 in your jail which implies that you upgrade your TrueNAS to the 13.3 BETA.

The FreeBSD 13 branch will be supported well into 2026 so there is nothing to worry about just yet. Itā€™s just TN CORE lagging behind FreeBSD EOL dates as usual.

Is a similar process as port, im wrong?
For me tooks a lot of time, a lot of dependency/permissions conflict to fix manually during the processā€¦ besides the step we mentioned above are fast and seems work well (excerpt for minor fix to apply).
Im running core 13.2 (not the last beta), jail seems working fine as 13.3 p4 (After fetch), couldnt have install on 13.2 jail due to a conflict i was not able tĆ² eesolve

A port compiles the software from scratch. Essentially ports are the way the packages are built. pkg install just installs the binary package and all dependencies in a couple of seconds, just like apt-get install on Linux would do.

So if you are not a developer, it is generally recommended to use packages.

1 Like

Some things like e.g. the daemon program wonā€™t work in a 13.3 jail on a TN 13.0/FreeBSD 13.1 host system.

If the paperless-ngx installation does not rely on that, you are probably fine. Other things might break in unexpected ways, though.

1 Like

Honestly, im bit confused (not for what you are saying) because i install 13-0-u6-2 update (for the ssh fix), and lose the possibility to create jails on 13.2-RELEASE-p9.
I canā€™t fetch the 13.2, only 13.3 is availableā€¦ but if you say is still brokeā€¦ What im missing :disguised_face:
The old jails are working (seems) fine

edit: maybe is daemon that not permit me to autostart paperless service?

That wasnā€™t caused by the TrueNAS update but by the fact that FreeBSD 13.2 is EOL since July 1st. TrueNAS CORE is again late with their update to a supported FreeBSD release.

Iā€™d recommend updating to the 13.3 BETA, so you can run FreeBSD 13.3 jails.

If you do not depend on having VNC work for VMs - which is the bug with the largest impact in the BETA release, currently.

Absolutely not, really thanks for have well explained to me that.
I willingly accept your advice, and i will update soon as possible to 13.3!

here i am, again :crazy_face:
i managed to install tika

###########
#### TIKA

pkg update
pkg install openjdk11 nano caddy
#pkg install curl #for test 
fetch https://dlcdn.apache.org/tika/2.9.2/tika-server-standard-2.9.2.jar

#configure caddy
mkdir /usr/local/etc/ssl
cd /usr/local/etc/ssl
nano certificate.crt
nano private.key
nano /usr/local/etc/caddy/Caddyfile

#-->
tika.***.cloud {
    tls /usr/local/etc/ssl/certificate.crt /usr/local/etc/ssl/private.key
    reverse_proxy localhost:9998 {
        header_down Referrer-Policy "strict-origin-when-cross-origin"
    }
}
#-->

nano /etc/rc.conf
--> caddy_enable="YES"
service caddy start

java -jar tika-server-standard-2.9.2.jar &

##to do: autostart

and gotenberg

#########
##Gotenberg
pkg update
pkg install go git nano caddy chromium pkg install p5-Image-ExifTool pkg install libreoffice unoconv pdftk qpdf

git clone https://github.com/gotenberg/gotenberg.git
cd gotenberg
go build -o gotenberg ./cmd/gotenberg

#configure caddy
mkdir /usr/local/etc/ssl
cd /usr/local/etc/ssl
nano certificate.crt
nano private.key
nano /usr/local/etc/caddy/Caddyfile

#-->
gotenberg.mydomain.com {
    tls /usr/local/etc/ssl/certificate.crt /usr/local/etc/ssl/private.key
    reverse_proxy localhost:9998
}
#-->

nano /etc/rc.conf
--> caddy_enable="YES"
service caddy start

cd gotenberg
# check path with pkg info -l *
setenv CHROMIUM_BIN_PATH /usr/local/bin/chrome
setenv EXIFTOOL_BIN_PATH /usr/local/bin/exiftool
setenv LIBREOFFICE_BIN_PATH /usr/local/bin/soffice
setenv UNOCONVERTER_BIN_PATH /usr/local/bin/unoconv
setenv PDFTK_BIN_PATH /usr/local/bin/pdftk
setenv QPDF_BIN_PATH /usr/local/bin/qpdf

./gotenberg &
#to do:autostart

so i back to paperless, install caddy (for reverse proxy, im not familiar with nginx)

nano /usr/home/paperless/paperless-ngx/paperless.conf
PAPERLESS_TIKA_ENABLED=true
PAPERLESS_TIKA_ENDPOINT=https://tika.**.cloud
PAPERLESS_TIKA_GOTENBERG_ENDPOINT=https://gotenberg.**.cloud
PAPERLESS_URL=https://paperless.**.cloud

su-paperless 
pip3 install gotenberg-client

sudo nano /etc/hosts
#add binding if name not resolve...

and restart Paperless.

Now im stuck there:

Could not parse /tmp/paperless/paperless-ngxwxgaifat/01 - myfile.docx with tika server at https://tika.***.cloud: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

testing manually a curl from paperless jail to tika works, the crt installed is the same on both (is a wildcard)

Incredible, I never thought that the solution would be on that side of the configuration, it worked perfectly for me, I love it haha, the route for my particular case was:

/usr/local/share/fonts/Liberation/LiberationsSerif-Regular.ttf

I greatly appreciate the feedback,

I havenā€™t tried it but it sounds like something quite exciting hehe, let me look for something about it

Hello friend, I donā€™t understand this part very well. Do you install tika, caddy and gotenberg? Thatā€™s right, tika is for consuming office files, gotenberg what is it for? and caddy is a reverse proxy right? Donā€™t you think itā€™s better to start with one service at a time to rule out errors, or are those three services necessary as a whole? Let me read the official documentation a little and do tests.