Duplicati Client crashes and/or quits every few days

Running Win10, upgraded several months ago from Win8.1; running the latest stable version of Duplicati. For several weeks now, I’ve noticed that when I come back to my PC after several days, often the Duplicati client has silently either crashed or quit on me (there’s no crash message, no error, no warning, no log file that I know of).

I’m unclear whether this corresponds to my upgrade to Win10 or not, but I’ve definitely updated Duplicati since then. It runs fine otherwise (i.e. backups complete with no errors, scheduled jobs go off about as they should, etc).

Any suggestions appreciated. Sorry in advance if I’m not super responsive, I have 2 small kids at home now, so there can be stretches of a few days at a time where I don’t get to so much as sit down at my PC.

I have recently fixed a potential resource leak with the TrayIcon. This fix is only in Canary builds for now, but it is a leak that could build up over time, so it sounds a bit like your scenario.

I assume you are running the TrayIcon.

But even in this case, there should be a message in the Windows EventViewer detailing the crash.

If not, can you try for testing to start Duplicati from a commandline and then leave the commandline window open? This should emit some additional errors if Duplicati somehow exits out-of-order.

To do so, pres Win+R, type “cmd” and press enter.
Then type (or copy):

"C:\Program Files\Duplicati 2\Duplicati.GUI.TrayIcon.exe"

And press enter. This should start Duplicati and leave a blinking prompt. Just leave the window, and if it crashes, there should be some text in the window.

I’ve done stuff with Event Viewer in the past, but i’m having no luck discerning any entries for Duplicati among the thousands of things listed (and of course I don’t have a solid reference for when the most recent crash was, precisely). If you have a hint for me here, i’d appreciate it.

In the meantime I’ll try your trick for launching it via a command prompt. Thanks :slight_smile:

I immediately get an error message of “no database encryption key was found”. The first time I tried it, it immediately went on to report an error, so I assumed this was related, but the second time I tried it, it proceeded to work anyway after this advisory (without the following error). This is the error message I got, which repeated a few times:

That sounds really odd. So it seems to require an encryption key, but can start without one?
The should not be possible.

Do you use database encryption or not?

It is something we should fix, but it requires a larger overhaul of the webserver internals.
It should not cause the TrayIcon to crash though, it will just give a 500 error to the UI that is attempting to get the current schedule.

I assume Duplicati kept running?

In Event Viewer, the default location is Windows Logs → Application. On the right bar, a Filter by source should help get Duplicati issues, but they’re often under .NET Runtime.

Isn’t this a usual warning?

is what I thought is normal until one has yielded to the nag and done as asked.

2 Likes

The warning message is expected, yes.
But, itt sounds like the message went away without any user action, which is not expected at all.

This has been an exercise in guessing which message is meant. Which went away?

My attempt at reading went like this:

The “went on”, to me, meant the Kestrel NullReferenceException, the later message.

I took “advisory” to mean warning, and “following error” to mean the later Kestrel error.

then shows both messages, but I thought image was mostly to show the Kestrel error.

Maybe both of you can clarify which message is meant in unclear cases. I’m confused.

If it’s surprising that the Kestrel error was not always there, if that’s what this says, OK.

My bad for the inclarity of my quoted comment. It looks as if you decoded my meaning correclty, though.

To verify: I was originally describing 2 consecutive attempts to run it from the CLP; both times I got the “encryption” warning, but the first time, I got the terminating error (the part starting with the red-highlighted “FAIL” text), and the second time (with no other changes on my part), I did not get that error, and the attempt went on to work, despite still receiving the “encryption” message.

1 Like

I see now. The warning message about encryption is actually not related to the crash message, it shows every time. You can see that it just warns that the database is not encrypted.

The crash itself has been fixed in source and latest canary builds:

But this should not be a problem that causes crashes when running, because it is a race during initialization. As soon as it has started, that particular problem will not be triggered again.

Hey again - the crash when running from CLI eventually happened, here’s a screenshot of the residual result.

FWIW, the command prompt fails to come back naturally - it looks like i’ll either need to CTRL-C it or close the window and open a new one.

It came back when you ran Duplicati. Below you can see it talking from the background:

C:\Program Files\Duplicati 2>Duplicati.GUI.TrayIcon.exe

C:\Program Files\Duplicati 2>No database encryption key was found. The database will be stored unencrypted. Supply an encryption key via the environment variable SETTINGS_ENCRYPTION_KEY or disable database encryption with the option --disable-db-encryption
Server has started and is listening on port 8200
An error occurred on server tear down: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Duplicati.Library.RestAPI.FIXMEGlobal.get_UpdatePoller()
   at Duplicati.Server.Program.get_UpdatePoller()
   at Duplicati.Server.Program.<>c.<Main>b__60_10()
   at Duplicati.Server.Program.Main(String[] _args)

C:\Program Files\Duplicati 2>

The stack trace is the messy TrayIcon right-click Quit. This time, another Enter got second prompt, but sometimes (for unknown reasons) I have to repeat Enter, try Ctrl-C, and so on.

I had to CTRL-C, and it came back. I then launched Duplicati again and it’s currently running fine again (for now).