paperless update to 2.18.2 fails #1548

Closed
opened 2026-02-05 01:31:42 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @mkihr on GitHub (Aug 29, 2025).

Have you read and understood the above guidelines?

yes

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

update

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

update

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📝 Provide a clear and concise description of the issue.

The script fails when /opt/paperless/media is a mounted image. In this case inside media exists a directory lost+found and the script files during find and cp -r (backup) with permission denied error.
To have media as an seperate image is, in my opinion, not unusual.

🔄 Steps to reproduce the issue.

run the update when media is mounted image

Paste the full error output (if available).

find: '/opt/paperless/media/lost+found': Permission denied

🖼️ Additional context (optional).

To solve the problem I downloaded the script used in the update command and replaced this find line:

cp -r /opt/paperless/media /opt/paperless/backup/
with this:
(cd /opt/paperless/media && find . -mindepth 1 -maxdepth 1 ! -name lost+found -exec cp -r {} /opt/paperless/backup/ \;)
and the find with this:
find /opt/paperless -path /opt/paperless/media/lost+found -prune -o -name "__pycache__" -type d -exec rm -rf {} +

Originally created by @mkihr on GitHub (Aug 29, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? update ### 📂 What was the exact command used to execute the script? update ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📝 Provide a clear and concise description of the issue. The script fails when /opt/paperless/media is a mounted image. In this case inside media exists a directory lost+found and the script files during find and cp -r (backup) with permission denied error. To have media as an seperate image is, in my opinion, not unusual. ### 🔄 Steps to reproduce the issue. run the update when media is mounted image ### ❌ Paste the full error output (if available). find: '/opt/paperless/media/lost+found': Permission denied ### 🖼️ Additional context (optional). To solve the problem I downloaded the script used in the update command and replaced this find line: `cp -r /opt/paperless/media /opt/paperless/backup/` with this: `(cd /opt/paperless/media && find . -mindepth 1 -maxdepth 1 ! -name lost+found -exec cp -r {} /opt/paperless/backup/ \;)` and the find with this: `find /opt/paperless -path /opt/paperless/media/lost+found -prune -o -name "__pycache__" -type d -exec rm -rf {} +`
OVERLORD added the not a script issue label 2026-02-05 01:31:42 +03:00
Author
Owner

@MickLesk commented on GitHub (Aug 29, 2025):

I have been using paperless for 2 years, even with mounted folders, and have never heard of such an error.

It's also not a script error per se, rather a customization at most. However, the code is highly unintuitive

rsync is the correct way, but only for 1 people an extra dep?

@MickLesk commented on GitHub (Aug 29, 2025): I have been using paperless for 2 years, even with mounted folders, and have never heard of such an error. It's also not a script error per se, rather a customization at most. However, the code is highly unintuitive rsync is the correct way, but only for 1 people an extra dep?
Author
Owner

@octfx commented on GitHub (Aug 29, 2025):

I think I've got a related error

Have you created a snapshot? [y/N]: y
  ✔️   Patched paperless-webserver.service
  ✔️   Patched paperless-scheduler.service
  ✔️   Patched paperless-consumer.service
  ✔️   Patched paperless-task-queue.service
  ⏳   Backing up datacp: cannot stat '/opt/paperless/media': No such file or directory

[ERROR] in line 101: exit code 0: while executing command cp -r /opt/paperless/media /opt/paperless/backup/

I have no media folder in opt, running paperless 2.17.1

@octfx commented on GitHub (Aug 29, 2025): I think I've got a related error ``` Have you created a snapshot? [y/N]: y ✔️ Patched paperless-webserver.service ✔️ Patched paperless-scheduler.service ✔️ Patched paperless-consumer.service ✔️ Patched paperless-task-queue.service ⏳ Backing up datacp: cannot stat '/opt/paperless/media': No such file or directory [ERROR] in line 101: exit code 0: while executing command cp -r /opt/paperless/media /opt/paperless/backup/ ``` I have no media folder in opt, running paperless 2.17.1
Author
Owner

@MickLesk commented on GitHub (Aug 29, 2025):

Create an media folder before update and try again

@MickLesk commented on GitHub (Aug 29, 2025): Create an media folder before update and try again
Author
Owner

@octfx commented on GitHub (Aug 29, 2025):

Did that, update went through but everything crashed; Currently restoring from backup and re-running again.

This is a pretty old container setup with one of tteck's scripts.
I'll post my log after the backup finishes

@octfx commented on GitHub (Aug 29, 2025): Did that, update went through but everything crashed; Currently restoring from backup and re-running again. This is a pretty old container setup with one of tteck's scripts. I'll post my log after the backup finishes
Author
Owner

@MickLesk commented on GitHub (Aug 29, 2025):

After Backup restored, create the folder before update.

@MickLesk commented on GitHub (Aug 29, 2025): After Backup restored, create the folder before update.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#1548