Paperless doesn't start

What app is this about, and its version: paperless-ngx 2.17.1~ynh1
What YunoHost version are you running: 12.1.37 (stable)
What type of hardware are you using: Virtual machine

Describe your issue

I see this error messages on the app detail page:

Ein Fehler verhindert die Anzeige des Konfigurationsfensters:
Konnte die Werte des Konfigurations-Panels nicht auslesen.
Bitte leiten Sie diesen Fehler an das YunoHost-Team zu dessen Behebung weiter!

It’s from here:

Share relevant logs or error messages

Seems it comes from a broken update: https://paste.yunohost.org/raw/unedulicif

The app can be upgraded from version 2.17.1~ynh1 to 2.20.3~ynh1

paperless app is not listed on: `/yunohost/admin/#/services`

See also: upgraded from version 2.17.1~ynh1 to 2.20.3~ynh1 is broken · Issue #219 · YunoHost-Apps/paperless-ngx_ynh · GitHub

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

I try to fix it now, again…

First error was:

Warning: File or folder '/var/www/paperless-ngx' to be backed up does not exist
Error: Failed to collect files to backed up for paperless-ngx.

So i just mkdir it and tried again…

Then it ends with:

Warning: /var/cache/yunohost/app_tmp_work_dirs/app_0qm7yfeh/scripts/backup: line 19: data_dir: unbound variable
Error: Failed to collect files to backed up for paperless-ngx.

Seems i have a good last backup without any loss data:

root@YunoHost:~# find /home/yunohost.app/paperless-ngx/ -type f -printf '%TY-%Tm-%Td %TH:%TM %p\n' | sort -nr | head -n 5
2025-12-22 16:04 /home/yunohost.app/paperless-ngx/data/log/paperless.log
2025-12-22 16:04 /home/yunohost.app/paperless-ngx/data/log/celery.log
2025-12-22 16:04 /home/yunohost.app/paperless-ngx/data/celerybeat-schedule.db.db
2025-12-22 16:00 /home/yunohost.app/paperless-ngx/data/log/mail.log
2025-12-22 15:57 /home/yunohost.app/paperless-ngx/media/media.lock

root@YunoHost:~# find /home/yunohost.backup/archives/ -type f -printf '%TY-%Tm-%Td %TH:%TM %p\n' | grep paperless | sort -nr | head -n 5
2025-12-22 16:04 /home/yunohost.backup/archives/paperless-ngx-pre-upgrade1.tar.gz
2025-12-22 16:04 /home/yunohost.backup/archives/paperless-ngx-pre-upgrade1.info.json

So last changed file is from 2025-12-22 16:04 as the last backup of v2.17.1~ynh1.

So i try to deinstall the app and restore 2.17.1~ynh1 from the backup. Hope that fixed the issues.

EDIT: This works: Now i have a running 2.17.1~ynh1 back … No i will create a normal backup and try to upgrade…

EDIT2: upgraded from version 2.17.1~ynh1 to 2.20.3~ynh1 doesn’t work, because PostgreSQL 14 is needed, see:

...
Warning:   File "/var/www/paperless-ngx/venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 398, in init_connection_state
Warning:     super().init_connection_state()
Warning:   File "/var/www/paperless-ngx/venv/lib/python3.11/site-packages/django/db/backends/base/base.py", line 225, in init_connection_state
Warning:     self.check_database_version_supported()
Warning:   File "/var/www/paperless-ngx/venv/lib/python3.11/site-packages/django/db/backends/base/base.py", line 201, in check_database_version_supported
Warning:     raise NotSupportedError(
Warning: django.db.utils.NotSupportedError: PostgreSQL 14 or later is required (found 13.20).
Error: Failed to upgrade paperless-ngx: An error occurred inside the app upgrade script

So i assume 2.20.3~ynh1 doesn’t work with

EDIT3: Hm! In YunoHost v12.1 with bookworm Postgres v15 and v16 should be available… And it’s installed:

root@YunoHost:~# apt list --installed 'postgresql-*'
Listing... Done
postgresql-13/now 13.20-0+deb11u1 amd64 [installed,local]
postgresql-15/oldstable,now 15.14-0+deb12u1 amd64 [installed]
postgresql-16-pgvector/now 0.8.1-2.pgdg12+1 amd64 [installed,local]
postgresql-16/now 16.11-1.pgdg12+1 amd64 [installed,local]
postgresql-client-13/now 13.20-0+deb11u1 amd64 [installed,local]
postgresql-client-15/oldstable,now 15.14-0+deb12u1 amd64 [installed,automatic]
postgresql-client-16/now 16.11-1.pgdg12+1 amd64 [installed,local]
postgresql-client-common/now 264.pgdg110+1 all [installed,local]
postgresql-common/now 264.pgdg110+1 all [installed,local]
postgresql-contrib/oldstable,now 15+248+deb12u1 all [installed,automatic]

root@YunoHost:~# pg_config --version
PostgreSQL 16.11 (Debian 16.11-1.pgdg12+1)

root@YunoHost:~# psql --version
psql (PostgreSQL) 16.11 (Debian 16.11-1.pgdg12+1)

So what’s the problem here?!?

1 Like

Hello @jedie
From your last log, this does seem to be the same problem I had in my issue that you linked to.
The way I solved this is by running as root the following commands:

cd /var/www/paperless-ngx
source venv/bin/activate
pip uninstall psycopg-c
pip install -r requirements.txt

I hope this helps!

Best,
–waz

1 Like

I had the same kind of problem.
I used your solution.
It works perfectly.

Thanks :grinning_face: