Saving does not always work on Synology Drive Sync-Folder

Hi, dear Lightburn Users and DEV-Team!

Maybe i did something wrong, but i had the same Problem like described in this closed Topic:
Empty or defect files since update on 1.0 - LightBurn Software - LightBurn Software Forum

Lightburn 1.0.06 saved empty ~20kb Files twice now and destroyed a huge amount of work, so I did some investigation.

  • When saving my Work with “save as” for the first time, the savefile has about 260kb
  • As work went on, i saved with the “Disk”- Button in the Iconbar.
  • Suddenly, the Filesize was ~20kb, and an empty File opened the next time.
  • There were no Warnings or Popups.
  • When opening this empty File, the Software asks only once, if i want to use the Backup, which is empty, too. There are no further Questions or Popups.

My conclusion:

  • It always works, when I use the “Save As” Function from the Menu.
  • Sometimes it does not work, when i use the “Save” Button in the Top Iconbar.
  • I did not test the “Save” Menu entry, but i assume it uses the same Method.
  • I only had Problems with a synced Synology Drive Folder… As soon as i save it in a not synched Desktop Folder, everything works fine.

Maybe this Information helps to prevent Dataloss or helps the Dev-Team with Bug-Hunting.

Kind Regards, Tom

I’ve heard of others having corruption when working with shared folders or cloud synced folders. Is it a requirement that your working folder be a shared folder? Can you work from a local folder and copy over as required? Or setup an off-line syncing process? Either way you’ll probably want to do that at least in the immediate term since this is a known issue.

How are you connecting the network share? I assume this is running samba? Is this as a mapped drive or you’re connecting through a UNC path?

Do you have any power saving or sleep features on the Synology? Anything that would make the share not immediately available upon request?

Hi berainlb!
Thanks a lot for taking care about this Problem.
I will try to answer your Questions as good as possible:

  • Syncing is my Backup. I sync Folders to NAS, and NAS has a Backup-Run on a offsite NAS every Night.
  • “Synology Drive” is a Cloud-Drive Software like Nextcloud with Version History, but it is proprietary Synology Software. I guess, Samba is not involved here. But i could give the Samba Shares on my NAS a try…
  • And yes, i have Power Saving Features enabled on my NAS. Hard Disks will spin down after 1hr of inactivity. I will try and switch that off for a few days and Report.

Regarding your Tipps:

  • As you already mentioned, this is by now the only Solution i can see… I save the Files to a non synced local Folder and copy the files to the Sync Folder as soon as my work is finished. A bit inconvenient, but no showstopper for me.
  • Additionally, I will try to save directly to the Samba Shares. Sadly, there is no Version History on the Share without the Synology Drive-Software…

Thanks a lot for your Tipps!

Oh. I didn’t realize Synology Drive was a cloud solution. I’ve heard from others that cloud solutions also cause issues (e.g. Onedrive, Google Drive).

I’ve suspected for some time that this was related to the sync behavior interfering with writes. But didn’t realize it was different between “Save” and “Save-As”.

I know a lot of people have had issues with some of these scenarios so if you could narrow down specifically what causes it and what solutions do work it could be valuable to users as well as the dev team.

Ok, I talked to a Synology Supporter to explain the Sync Process and it is quite simple. I hope i understood his explanation right:

  • As soon as a inode changes, a Volume Shadow Snapshot of this File is taken and transmitted to the Synology Drive Software for Upload via FTP.
    He said, this is nearly the same method, other Sync-Software works. GDrive, OneDrive, Nextcloud and so on.

He said that Synology does not have any Information about Filewrite-Methods in Programming Frameworks like C++, Java and so on which has ever had Problems with this Method.
Well, what else should he say? :wink:

So i looked in my Windows Protocol and there it was: “IVssWriterCallback” Error at exactly the time the write failed. Now I assume the Problem is the Volume Shadow Service Snapshot on Windows Machines. Maybe a timeout, when the Synced File does not react fast enough?

Microsoft says " Die Ursache hierfür ist oft eine falsche Sicherheitseinstellung im Schreib- oder Anfrageprozess." (EN: “The reason for this is often an incorrect security setting in the writing or request process.”)
Error is: “0x80070005, Zugriff verweigert” (EN: “0x80070005, access denied”)

So, now I am somehow stuck… I cant analyse any further… Do you know how to contact the Devs for more Analysis? Is it possible to start the Software in some kind of “Debug-Mode” to get a Debug Logfile?

Edit: As far as i can see, the following Executable has the Problem: “LBFileDialog.exe”, but i could be wrong…

The Devs are often in this forum so they will see this.

For the error:
Error is: “0x80070005, Zugriff verweigert” (EN: “0x80070005, access denied”)

I’m wondering if the file is being locked by Synology Drive during the write attempt. Or possibly some sort of race condition.

I think this is a helper utility that opens a file dialog. Check here for some information on this:

Try renaming the file, restart LightBurn, and see if you still have the issue with save.
Also review the portion about it possibly being stopped by Anti-virus programs. Don’t know if this applies in your case.

[EDIT] - forgot to answer about the logging. Help->Enable Debug Log. Should write to LightBurnLog.txt in Documents.

Thanks for your advice!
Will start the Software in Debug-Mode the next time.
Had the Problem again a few minutes ago, and there was no Problem with “LBFileDialog.exe”, so i think it was a coincidence…
But i agree, it could be a File Locking Problem when Lightburn tries to save a File, while VSS takes the Snapshot for Sync.
Have to walk the Dog now, so more to come the next days… :slight_smile:
Thanks a lot for your Support! I appreciate this a lot!

Tried it once again and the Save-Problem occured again… multiple times…
I can see the following in the Debug-Log:

18:29:53.332 D: Clipboard data present:
18:29:53.332 D: (“application/x-qt-windows-mime;value="Shell IDList Array"”, “application/x-qt-windows-mime;value="DataObjectAttributes"”, “application/x-qt-windows-mime;value="DataObjectAttributesRequiringElevation"”, “text/uri-list”, “application/x-qt-windows-mime;value="UIDisplayed"”, “application/x-qt-windows-mime;value="DropDescription"”, “application/x-qt-windows-mime;value="FileName"”, “application/x-qt-windows-mime;value="FileContents"”, “application/x-qt-windows-mime;value="FileNameW"”, “application/x-qt-windows-mime;value="FileGroupDescriptorW"”, “application/x-qt-windows-mime;value="Shell Object Offsets"”, “application/x-qt-windows-mime;value="Preferred DropEffect"”, “application/x-qt-windows-mime;value="AsyncFlag"”)

This occures from time to time when i want to save my File to the synced Folder.

Maybe the Devs can use this Information for Bughunting… The full Debugfile is here:
LightBurnLog.txt (9.1 KB)

I use a Synology drive also. Try mapping the drive instead of using a synced folder if you can. I haven’t had this problem.

1 Like

Are you using Synology Drive - as in the cloud solution? I wasn’t aware of it but apparently it’s different than a local NAS.

They have software that you can download and setup folders for auto sync. I just map to the Synology and its a hard save to the folder on the drive. You lose the auto feature but for me that’s no big deal.

My computers are also on the same network so not really cloud.

Hi @micrololin!
Thanks a lot for your Tipps!

Maybe a bit OT, but just for clarification: Synology Drive isnt just a piece of Client Sync Software.
It has some cool server side features too, like automatic Fileversioning, a webclient and Office Functions (like Word Excel Powerpoint). It is just like the Google Suite, but on your own NAS and free for Synology Users. (like you! :wink: )

My Usecase: I like the File Versioning a lot, but it does not help much, if you have multiple Versions of empty Files… :wink: , and i can go somewhere else like our Makerlab with my Notebook and have all my Files and Software with me.

But i will try to setup a shared Folder and save there until this Bug is fixed. I think it has to be something with Lightburn, because i have this Problem with no other Software.

As a further workaround I wrote a small Background-Tool, which alarms me in the Windows Toolbar and via Popup, when a Lightburn Savefile is < 30kb. Just to save my Work, but this is not really a Solution… :slight_smile:

How did you do this?

It’s a Powershell-Script… quick and very, very dirty… But i think it will do the job.
(If you are interested: It works with the Class System.IO.FileSystemWatcher)

As you can see corrupted files are all smaller than 30kb…

File OK:
File OK

File corrupted:

I have also experienced this. I use Synology Drive for my project files as well, for all the same reasons.

I just had the empty save happen for the first time a couple weeks ago. One work around I’ve come up with for the moment, is I have my drives mapped as network drives, but also synced. The network drives should not be effected by any of the sync issues, but the synced drives make sure my projects are available when I am remote.

If you find a way to make this happen consistently either through settings in Synology Drive, or actions in LB let me know and I will try to reproduce. This will greatly increase the chances of a fix happening on our side.

If you are willing to share I am interested in your powershell script.

1 Like

LightBurn does the following when you save:

  • If you’re using ‘Save As’ (or the file is new) it prompts for the filename, using the LBFileDialog tool.
  • If the file already exists, LightBurn creates a temporary copy of it, in case the save fails
  • I call file.open() asking for write permission. If that fails, it shows a message that the save failed, and exits
  • I write the project contents to the file
  • If everything succeeded, I delete the backup

I’m not checking for errors while writing the file, but I’ve just added some periodic checks during the write to see if that helps. @JoeSpanier - I’ll submit this, and can you hammer it a bit and see if you now get “encountered an error when saving” errors?

  • Sidebar: LBFileDialog exists because some users have thumbnail previewers written using the same framework as LightBurn, but with a different version, and they’ll crash because the libraries are in the same process space, but different versions, and that crashes LightBurn. If we shell out to LBFileDialog, it isn’t built using the framework, and doesn’t have these issues.
3 Likes

@JoeSpanier : Thanks a lot for this Tipp. I will give it a try: Save directly to the Samba Share and Snyc it back automatically to local Drive via Synology-Drive. Brilliant!
All my Requirements are met now including Fileversioning with this Workaround! Thanks a lot!

Of course I can share the incomplete Script with you, but please, use it with care! It is really, really quick and dirty. :slight_smile: By now, it does log the filestates, and not the size (look at #$size= -Line and remove the #)
The Script shows the Filesize in kb in the Terminal Window, as soon as a File changes:
Screenshot 2022-01-03 230447

Ok, i will have to send the Scripts via Mail or so. Cant upload them and some of the Special Characters wont show as Backquote… Is it possible via PM?

@LightBurn : I have this ~20kb Filesize Problem consistently now. I would be glad to help testing.

Ok, Final Post…
Script now works better… Please only use this if you know what you are doing!

  • Download Script
  • rename to *.ps1
  • Enter your Save-Dir in code (e.g.: $filewatcher.Path = “C:\Users\ yourname\Documents\Lightburn”)
  • Rightclick and run it with powershell
  • minimize PS Console

As soon as a file in this Directory changes (create, rename, delete, change), the script will detect this and check the size.
If the size is lower than 30kb, a Popup-Message will show up and tell you that you should take care.

Screenshot 2022-01-04 002240

Please only use this, if you desperately need it! Quick and dirty…

If you want a quicker Detection, you can change the Timeout from 5 Seconds to 1 Second:
“while ($true) {sleep 5}”

LightBurn.Filesystem.Watcher_Popup.txt (1.3 KB)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.