Backup fails with "The process cannot access the file because it is being used by another process."

I just set up a Samba share on my local network and attached it on my PC. I configured Duplicacy to back up to this location, but it fails.

Logs:

Running backup command from C:\Users\username/.duplicacy-web/repositories/localhost/1 to back up D:/folder_to_back_up
Options: [-log backup -storage target_id -threads 4 -stats]
2025-01-12 16:13:14.995 INFO REPOSITORY_SET Repository set to D:/folder_to_back_up
2025-01-12 16:13:14.996 INFO STORAGE_SET Storage set to Y:/target_folder
2025-01-12 16:13:15.045 INFO BACKUP_START No previous backup found
2025-01-12 16:13:15.348 INFO INCOMPLETE_LOAD Previous incomplete backup contains 377873 files and 941 chunks
2025-01-12 16:13:15.348 INFO BACKUP_INDEXING Indexing D:\folder_to_back_up
2025-01-12 16:13:15.348 INFO SNAPSHOT_FILTER Parsing filter file \\?\C:\Users\username\.duplicacy-web\repositories\localhost\1\.duplicacy\filters
2025-01-12 16:13:15.348 INFO SNAPSHOT_FILTER Loaded 0 include/exclude pattern(s)
2025-01-12 16:19:28.532 ERROR UPLOAD_CHUNK Failed to upload the chunk 9c89196eaf6922504d8349749b122e6b984730de4b8365183b1e7a8c94e8fe2c: rename Y:/target_folder/chunks/9c/89196eaf6922504d8349749b122e6b984730de4b8365183b1e7a8c94e8fe2c.delxxemm.tmp Y:/target_folder/chunks/9c/89196eaf6922504d8349749b122e6b984730de4b8365183b1e7a8c94e8fe2c: The process cannot access the file because it is being used by another process.
2025-01-12 16:19:28.763 ERROR UPLOAD_CHUNK Failed to upload the chunk 266a79a7e55ee873fdce2c05578e761f42e879bf345782b9156a80a13130f76e: rename Y:/target_folder/chunks/26/6a79a7e55ee873fdce2c05578e761f42e879bf345782b9156a80a13130f76e.jgjlpzgd.tmp Y:/target_folder/chunks/26/6a79a7e55ee873fdce2c05578e761f42e879bf345782b9156a80a13130f76e: The process cannot access the file because it is being used by another process.
2025-01-12 16:20:28.740 INFO INCOMPLETE_SAVE Incomplete snapshot saved to C:\Users\username\.duplicacy-web\repositories\localhost\1/.duplicacy/cache/target_id/incomplete_snapshot
Failed to upload the chunk 9c89196eaf6922504d8349749b122e6b984730de4b8365183b1e7a8c94e8fe2c: rename Y:/target_folder/chunks/9c/89196eaf6922504d8349749b122e6b984730de4b8365183b1e7a8c94e8fe2c.delxxemm.tmp Y:/target_folder/chunks/9c/89196eaf6922504d8349749b122e6b984730de4b8365183b1e7a8c94e8fe2c: The process cannot access the file because it is being used by another process. Failed to upload the chunk 266a79a7e55ee873fdce2c05578e761f42e879bf345782b9156a80a13130f76e: rename Y:/target_folder/chunks/26/6a79a7e55ee873fdce2c05578e761f42e879bf345782b9156a80a13130f76e.jgjlpzgd.tmp Y:/target_folder/chunks/26/6a79a7e55ee873fdce2c05578e761f42e879bf345782b9156a80a13130f76e: The process cannot access the file because it is being used by another process.

I can create and delete files fine from File Explorer.
My trial is expiring tomorrow, and this makes me unsure if I want to purchase a license.

Configure duplicacy to use samba directly, not via mounted share.

Duplicacy was trying to rename “local” file, not create or delete, and the file manager being able to do so has very little to do with this.

The problem here is not duplicacy, but misconfigured samba on your server (looks like locking does not work properly)

What is the server and what is the client? (OS, samba version, etc?).

Wow, I totally missed that I can do that.

Found some older threads saying it was not possible, so I didn’t even check. I will try this and report if it worked.

Thanks for clearing things up!

Server is a Debian LXC on Proxmox, with latest samba installed with apt.
Client is a Windows 11 pc.

I have seen so many issues with samba updating things and changing defaults (why?!…) so that I would not trust anything there. An anecdote, (while not directly applicable to your scenario) just recently, they changed the default for how the file IDs are handled, and this broke file rename from macOS clients for when the share is hosted on a certain filesystems. Literary, renaming file in Finder would fail, with weird artifacts, like file appearing twice and not being renamed: I had to add the fruit:zero_file_id = false in samba config to set the old, correct value explicitly: Failure to moves files on TrueNAS Core 13.3 within same dataset - #4 by awalkerix - TrueNAS General - TrueNAS Community Forums

Nonsense like this in the project of such maturity is quite frustrating. I’m wondering if you see fallout of something similar - some default changed and now behavior is non-compliant with what windows 11 client expects. The concern is it will affect more than just duplicacy, so it’s still worthwhile to attempt to figure out what changed or rever to old samba and never update.

This is a fresh install, so there was nothing to change, I’m just not very good at configuring samba properly.

Here is my smb.conf:

[global]
   workgroup = WORKGROUP
   security = user
   map to guest = never
   log file = /var/log/samba/%m.log
   max log size = 1000
   logging = file
   log level = 3

[data]
   path = /mnt/data
   valid users = username
   read only = no
   browsable = yes
   writable = yes
   create mask = 0700
   directory mask = 0700

Also, creating the samba storage in Duplicacy was very straight-forward, and the backup is still running, so this probably solved the issue, but we will see when it completes.

This worked, the backup completed without an issue. Thank you!

1 Like