-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Access File #3635
Comments
Is the path containing the Duplicati local database files included in the sources being backed up? That can often lead to issues similar to this one. |
I don't think this is well-understood, but the most useful thread I saw was in the forum, with a workaround. 2.0.4.5 - The process cannot access the file because it is being used by another process I'm guessing the point of fail is here, where repair tries to rename the database. There's an Information-level message right above it, if you want to set up a --log-file at --log-file-log-level=information to see how often the rename runs, and how often it fails. I'm not familiar enough with it to say much about what's happening. |
This problem is not resolved. I see posts about the bug going back as far as 2015. I would love it if it could get more attention. I have Duplicati running on at least 30 computers. This problem has been continuously showing up on the computers regularly. I can confirm that “–concurrency-max-threads=1” does not stop it from happening. This bug really ruins the program for me. |
@DesktopMasters are you running Duplicati the same way the OP is? I occasionally get the error about in-use files during backups, but it is a legitimate error. I use VSS but sometimes the snapshot fails so in-use files cannot be backed up. |
I forgot about this thread but was emailed when people replied to it. The usual fix is stop all duplicati services, kill all duplicati process's start services, run repair carry on. but a fix so that it doesnt happen would be nice. |
@Ragonz - what version are you running? I run Duplicati on about 10 machines and have not experienced the issue you describe. But I also don't run it in 'portable mode' - maybe that's a clue. |
I am running Duplicati as a service and storing its data in the C:\ProgramData\Duplicati folder. I am NOT backing that folder up. --snapshot-policy=Required I just changed snapshot-policy from Auto to Required. I feel like maybe that could help. I will report back if it solves the problem. |
Duplicati - 2.0.4.23_beta_2019-07-14 |
All that's going to do is just fail the entire job if the snapshot cannot be taken. (I sometimes get that if another program is trying to create a snapshot at almost the same time.) Auto may be better, at least you'll get most files backed up and just warnings about files that are locked. |
Just to save you all the time... It did not solve it for me. |
That's not the right approach, IMO. We need to find out the root cause of why you are experiencing this issue. Something unique about your setup may be triggering it. When the problem next happens, can you get a capture of the full log? I might also suggest removing most of your listed customizations except maybe |
@Ragonz are you also running --auto-cleanup=true and if so, does turning it off change the problem, perhaps to something else? You can follow the same debugging steps including capturing a --log-file. Using --log-file-log-level=information might be a good start, and tends not to catch personal info like profiling level can. Supply some context before the error too, as this will help show how it got to error. What's needed is either enough log to show details on what happened, or getting closer to vanilla, as @drwtsn32x was suggesting, in order to find out whether some not-often-used option is responsible. --auto-cleanup is my prime suspect based on your limited initial stack trace, because PreBackupVerify problems may have started a Repair run, which could not rename the database, because it was open... duplicati/Duplicati/Library/Main/Operation/BackupHandler.cs Lines 153 to 161 in 79d8395
Repair doesn't look like it routinely renames the database, but it does if prior issues call for a Recreate. duplicati/Duplicati/Library/Main/Operation/RepairHandler.cs Lines 65 to 66 in 79d8395
|
Environment info
Description
Every so often Duplicati will throw a "The process cannot access the file because it is being used by another process, no other duplicati process is running as far as I can see and I can freely move the data folder and its contents about if I stop duplicati. This is not an isolated incident and is occuring on 10+ servers randomly. The only way to fix this I have found is to delete the local database and remote files (or rename the remote folder) and essentially start again.
Steps to reproduce
Install as a service instructions
"C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" install --portable-mode --webservice-interface=loopback --log-retention=3M
Backups should run without issue
Duplicati occasionally errors suggesting a file is in use (I suspect one of the database files) once the error occurs it will continue to occur until you delete the local database and remote files and start fresh.
Screenshots
Debug log
System.IO.IOException: The process cannot access the file because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost) at Duplicati.Library.Main.Operation.RepairHandler.Run(IFilter filter) at Duplicati.Library.Main.Operation.BackupHandler.PreBackupVerify(BackendManager backend, String protectedfile) at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task) at Duplicati.Library.Main.Controller.<>c__DisplayClass13_0.<Backup>b__0(BackupResults result) at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action
1 method)at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter)
at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)`
The text was updated successfully, but these errors were encountered: