Updates and Windows service

What is the correct procedure for doing updates when running Duplicati as a service?

Here is what I have done.

Yesterday I decided to move from the current beta to canary 2.0.2.7. Just changed the Update channel to canary and it finds and grabs the download. I activate it. Now service won’t start! Doesn’t start as tray icon either.

After some time of playing around I figured out the updates are going into the c:\ Programdata\Duplicati\Updates\2.0.2.7 directory.
I stopped my Duplicati service deleted it.
Not wanting to keep moving the Duplicati data directory around I created a new folder for it on a different drive. The data is now stored in d:\Duplicati\data.

I setup the service again same what as before but in the c:\ Programdata\Duplicati\Updates\2.0.2.7 dropped the --portable-mode option and added --server-datafolder=d:\Duplicati\data
started service and all was fine again.

Noticed the new 2.0.2.8 version today. Had it download and I activated the update. Broke again. Was expecting the 2…0.2.8 directory to be added to the update folder or replace the 2.0.2.7. This didn’t happen.

I had to delete the 2.0.2.7 directory redo my service back to beta folder. From that point it allowed me to download and install the 2.0.2.8 version. Reset the service and good again.

What am I doing wrong?

Did you notice any errors in the logs (Duplicati or Windows) that might point to the culprit?

I know there have been some reported issues related to updating through the app but I believe they were all “handled” by doing a regular install over the existing (updated-then-broken) version.

1 Like

The duplicati doesn’t start at all but I get these in my windows logs this was right after my attempt to go from 2.0.2.7 to 2.0.2.8

Faulting application name: Duplicati.Server.exe, version: 2.0.2.7, time stamp: 0x59c0f920
Faulting module name: KERNELBASE.dll, version: 10.0.15063.608, time stamp: 0x943cbf8b
Exception code: 0xe0434352
Fault offset: 0x0000000000069e08
Faulting process id: 0x1d80
Faulting application start time: 0x01d3318c2a94e385
Faulting application path: C:\ProgramData\Duplicati\updates\2.0.2.7\Duplicati.Server.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: ac14fefa-d084-4fa6-9592-b6c7bf27854c
Faulting package full name:
Faulting package-relative application ID:

Application: Duplicati.Server.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
Exception Info: System.IO.FileLoadException
at Duplicati.Library.AutoUpdater.UpdaterManager…cctor()
Exception Info: System.TypeInitializationException
at Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecent(MethodInfo method, String cmdargs, AutoUpdateStrategy defaultstrategy)
at Duplicati.Server.Program.Main(String args)
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String args)
at System.AppDomain.ExecuteAssemblyByName(String assemblyName, String args)
at System.AppDomain.ExecuteAssemblyByName(System.String, System.String)
at Duplicati.Library.AutoUpdater.UpdaterManager.RunFromMostRecent(System.Reflection.MethodInfo, System.String, Duplicati.Library.AutoUpdater.AutoUpdateStrategy)
at Duplicati.Server.Program.Main(System.String)

Next entry is an attempt to restart service.

So should the folder 2.0.2.8 been added to the updates folder? Do I need to delete the service and recreate it pointing to the new location?

If you’re looking to help identify the source of the issue, we’ll have to get back to you (I think some code digging might be in order).

However if you just want to get Duplicati v2.0.2.8 canary going, since it looks like there might be an issue with the internal update process I’d suggest downloading it from the “Other versions - older or testing” download page and doing a “normal” install over your current version (no need to un-install).

Thanks but I already managed to get it working by dropping back to beta and moving to canary with new version.

In the near future it does look like it would be easier to reinstall at this point. But then where is the fun in that.

That’s good - I’m glad it’s at least working for you.

Just to make sure I’m understanding this right, for you the fix was this?

  1. Use the UI Settings menu to change your “Update channel” from canary to beta
  2. Check for (and install) updates (essentially downgrading you to v2.0.2.1 beta)
  3. Go back to the UI Settings menu and change your “Update channle” from beta to canary
  4. Check for (and install) updates (essentially re-upgrading you to v2.0.2.8 canary)

Please let me know if I got those steps right as I think others who bump into this might find it useful (at least until we get the canary update path fixed). :slight_smile:

Since duplicati was basically toast at this point I had to.

  1. Stop duplicati service
  2. Delete Duplicati service.
  3. Delete the c:\programdata\duplicati\updates\2.0.2.7 folder
  4. Added the service back in the c:\program files\Duplicati 2\ directory
  5. Start duplicati service (Now works with original BETA version)
  6. Back in duplicity I think I toggled the canary back to beta then right back to canary to download and activate 2.0.2.8.
  7. Back to command prompt stop the service again.
  8. Delete duplicati service
  9. cd c:\Programdata\duplicati\updater2.0.2.8
  10. setup the duplicati service again from here.
  11. Now running under 2.0.2.8

Hopefully I didn’t leave anything out.

I think I know this one. It has something to do with loading a library, and then loading it again in a new version. It should work, since Duplicati is using a new “AppDomain” for the updated version, but from the update failures I have seen, sometimes this is not the case.

I can confirm this and reproduce it. Until v 2.0.2.4 or 2.0.2.5 in-app updating worked without problems. Since the last canaries all service-based in-app updates fail, resulting in a broken Windows service and a crashing Windows.Server.exe.

This video shows what goes wrong:

Uninstalling the service also fails sometimes (not in this video). In that case, I have to restart my computer and use sc delete duplicati to remove the Duplicati Windows service.

Some key moments in the video:
01:50 - Updating Duplicati
02:40 - Activate the downloaded update
03:00 - Webserver not responding
04:10 - Duplicati.Server.exe crashes
05:00 - Uninstall Windows service
05:25 - Reinstall Windows service0
08:30 - Copy Zip contents v2.0.2.9 over existing program files
10:00 - Reinstall Windows service
10:35 - Update notification keeps popping up, but latest version is installed.

3 Likes

Awesome! Thanks!

I am not 100% sure what happens, but I think the Service is loading some assemblies, and this is causing the update to fail loading the correct (updated) version of the same assemblies, causing it to crash.

I confirm you can’t leave data in the directory
C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati
when running in service mode on Windows 10 (multi user machine)

When Microsoft Windows 10 run a major update it creates a c:\windows.old directory and the data are in this directory and the service looks in c:\windows… that is empty !

2 Likes