Backup fails with "another process has locked a portion of the file"

Please describe what you are doing to trigger the bug:

I am not doing anything specific. However, another process had a partial file lock on a file that is causing the backup to abort which makes this backup software kind of useless for me.

Excluding this specific file is very much hackish and not a solution for my use case. I would always lack confidence in the backups if I relied on excludes, because some other file might have a lock that I wasnā€™t aware of ahead of time, and it might be a week or more before I even notice. I donā€™t check Duplicacy multiple times a day to make sure the software works, I expect it to work. Also, I do need this file backed up. Itā€™s not always locked, just most of the time.

I have googled and seen that the 0 bytes read abort backup behaviour is intentional, however I think you should re-evaluate, or at least check for this specific error code and only issue a warning like you do with other cases when a file cannot be read (like ā€œfile open by a different processā€).

Please describe what you expect to happen (but doesnā€™t):

I would expect the backup to succeed.

Please describe what actually happens (the wrong behaviour):

The backup fails. Here is a message from the logā€¦

2024-11-04 06:00:51.149 ERROR CHUNK_MAKER Failed to read 0 bytes: read \?\C:\redacted.dat: The process cannot access the file because another process has locked a portion of the file.
Failed to read 0 bytes: read \?\C:\redacted.dat: The process cannot access the file because another process has locked a portion of the file.

You need to use the -vss flag on the backup command.

1 Like

Thank you so much for the quick reply, I appreciate it. Iā€™m not sure -vss is what I was looking for. VSS requires administrator privileges and is using filesystem snapshotting to include these locked files that were causing an abort. I was suggesting that an abort condition becomes a warning condition, or at least a command line option to relax some of these failures and allow them to be warnings. Like a lot of people, I would rather have an incomplete backup instead of no backup. In my case, one file is causing the entire backup to fail. As long as the warnings are included in the logs, they can be reviewed, identified and resolved at a later date.

I restarted web edition in administrator mode and tested my backup and now it fails with a different ā€œ0 bytes readā€ error. This error is related to cloud services. Normally when backing up a folder on a cloud service like dropbox, icloud, etc, files not existing locally will be downloaded. Now obviously, the VSS snapshot is read only, and this behavior now fails when the cloud service canā€™t download the file. Here is the error message:

ā€œ2024-11-05 12:10:18.383 ERROR CHUNK_MAKER Failed to read 0 bytes: read \?\C:\Users\redacted.duplicacy-web\repositories\localhost\1.duplicacy\shadow\Users\redacted\iCloudDrive\some-redacted-file: The cloud operation is not supported on a read-only volume.ā€

This is a different 0 bytes read error that I really wonder if it should be aborting the backup. I havenā€™t been able to find much information on what kind of support Duplicacy has for backing up files on cloud services, so maybe there is another option Iā€™m not aware of that will fix this.

This is slightly off topic, but I like the side effect that all files get downloaded locally when running a Duplicacy backup. This is great for my use case, but I can also see this can be a problem for people with small amounts of local storage and large amounts in the cloud ā€“ causing hard drives filling up and excessive network traffic. This might also be a place where there should be a command line option to control if remote files are downloaded.

Unfortunately my backup fails with and without VSS. They both fail with 0 bytes read abort, but for different reasons: file lock and read only volume. I still stand by my initial suggestion that some of these abort conditions are too strict.

Unless you sync all data of *drive services locally fully, no selective download, you shall exclude iCloud drive, Dropbox, OneDrive etc from backup. Duplicacy does not support backing up dataless files. There is a feature request for that but it hasnā€™t been planned.

I, on the contrary, prefer complete coherent backup period. if full backup is not possible ā€” no backup. Partial backup is useless in vast majority of cases.

Being unable to read a file user expects to be readable is a catastrophic failure and justifies abort, to investigate. Warning is fine, but most people ignore warnings.

I have pointed out a bug with VSS/Cloud services and get told Iā€™m using the software wrong or I shouldnā€™t back up my files. Out of the box, it doesnā€™t work for a large number of Windows configurations. Iā€™m sure itā€™s great for a lot of people (especially non windows users, because windows seems to be where a lot of the problems are). An hour of reddit and google searches will show you thousands of people who have given up on Duplicacy.

Your statement about partial backups is just silly. You literally told me not to back up my files, which by definition is a partial/incomplete backup. Also, the default configuration of Web Edition, you will see hundreds of files not backed up because ā€œit is being used by another processā€. Those are warnings that happily let the backup continue, again opposite of what you advocate for ā€“ and your statement kind of implies Duplicacy is doing the right thing, when itā€™s only aborting some of the time. Itā€™s so inconsistent. Canā€™t open up a file? No problem, letā€™s continue the backup. Oh, I read 0 bytes?? ABORT!!! Get the team to make the ā€œbeing used by another processā€ a fatal error too, then you will get your preferred no backup and also see windows adoption drop to 0%.

Your profile says you arenā€™t affiliated with Duplicacy, but your name is the one I see on so many of the bug reports I have read, so I donā€™t know what to make of that. You certainly come across as a spokesperson of the company. Do you use Duplicacy on Windows? I kind of have a feeling you donā€™t. If Iā€™m wrong, my apologies, but maybe try walking in someone elseā€™s shoes, You may see that there really are some major shortcomings with the Windows version and us people that are trying to bring problems to peopleā€™s attention and offer solutions are not crazy wingnuts.

It doesnā€™t take much looking on the Duplicacy forums to see that the core community and development team are not open to criticism and suggestions. Itā€™s not a great look.

I hoped everything I read about this project was wrong, because it looks like there is great potential here for an amazing rock solid product at a great price. But when it doesnā€™t even work out of the box and you are told ā€œworking as intendedā€, thatā€™s unfortunate. This backup solution is obviously not for me. Iā€™m glad I found this out now, because I was just getting ready to commit and buy some licenses. The fact that itā€™s impossible to backup my computer because both -vss and not using -vss fail helped make this decision too.

1 Like

TLDR: Duplicacy does not have many features and does not support many configurations, but what it does do and support ā€“ it does better than any other backup solution today in terms of reliability, resilience, and performance. Itā€™s the only backup solution that survive in my (albeit aggressive) stability testing. People who decide to use it sacrifice features for stability. Thatā€™s pretty much the underlying reasoning of the rest of my reply here.

A lot to unpack here. First of all, this is not a bug. Support of dataless file is a feature. Duplicacy does not support that. The only backup software that does is Arq7. That feature is nice, but not common, and has other issues. Another issue with this, especially on windows is how those dateless files work ā€“ via reparse points. Reparse points on windows are filesystem extension. Their behavior is application specific. Attempting to support that is a huge task. Yes, Arq did that. No, duplicacy did not. So, if you absolutely need to backup your iCloud or OneDrive in sparse mode ā€“ duplicacy is a wrong tool for you, use Arq.

But again, itā€™s not a bug. itā€™s a lack of a feature.

That said, with the lack of dateless files backup, the right thing to do is to exclude the dateless datasets from backup. Nothing weird about it, albeit it seems to at first glance. I can elaborate on that more if needed.

Right, but this is irrelevant. You shall decide for yourself if the solution fits your needs.

It may appear so at the first sight.

No, I said fully backup your files. And if you canā€™t ā€“ fix the issue, so you can fully backup your files. Partial backup would be leaving your data in inconsistent, broken state. You donā€™t want broken backup, do you?

Web UI is a hot mess, and I donā€™t use it either. You may be interested to review this thread: Dont buy this scam

I fully agree. This is a bug. The key is to ensure backup does not generate warnings.

ā€œthe teamā€ is just one dude. Shall it be fixed? Yes. Is it high on the priority list ā€“ evidently, not, because itā€™s still not fixed. Does it sacrifice backup reliability ā€“ no.

Itā€™s very simple. I am a user. I see many shortcomings of this tool, and donā€™t shy away from pointing them out. I also having tested all other backup tools still believe this one is the best at what mattes most ā€“ making reliable backups. So, I still use it. I also use Arq, because of the features duplicacy lacks, and because it is so user friendly itā€™s unbelievable - works out of the box, and supports many things duplicacy does not, such as Archival storage, and dataless files, and rich filters that make sense. But if Arq backup datastore will get corrupted ā€“ I will probably lose backup. If duplicacacy datastore gets corrupted ā€“ I am very confident in being able to recover vast majority of data. So I use Arq for conveniences, and duplicacy to save the day.

Also see this (read that whole topic if you have time, it will explain why the state of duplicacy is the way it is)

I apologize for that, itā€™s unintentional, and this happens so much that I had to put that in my profile.

Correct. I donā€™t use windows at all. But the issues you point out are not specific to windows (reparse points are, but partial backups due to lack of dataless files support ā€“ are not)

Correct. There are plenty of shortcomings. If those are dealbreakers - then duplcacy is definitely not for you.

For example, many people today use cloud storage as place where their data lives, and use computers as disposable tools access that data. I personally have 3TB of data in iCloud, and my main desktop machine has only 512GB SSD. This means I cannot use duplicacy to backup my files, because they are part of that 3TB dataset, that does not fit on my device. So duplicacy is 100% useless in this scenario. I posted feature request. And Iā€™m using Arq on that machine. it works.

Oh, they are open. It may seem this way for two reasons:

When something breaks, like google drive changed the policies around the API use, or a bug was discovered in STORJ library that was crashing 32 bit systems, developer addressed the issue in the matter of days, if not hours.

I would say you have a pretty solid picture. Duplicacy in my opinion is a gem with rough exterior, and requires some work to make it work in the specific environment, but this is the only tool that actually does backup in a stable and reliable way. Of course, some users want ā€œbrilliant out of the boxā€ experience, who would not, but I personally not prepared to pay for that in reliability. Unfortunately this is the choice you have to make today.

To summarize,

Excluding the partially synced cloud storage from backup and using -vss will accomplish what you need. I can explain in more details why backing up partially synced storage is a bad idea. If duplicacy supported dataless files this would not have been a problem, but it does not.

And thatā€™s OK. I recommend exploring at Arq7. I also recommend exploring duplicacy beyond the rough exterior, because you may be repulsed by it just as I was few years ago, and yet, Iā€™m still here, relying on it to protect my most important data, despite all shortcomings in the feature set.

Again, I have nothing to lose nor gain from you using or not using duplicacy, just sharing my experience and why am I still using it, while so many other tools do so much more, at least on paper.

Oh, and I donā€™t use WebUI, at all. I find it useless, clunky, and unusable. I use duplicacy CLI with OS scheduler. BTW, the CLI is free for personal use. So itā€™s a win/win of sorts.

1 Like

Heeey, I was just wondering why I got notified about this. I created the ā€œDonā€™t buy this scamā€ thread.

I share your frustration, it shouldnā€™t be this hard. Not only that, but I have seen more and more hostile behavior across the self-hosting community in general towards backups. Specifically on the UNRAID discord server where official helpers tell completely new users to shut up about requesting a simple backup integration because writing your own backups scripts is so easy.

But there is hope on the horizon, as the backup noobs voted a backup solution to the top of the new features poll. I am still using the duplicacy web ui to this day, while semi regularly checking if the restore functionality is still working. I donā€™t like it, but it works.

1 Like

Hey welcome back :slight_smile:

Unfortunately, it is hard. Itā€™s extremely rare for a single individual to possess the skill set required to create a reliable service software, such as a backup engine, while simultaneously delivering an exceptional user experience, as each of these domains requires a lifetime to master.

This does not mean it can or shall not be done; it just means user experience could be outsourced, and as it was discussed in that magnificent thread youā€™ve started, itā€™s absolutely necessary for duplicacy to gain wide adoption, beyond the circle of tech enthusiasts. I mentioned there, for my parents Iā€™ve setup Arq. Because it works out of the box and is user friendly.

oh wow. Thatā€™s not only wrong, but also quite reckless.

This, unfortunately, is a big wad of nothing: amount of time it will take unraid to create and then stabilize backup software is immense, but users need backup now. Besides, the outcome is not guaranteed:

We have an example: Synology. With every nas they ship native HyperBackup application, that has amazing UI (Iā€™m serious, itā€™s almost perfect), runs on a significantly resource constrained devices (also a massive feat they had to accomplish because most of their NASes have 2GB or ram and yet must shovel terabytes of data), it exists for decades, so had enough runway to polish bugs, and it ā€œjust worksā€. Mostly. Until one day, when stars align, and network interruptions happens in the wrong moment and your backup becomes completely unusable. You lose all history and have to start over. At this point you could not care less how user friendly UI was, if you canā€™t access years of version history of your data.

So world is not perfect, and we have to compromise. IN the world of backup, data durability is one and only priority. And at that duplicacy is far ahead of competition. The CLI is actually not bad, itā€™s the GUI that sucks, but this is counteracted by the lack of necessity to use it. This of course does not help with wider adoption ā€“ but Iā€™d assume developer needs to balance other priorities.

Maybe some folks will start an open source project to create a native-on-the-platform backup GUI, that will support multiple backup engines, including duplicacy. That sounds like a feasible and likely outcome. The problem is ā€“ it would be very difficult to monetize, and people who possess skills to create such software donā€™t mind using command line tools for backupā€¦

1 Like

This is new information (which probably wouldā€™ve been picked up sooner if pathnames in your error message hadnā€™t been fully redacted, which is understandable yet unfortunate). Youā€™d have had a more definitive answer, with less walls of text, and probably a workaround by nowā€¦ :wink:

The answer is simple - Duplicacy doesnā€™t support Windowā€™s ā€˜on-demandā€™ files and few backup programs do, because it requires specific API support. This isnā€™t a bug.

It also makes total sense, since in order for Duplicacy to work it has to hash the content of files which ā€˜demandsā€™ all cloud files be downloaded, which nobody wants. Even Microsoft recommends to exclude OneDrive files from third-party backup tools. (-vss was a misnomer here, although it does help with ā€˜lockedā€™ files - just not ā€˜on-demandā€™.) And yea Duplicacy could ignore such files and not error out, but as a Linux+Windows CLI+GUI user myself of Duplicacy for 6+ years I would much much much prefer Duplicacy smack me in the head and tell me Iā€™m using it wrong, than silently ignore similar errors triggered with non-on-demand files!

To me, this is a perfectly acceptable limitation - just as I donā€™t expect Duplicacy to do full system image restores. You may have a different opinion, but then youā€™re always free to (kindly) request it as a feature (to support the on-demand API) for the consideration of the developer, or contribute code yourself since itā€™s source-available. Beware however, even CrashPlan doesnā€™t backup ā€˜offlineā€™ cloud files, so itā€™s not exactly lemon squeezy.

Now, as a workaround, you could always mount your cloud drive with Rclone (mount or serve) and point Duplicacy at it. Itā€™d necessitate downloading files at least once, and subsequently every time a file is modified - not greatly efficient, but it does work. Personally, I donā€™t trust the cloud enough to not to have a full (raw-files) local copy, from which Duplicacy will backup directly anyway.

2 Likes

Redacted file names had nothing to do with this. You can read my messages again if you like. My original post (and title of the bug report) was about reading 0 bytes of a locked file and aborting the backup. It had nothing to do with iCloud or OneDrive. Your suggestion was to use Windows VSS. I tried your suggestion/workaround *wink* *wink* and backups failed for a different reason with different types of files (cloud files vs. locked files).

With VSS enabled, the Shadow Copy is read only, but Duplicacy attempts to download the remote files from cloud providers. This obviously fails, and then the backup fails. I have been told this a feature request, but I consider it a bug. Why is Duplicacy attempting to download a file to a read only snapshot? Iā€™m sure I could fix the code in a few minutes, but this is not an opensource project and I have little faith the pull request would be honored because my fix wouldnā€™t honor the false belief you have in the strictness of Duplicacy. I also donā€™t want to spend any more time on this. My goal is to get good backups working for my wife and children, not discussing and trying to provide good feedback to a product I wonā€™t be using.

I have bad news for you. Duplicacy already excludes lots of files from windows backups with only a warning in the logs. The reason for this is obvious. There would be hardly any Windows users using this software if this was a fatal error. Windows does things different than macOS / Linux / BSDs. If another process has a file open, Duplicacy cannot open it and read it. Since this is likely to happen on close to 100% of windows machines in the default configuration of Duplicacy Web Edition. Someone obviously made the decision to change the behavior to continue the backup, even though hundreds, or in my case thousands, of files from every single windows backup are missing. I pointed out how inconsistent this is in a previous message. Itā€™s why I suggested a change to make the locked file error a warning instead of a fatal error. Or the less strict behavior I described above could become a fatal error. At least make it consistent. I also suggested a command line flag to toggle this, similar to how gcc has strict flags that makes something that would normally be a warning an error. I respect your use case, and I agree with it in lots of circumstances. However, not everyone uses the software the software the same and some people understand the risks involved with their decisions.

Itā€™s clear the majority of users on this forum providing support to Windows users donā€™t use Duplicacy on Windows and donā€™t understand some of the nuances. I think they expect it to work exactly like it does on their linux box or Mac. Maybe Windows support was added as an after thought, or maybe the software just works so much better on linux/unix/macOS that those users gravitated here.

Thank you for this suggestion, I really appreciate the time you took to reply to me. This looks like it might be a good solution for the Windows users in my family. My preliminary evaluation is good. SFTP backup to the home linux server, VSS support, it handles OneDrive/iCloud/etc folders in a sane way. We will see how it pans out later on. Iā€™m not against paying for software and would have gladly payed for Duplicacy if it fit my needs. I will certainly keep an eye on it and check in from time to time.

This is in no way specific to windows. It depends on how the file is open and with what flags. backing up live filesystem on any OS is a horrible idea because you end up with incoherent dataset. You need to first create a filesystem snapshot, so all data is grabbed at the same time. And ten backup that snapshot. Thatā€™s exactly what -vss flag accomplishes.

IN fact, VSS stands Volume Shadow copy Service, and its windows-first feature, hence the name. Support on macOS was added later, and it of course has nothing to do VSS, because it does not exist on macOS: there, and on other OSes exist other tools to create filesystem snapshots. Duplciacy is agnostic of that, and is universal. It helps on windows as a courtesy.

So, in your case excluding iCloud folder and adding -vss would have solved all issues. I believe WebUI should have enabled that by default on windows ā€“ but as I hope itā€™s painfully clear now, WebUI is not perfect.

It does not. It sees the file as presented by the filesystem and reads it. The filesystem filter handles the downloading of the file. If anything, itā€™s a bug in iCloud fileystem filter ā€“ it shall not attempt to download to a readonly snapshot. Please submit bug report to Apple.

Why would you fix something that is not a bug?

I was kernel developer on windows of 16+ years in the past. Believe me, I understand nuances. If you have specific questions.

No problem, Iā€™m happy to help however I can, I donā€™t want anyone to lose there data, and Iā€™m quite passionate about this. I still think the duplicacy (and the rclone workaround, if you have to, is the way to go), but itā€™s up to you. Test each solution you pick in variety of circumstances, try to break network connection, corrupt datastore, etc, make sure it can recover your data.

BTW, if you exclusively use windows you may also want to consider Veam Agent For Microsoft Windows. Itā€™s polished to death app, that among other things can create bootable backups, including all the network and storage drivers injected in the image. Itā€™s free to use in a standalone mode. Free Windows Backup Solution for PCs and Endpoints

Be careful, arq 7 is quite bad on windows over time, performance quickly collapses, sometimes some files are not saved without any explanation. I had a lot of problems with the Windows version while the Mac version works wonderfully.

1 Like

So many things we see differently, and so many things you are choosing to ignore in my messages. Or, you are just not reading them.

And I worked on BSD with Keith Bostic, et al and one of my first jobs was updating/creating a backup system at a university that backed up 10k+ users daily to reel to reel tape drives with retention policies and off site storage. Donā€™t even get me started with the ebcdic to ascii shit I had to deal with on the AIX systems. 100% restore success, not a single file lost over the years I worked there. Canā€™t do a proper backup with snapshotting? ZFS/AFPS/JFS2/WAFL were pipe dreams and linux didnā€™t even exist. If you have specific questions.

I didnā€™t know providing credentials was part of discussing Duplicacy. I donā€™t know what your point is, but we are obviously talking past each other and itā€™s not productive and I am moving on, so feel free to get the last word. I see and respect your point of view, but itā€™s clear you are unwilling to see others, or acknowledge there might actually be 1 or 2 nuggets of truth in what Iā€™m talking about. Iā€™m glad you are so smart that that you can dismiss everyone else. This is what I meant when I said this community is not open to discussions or criticism.

No, that was in response to this:

To provide point of reference, that some users, including the one still engaging with you, do.

But you are right, we are going in circles.

I think by now I expressed my point clearly enough, provided you with a few approaches how to get what you want working, explained the current feature set. You want support for dataless files, duplicacy does not offer it. I donā€™t know what else to tell you. Iā€™ve also went above and beyond and directed to other solutions that may fit your use case better. So Iā€™m not sure why are you so upset.

Ignoring this baseless ad-hominem attack ā€“ Iā€™m one dude. Iā€™m not representative of the whole community in any way. I disagree with your assessment of the situation. If you are requesting a feature ā€“ great, add your vote to that post, link is in my first or second response to you.

But if a new user comes and starts blasting accusation that everything is broken without trying to maybe check if they are doing something wrong ā€“ I immediately assume they did not do the homework, and try explain the basics. Be that here or on any other platform, workplace or elsewhere.

again, more concisely:

  1. use -vss, for coherent in time backups and access to locked files.
  2. exclude iCloud/OneDrive/DropBox/etc folder, unless you fully sync it, or use other cloud mounter that does not rely on filesystem filters, like rclone or mountain duck ā€“ whether they support iCloud itā€™s on your to research.
  3. use Arq, if you have to have dataless file support.
  4. Lack of a specific feature is not a bug. Your complaint that reading data over unsupported reparse point fails is missing the point: itā€™s not supported. Nobody promised it to work.
  5. Materializing files to a readonly snapshot is bug of a filesystem filter, report it to Apple, they listen.

Definitely not on purpose, but please point out specific bits I missed, Iā€™ll address it, if you want to continue constructive discussion.

Yep, read it again, thanks! :heart_decoration:

You redacted the pathnames - this is pretty damn obvious. Had this not been done, weā€™d have seen you were trying to back up OneDrive or iCloud. And weā€™d have told you to exclude that location (as well as use -vss). As I said, understandable yet unfortunate, but my suggestion wasnā€™t wrong given the circumstances.

I donā€™t know why you feel you need to go off on a long ā€œshit should just workā€ rant before bothering to understand Duplicacyā€™s (and many other toolsā€™) current limitations. Youā€™re not immune to reality, or common decency. The context to which our suggestions (as users here) are given, is to simply help solve your problem in good faith, and most users on this forum accept it without the crap attitude!

I have news for you. You canā€™t backup / without errors either. Most backup programs I know advise you to exclude shit like /dev/, /proc/, /sys/ too.

Again, Linux+Windows CLI+GUI user here of 6+ years, and 4 decades experience with numerous backup tools on all platforms. I manage just fine - using the right tool for the right job - Duplicacy works exceptionally well compared to most other software, once you know its capabilities and know how to use it.

I have complaints about some of Duplicacyā€™s shortcomings. For instance, GUI installation is poor, and plenty suggestions have already been put forthā€¦ the difference is, I remain respectful to the sole developer, and try to help users solve problems where I can, with whatā€™s presently feasible, without bitching through a sense of entitlement (having bought 3 personal lifetime licences and a good number of commercial down the road).

1 Like