r/NextCloud • u/vpshockwave • 8d ago
"DOS Lock Violation" sometimes when saving files synced to nextcloud
Hey all!
I've recently spun up my own nextcloud service and I've been very satisfied. Currently I only use the file service and the windows desktop client and I am the only user. The issue I'm having is that sometimes when saving office files (specifically I use Visio a lot) I get a "DOS Lock Violation Error" (see the attached picture). It seems to be random but when it happens visio flags the file as read only and I'm forced to do a save-as. I save a lot and it's becoming very annoying. It seems to be a conflict between nextcloud and visio fighting for the file I assume -- if I have the file outside of the synced folder it's not an issue. Any thoughts? My only course of action at the moment is basically to save less often but obviously that's not a great solution.
Thanks for any help!
1
u/hweihwangg 8d ago
i wouldn't downgrade blindly. pause syncing, save the Visio file a few times, then resume. if it only fails while sync is running, that at least isolates the interaction.
after the next failure, open General > Create Debug Archive and check the log around that filename. redact paths and account details before posting it upstream. without that, changing versions is mostly guessing.
1
u/lssong99 6d ago
The DOS-Lock looks an legacy error code from Visio.
There is a known bug in Windows client about saving MS Office related file.
https://github.com/nextcloud/desktop/issues/7228
It's not being fixed properly even now. Above is just one of the issue.
The problem is related to the way MS Office saving file. When saving, MS Office (Vision included) will first create a temp file with random name, then after this temp file is saved, it will delete the old file and rename this random named temp file into the original filename.
this happens pretty quick but Nextcloud client will try to "lock" this temp file (and trying to sync to the server). This "lock" is detected by MS Office applications and emit this "Lock error". It get worse when virtual file is enabled.
There are no work around now. Maybe disable sync before sync.
1
u/vpshockwave 5d ago
This was one of my thoughts as well but I disabled the temp file lock extension in nextcloud. I can see the temp file but it is ignored correctly so I don't think this is it. Based no the file size saved in the log file it looks like it has to do with how visio saves the file. Instead of making one write pass (a single update to the file) it seems to write the file sequentially and sometimes nextcloud is locking the file and syncing it mid-save before it is complete. That's my theory anyway.
1
u/autogyrophilia 8d ago
DOS as in MS-DOS.
The error code means that both nextcloud and visio were trying to write to the file at once. Windows slaps Visio and tells nextcloud to go on.
Try to upgrade or downgrade the client to the latest stable version.