paperless-ngx backup doesn't work after uv upgrade #1921

Closed
opened 2025-11-20 05:19:57 -05:00 by saavagebueno · 5 comments
Owner

Originally created by @l2chris on GitHub (Sep 20, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

paperless-ngx.sh

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/paperless-ngx.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 13

📈 Which Proxmox version are you on?

pve-manager/9.0.10/deb1ca707ec72a89 (running kernel: 6.14.11-2-pve)

📝 Provide a clear and concise description of the issue.

I run the paperless in LXC version in proxmox.
After upgrading to the UV version of paperless my backup script does not work anymore.
The command I am using in my backup script is
cd /opt/paperless/src
/usr/bin/python3 manage.py document_exporter /opt/paperless/export-tmp/ 2>&1

originally my error was eventually "ModuleNotFoundError: No module named 'babel'"

I have tried to overcome the issue by
a/ apt-get install python3-babel
after which at least the document_exporter seemed to work again via
"python3 manage.py document_exporter --help" (which worked)

But now I get the following error:
"
root@paperless-ngx:/opt/paperless/src# /usr/bin/python3 manage.py document_exporter /opt/paperless/export-tmp/
Traceback (most recent call last):
File "/opt/paperless/src/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 454, in execute
self.check()
File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 486, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 44, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 63, in _load_all_namespaces
url_patterns = getattr(resolver, "url_patterns", [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 718, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 711, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/opt/paperless/src/paperless/urls.py", line 57, in
from paperless_mail.views import MailAccountViewSet
File "/opt/paperless/src/paperless_mail/views.py", line 24, in
from paperless_mail.mail import MailError
File "/opt/paperless/src/paperless_mail/mail.py", line 32, in
from imap_tools.mailbox import MailBoxStartTls
ImportError: cannot import name 'MailBoxStartTls' from 'imap_tools.mailbox' (/usr/local/lib/python3.11/dist-packages/imap_tools/mailbox.py)
"

after which I also tried to "pip3 install Babel", but that didn't help as well (same error).

🔄 Steps to reproduce the issue.

cd /opt/paperless/src
/usr/bin/python3 manage.py document_exporter /opt/paperless/export-tmp/

Paste the full error output (if available).

tarting backup of paperless: 2025-09-20 03:00:01
Traceback (most recent call last):
File "/opt/paperless/src/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 416, in execute
django.setup()
File "/usr/local/lib/python3.11/dist-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.11/dist-packages/django/apps/registry.py", line 124, in populate
app_config.ready()
File "/opt/paperless/src/documents/apps.py", line 13, in ready
from documents.signals.handlers import add_inbox_tags
File "/opt/paperless/src/documents/signals/handlers.py", line 34, in
from documents.file_handling import create_source_path_directory
File "/opt/paperless/src/documents/file_handling.py", line 7, in
from documents.templating.filepath import validate_filepath_template_and_render
File "/opt/paperless/src/documents/templating/filepath.py", line 10, in
from babel import Locale
ModuleNotFoundError: No module named 'babel'
tar: Removing leading `/' from member names
rm: cannot remove '/opt/paperless/export-tmp/*': No such file or directory
Finished backup of paperless: 2025-09-20 03:00:55

after installing babel I now get
"
raceback (most recent call last):
File "/opt/paperless/src/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.11/dist-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 454, in execute
self.check()
File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 486, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 44, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 63, in _load_all_namespaces
url_patterns = getattr(resolver, "url_patterns", [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 718, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 711, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/opt/paperless/src/paperless/urls.py", line 57, in
from paperless_mail.views import MailAccountViewSet
File "/opt/paperless/src/paperless_mail/views.py", line 24, in
from paperless_mail.mail import MailError
File "/opt/paperless/src/paperless_mail/mail.py", line 32, in
from imap_tools.mailbox import MailBoxStartTls
ImportError: cannot import name 'MailBoxStartTls' from 'imap_tools.mailbox' (/usr/local/lib/python3.11/dist-packages/imap_tools/mailbox.py)
"

🖼️ Additional context (optional).

No response

Originally created by @l2chris on GitHub (Sep 20, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? paperless-ngx.sh ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/paperless-ngx.sh)" ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 13 ### 📈 Which Proxmox version are you on? pve-manager/9.0.10/deb1ca707ec72a89 (running kernel: 6.14.11-2-pve) ### 📝 Provide a clear and concise description of the issue. I run the paperless in LXC version in proxmox. After upgrading to the UV version of paperless my backup script does not work anymore. The command I am using in my backup script is cd /opt/paperless/src /usr/bin/python3 manage.py document_exporter /opt/paperless/export-tmp/ 2>&1 originally my error was eventually "ModuleNotFoundError: No module named 'babel'" I have tried to overcome the issue by a/ apt-get install python3-babel after which at least the document_exporter seemed to work again via "python3 manage.py document_exporter --help" (which worked) But now I get the following error: " root@paperless-ngx:/opt/paperless/src# /usr/bin/python3 manage.py document_exporter /opt/paperless/export-tmp/ Traceback (most recent call last): File "/opt/paperless/src/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 413, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 454, in execute self.check() File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 486, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 44, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 63, in _load_all_namespaces url_patterns = getattr(resolver, "url_patterns", []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 718, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 711, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/paperless/src/paperless/urls.py", line 57, in <module> from paperless_mail.views import MailAccountViewSet File "/opt/paperless/src/paperless_mail/views.py", line 24, in <module> from paperless_mail.mail import MailError File "/opt/paperless/src/paperless_mail/mail.py", line 32, in <module> from imap_tools.mailbox import MailBoxStartTls ImportError: cannot import name 'MailBoxStartTls' from 'imap_tools.mailbox' (/usr/local/lib/python3.11/dist-packages/imap_tools/mailbox.py) " after which I also tried to "pip3 install Babel", but that didn't help as well (same error). ### 🔄 Steps to reproduce the issue. cd /opt/paperless/src /usr/bin/python3 manage.py document_exporter /opt/paperless/export-tmp/ ### ❌ Paste the full error output (if available). tarting backup of paperless: 2025-09-20 03:00:01 Traceback (most recent call last): File "/opt/paperless/src/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 416, in execute django.setup() File "/usr/local/lib/python3.11/dist-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.11/dist-packages/django/apps/registry.py", line 124, in populate app_config.ready() File "/opt/paperless/src/documents/apps.py", line 13, in ready from documents.signals.handlers import add_inbox_tags File "/opt/paperless/src/documents/signals/handlers.py", line 34, in <module> from documents.file_handling import create_source_path_directory File "/opt/paperless/src/documents/file_handling.py", line 7, in <module> from documents.templating.filepath import validate_filepath_template_and_render File "/opt/paperless/src/documents/templating/filepath.py", line 10, in <module> from babel import Locale ModuleNotFoundError: No module named 'babel' tar: Removing leading `/' from member names rm: cannot remove '/opt/paperless/export-tmp/*': No such file or directory Finished backup of paperless: 2025-09-20 03:00:55 after installing babel I now get " raceback (most recent call last): File "/opt/paperless/src/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.11/dist-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 413, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 454, in execute self.check() File "/usr/local/lib/python3.11/dist-packages/django/core/management/base.py", line 486, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/checks/registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 44, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/core/checks/urls.py", line 63, in _load_all_namespaces url_patterns = getattr(resolver, "url_patterns", []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 718, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/utils/functional.py", line 47, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/django/urls/resolvers.py", line 711, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/paperless/src/paperless/urls.py", line 57, in <module> from paperless_mail.views import MailAccountViewSet File "/opt/paperless/src/paperless_mail/views.py", line 24, in <module> from paperless_mail.mail import MailError File "/opt/paperless/src/paperless_mail/mail.py", line 32, in <module> from imap_tools.mailbox import MailBoxStartTls ImportError: cannot import name 'MailBoxStartTls' from 'imap_tools.mailbox' (/usr/local/lib/python3.11/dist-packages/imap_tools/mailbox.py) " ### 🖼️ Additional context (optional). _No response_
saavagebueno added the buginvestigation labels 2025-11-20 05:19:57 -05:00
Author
Owner

@l2chris commented on GitHub (Sep 20, 2025):

FYI - using some perplexity magic I also executed
"pip install --upgrade imap-tools"

which seems to finally resolve the issue

@l2chris commented on GitHub (Sep 20, 2025): FYI - using some perplexity magic I also executed "pip install --upgrade imap-tools" which seems to finally resolve the issue
Author
Owner

@MickLesk commented on GitHub (Sep 20, 2025):

wth are you doing? ^^

uv isnt the build in python, so you make your own thing, fix your commands and use uv, or increase your system python. and its not an issue in the script himself, you mixed uv with python (debian)

@MickLesk commented on GitHub (Sep 20, 2025): wth are you doing? ^^ uv isnt the build in python, so you make your own thing, fix your commands and use uv, or increase your system python. and its not an issue in the script himself, you mixed uv with python (debian)
Author
Owner

@l2chris commented on GitHub (Sep 21, 2025):

well, technically I am not neither an expert in python nor uv. I provided my observation that it worked for me before the upgrade to uv. Since I "assumed" my "fix" (using internet search) wasn't necessarily the right way to do it (and for others who might have the same issue and documentation), I was hoping to get some advice here - but obviously insulting people is more your thing.
Having said that - it's working now and maybe I should have raised this with the paperless project itself.

@l2chris commented on GitHub (Sep 21, 2025): well, technically I am not neither an expert in python nor uv. I provided my observation that it worked for me before the upgrade to uv. Since I "assumed" my "fix" (using internet search) wasn't necessarily the right way to do it (and for others who might have the same issue and documentation), I was hoping to get some advice here - but obviously insulting people is more your thing. Having said that - it's working now and maybe I should have raised this with the paperless project itself.
Author
Owner

@l2chris commented on GitHub (Sep 21, 2025):

for reference and other people using it. https://github.com/paperless-ngx/paperless-ngx/issues/10586 (although I cannot explain why this is applicable in my scenario - using lxc and not baremetal), so somehow the babel "requirement" has not been correctly installed in my case.

@l2chris commented on GitHub (Sep 21, 2025): for reference and other people using it. https://github.com/paperless-ngx/paperless-ngx/issues/10586 (although I cannot explain why this is applicable in my scenario - using lxc and not baremetal), so somehow the babel "requirement" has not been correctly installed in my case.
Author
Owner

@MickLesk commented on GitHub (Sep 21, 2025):

Lxc = bare metal

And where do you even see an insult or anything like that in the way I said it? Lol. How rude. I just told you that it's a mixup of Python and uv, which differs significantly. And such issues (because you created some importers yourself) are not our concern, as we deal with standard issues.

I don't think the update from uv has anything to do with it, as it is a separate tool. You probably updated the OS and got a new Python.

@MickLesk commented on GitHub (Sep 21, 2025): Lxc = bare metal And where do you even see an insult or anything like that in the way I said it? Lol. How rude. I just told you that it's a mixup of Python and uv, which differs significantly. And such issues (because you created some importers yourself) are not our concern, as we deal with standard issues. I don't think the update from uv has anything to do with it, as it is a separate tool. You probably updated the OS and got a new Python.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#1921