The process cannot access the file because it is being used by another process

Sorry to say, but I give up.

I spend half my time trying to recover from these kinds of errors.

Maybe instead of building a backup with every conceivable option, the devs should focus on stability and reliability.

This product is neither.

The one that stops this issue (assuming that it refers to a source file) is snapshot-policy.

You are presumably on Windows, and ā€œused by another processā€ is raised by Windows.
If you like, send the topic title here to a search engine, and optionally add ā€œVSSā€ as well.
A Duplicati snapshot is Windows VSS.

If you mean this specific one, forum search box shows no previous mention of it by you.
If you mean other errors reading files, there can be various ones, e.g. from permissions.

Duplicati.WindowsService.exe can help with both issues, as Administrator privileges are
required for VSS snapshots (Windows rule), and a Windows service has great accessā€¦

Unfortunately setting up the Windows service is currently manual, not an installer option.

Sorry to hear that. Iā€™m not sure what you see. You posted just once before over past year.

EDIT:

I will say Duplicati is definitely NOT bug-free, but itā€™s limited by what its volunteers can do.
If anybody would like to assist in any way, volunteers are who keep the project continuing.

Official Issues list is one place for developers to start, but thereā€™s plenty of room for others
including those willing to test and at least document how to reproduce any stability issues.
Thatā€™s a big help to volunteers who might then be able to code the fix. See Issue template.

sorry - just blowing off some steam. but I really do have a lot of problems with the 'The process cannot access the file because it is being used by another process" error.

I just assumed duplicati used vss by default and I didnā€™t see any specific reference to a source file that was opened, so I assumed it was an issue with the duplicati databases.

Can I just confirm the proc to set this up properly?

for duplicati server:

  • setup duplicati windows service (Iā€™ve read the docs on the setup)
  • restart

for each backup config:

  • change the snapshot policy for either auto or required

question:
ā€œAdministrator privileges are required for VSS snapshotsā€

  • I assume this is addressed once duplicati windows service is setup and that I do not need to do anything special when start the duplicati client - is that correct?

I do have another problem with the databases where I canā€™t rebuild a db, but I suspect part of the problem is the above-mentioned vss. If I can get past this occurring all the time, maybe Iā€™ll be in a better frame of mindā€¦

thx!

The How-To Migrating from User to Service install on Windows (latest recipe is v3) covers doing that.
Itā€™s much simpler if youā€™re starting from scratch, but presumably you have backups you want to move.

Additionally, your steps would still leave Duplicatiā€™s TrayIcon wrongly thinking it should start its server. Connecting to that would put you at port 8300, not 8200 which service likely got (if it got there firstā€¦).

There might be other issues I forgot, so follow the How-To. When at right server, configure snapshots.
About ā†’ System info UserName and StartedBy will be clues to which server you got (if itā€™s not clear).

Windows service by default installs as SYSTEM so has plenty (maybe too much) Administrator power without having to jump through hoops (such as UAC) that ordinary Administrator group would require.

Duplicati GUI is just a web page, so user doesnā€™t matter any. You would browse directly to the service. Getting TrayIcon client going is kind of complicated, if you have a GUI lock. If you want to do that, ask.
Basically, it needs to get into the server that the service started, and can hit access permission issues.

EDIT:

A full set of service, server, and TrayIcon (with desired --no-hosted-server) would look like image at
[SOLVED] Is it ok that I see 5 processes of Duplicati in Windows Task manager?

Sadly (or maybe gladly if one is security-worried), it runs as you, and even if you were an Administrator thereā€™s no special power until you endure the UAC prompt that Windows will likely want before granting.

I donā€™t know exactly what you saw, or when. Sometimes About ā†’ Show log ā†’ Live ā†’ Warnings helps.
Maybe test that before converting to the service, if this issue occurs often (and it sounds like it doesā€¦).
You can also see if anything is in the job logs, as an error or warning typically has a one-liner put there.

Thereā€™s at least one way for the database to interfere with itself. IIRC it involves auto-cleanup such as
Large job stopped halfway. Stuck in loops, either ā€œdatabase is lockedā€ or ā€œNo filelists found on the remote destinationā€ EDIT: auto-cleanup bug?

If you donā€™t set the option, then this wouldnā€™t be your situation, but the live log check seems worthwhile because it would be best to know whatā€™s going on. If you see a message arrive, clicking may get more.

EDIT:

Google search is seeing some formats of this message where a file is seen after ā€œfileā€, but not for you?
This makes determining problem more important. If it happens mid-backup, itā€™s probably on source file.
Database problem would likely be during startup, but maybe only if auto-cleanup option was chosen.

Thx so much for the thorough explanation - I need to go over the migration procedure, but as a suggestion, it would be helpful if this issue was collectively highlighted during the installation so users could elect to go with a vss solution from the start. TBH, migrating to a windows service sounds like a non-trivial project - I guess as long as I know I don;t have access to vss w/ my current install, I can shutd own all relevant apps before I backup - that seems to have resolved the issue I was encounteringā€¦

Thx again!

which might still be open because nobody then or now knew how. Developers are very much needed.

Itā€™s lots of steps, but thereā€™s a recipe which hopefully will work fine.

Thatā€™s a good test for whether itā€™s a source file. You also have logs.

To compare symptoms with yours (if you recall), I set snapshot-policy to off (was required) as a test.
Live log was running at Warning level. During backup, it found a locked file, and reported it live, with

Feb 1, 2023 12:20 PM: Failed to process path: <path>

Clicking on that line showed the detail behind failure as:

{ā€œClassNameā€:ā€œSystem.IO.IOExceptionā€,ā€œMessageā€:ā€œThe process cannot access the file ā€˜\\?\C:\<path>ā€™ because it is being used by another process.ā€

At backup end, a yellow popup (yellow for warning) appeared at bottom of screen, informing that

2023-02-01 12:20:42 -05 - [Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: <path>

and giving Show and Dismiss buttons. Show button goes to job log, where log for the backup has

2023-02-01 12:20:42 -05 - [Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: <path>

I have filed an issue to see if at least the summary explanation of the type of failure can also show
however your message seems to give the explanation without the path? Anything else match this?

I donā€™t think I was getting any warning - just a fail msg. Iā€™ll try running again tonight with an active file in the src dir to see if I get any further detail.

For the moment, if I can consistently get a clean backup (no errs, warnings) after closing all other apps, Iā€™m further ahead than Iā€™ve been in a while.

Once I get to a stable, repeatable process, Iā€™ll start experimenting with the windows service you described above.

Thx for all your advice!

The process to move to a service is really quite easy when using version 3 of the instructions. Follow the instructions in this post, once setup you may have to re-specify some of the paths to be system relative vs user relative, see my post near the end of the thread for details on that.

1 Like

Got it. Iā€™ll give it a shot.

Thx!