Can't access front page after logging in - ArgumentOutOfRangeException: dueTime

Hi all,
We’ve been using Duplicati for a while, installing 2.0.8.1 for clients. It’s installed as a service in Windows.
We updated in the past month a couple of our clients over to 2.1.x.
All those clients ended up with issues regarding logging into the service, and it happens quite frequently. I recently did a fresh install of Duplicati 2.1.0.5 for a client and the same error occurred.
Here’s the error from Event Viewer:

Category: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
EventId: 1
SpanId: a0083d51750ea824
TraceId: fb11384a9b0a7eb0aa2064883dde6bf4
ParentId: 0000000000000000
ConnectionId: 0HNBBIDAJE66G
RequestId: 0HNBBIDAJE66G:00000001
RequestPath: /notifications

An unhandled exception has occurred while executing the request.

Exception: 
System.ArgumentOutOfRangeException: dueTime ('63878457600000') must be less than or equal to '4294967294'. (Parameter 'dueTime')
Actual value was 63878457600000.
   at System.ArgumentOutOfRangeException.ThrowGreater[T](T value, T other, String paramName)
   at System.Threading.Timer.Change(Int64 dueTime, Int64 period)
   at Duplicati.Server.LiveControls.Init()
   at Duplicati.Server.LiveControls..ctor(Connection connection)
   at InvokeStub_LiveControls..ctor(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.<>c__DisplayClass0_0.<<UseNotifications>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Here’s how I proceed when installing:

  1. Install Duplicati, remove feature to automatically start (because it starts as GUITrayIcon) & check “launch Duplicati” once install is complete.
  2. Open browser, create passphrase when prompted.
  3. Close Duplicati through the GUITrayIcon’s quit option.
  4. Copy the files created in the user context by Duplicati into another datafolder (C:\Duplicati\data): xcopy /h /s /e /i "%localappdata%\Duplicati" C:\Duplicati\data
  5. Install the service, specifying the server datafolder: "C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" install --server-datafolder="C:\Duplicati\data"
  6. Start the service: sc start Duplicati
    This works greta and everything is fine, however 1-2 days later I’ll be unable to login to Duplicati anymore, with the error message stated above.
    The reason for the wierd commands is that it was the best way I found to upgrade previous installations from 2.0.8.1 to 2.1.x.
    However, all the 2.1.x versions have given the same error as above at one point or another; I have reverted all the upgrade to 2.1.x so far back to 2.0.8.1.

Does anyone have any leads as to why this error occurs? Can it be a timezone or OS language issue?

Thanks for your help.

Hi @nmiyazaki-chapleau, welcome to the forum :wave:

Thanks for that. We have had one other user report this.
What they reported happening was that they changed locale to something different, and suddenly Duplicati would not start. Changing the locale back fixed it.

The error message itself is related to a startup delay. Here it is trying to set the delay to wait before starting Duplicati. Due to some yet-unknown sequence of events, it tries to wait for several years, which the timer refuses to do, and then it crashes.

There are two ways the delay can be set:

  1. From “Startup delay”, which is an option that can be set on the general settings page
  2. From being paused when being shut down

The “Statup delay” is a string like “5s” so I do not know how that could be affected by a locale setting.

If Duplicati is paused for a limited duration during shutdown, the wake-up time is stored as seconds since 1970-01-01 (Unix Epoch). This should not be affected by date-time format changes, and the other reporter of the issue insists that no timezone was changed, only the date-time format.

Given that you say it “eventually fails”, I am leaning towards (2) being the problematic one.
Do you recall if Duplicati was paused when being shut down?

If you have a machine that does this, could you use a tool such as SQLite Browser and look in Duplicati-server.sqlite in the table Option.

Here there should be several rows, but the two I am interested in have the “Name” values:

  • paused-until
  • startup-delay

If you can report these two values and the datetime format + timezone of your machine, I can try to reproduce it and eventually fix it.

Here are the values for the client with Duplicati 2.1.0.5 with no previous Duplicati installed before that:

  • paused-until: does not exist
  • startup-delay: 0s

The datetime format or timezones have not changed at any point since Duplicati was installed. There was no pause either.

Data formats according to Windows:

  • Short date: Y-m-d (2017-04-05)
  • Country/region: Canada
  • Regional format: English (Canada)
  • Display language: English (US)
  • Default app language: Français (Canada)
  • Timezone: Eastern time (US & Canada) (UTC -05:00)
  • Adjust for daylight saving time automatically: yes

I did setup 1 backup but never executed it. Wierdly enough, I don’t see any backup SQLite file in the data folder. However, the Duplicati DB does show a Backup has been setup, but I’m guessing the file doesn’t exist because it was never executed.

The only wierd number I see in the DB is:

  • Schedule for backup 1’s ‘Last Run’ value is “-62135578800” (I’m guessing it’s handled as haveing never ran, but mentionning it just in case)

By “eventually fails”, I mean when I looked back 2 days later to finish the setup, the issue previously mentioned was happening. The schedule was setup however, so it initially failed within the same day as it was installed, before the scheduled backup ever ran (assuming so, since no backups were ran even though the schedule was setup and the backup has valid target destination and everything, and no logs were generated regarding backup errors or warnings, according to the Duplicati DB SQLite).

Wierdly, the regional format from Windows differs from another Windows screen…
The proper regional settings are:

  • Format: French (Canada)
  • Display Language: English (US)
  • Language for non-unicode programs: French (Canada)

I tried replicating this with no luck today.

One thing I did see was that apparently the string 1-1 is a valid date under those regional settings. Not sure exactly how that value is getting in there, but I can see from the stack trace that only the value startup-delay is being processed in a way that could cause the crash.

With the value 0s in the startup-delay field, it starts correctly for me with fr-CA regional settings and UTC-5 clock.

I will wait a bit and try again to see if some timestamp is being saved in an unexpected way.

I had the same problem when i updated to 2.1.0.5. I did not change the local, but I use french Canada for Windows.

I went into Duplicati-server.sqlite and changed two values.
startup-delay 0s → [Blank]
last-update-check 638785267638493087 → 638791142105166147

After starting the tray application, it worked.

Edit, here is the full output of my error :

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

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
Crash!
Duplicati.Library.Interface.UserInformationException: Server crashed on startup
—> System.Exception: Une erreur critique s’est produite dans Duplicati: System.ArgumentOutOfRangeException: dueTime (‘63879062405000’) must be less than or equal to ‘4294967294’. (Parameter ‘dueTime’)
Actual value was 63879062405000.
at System.ArgumentOutOfRangeException.ThrowGreater[T](T value, T other, String paramName)
at System.Threading.Timer.Change(Int64 dueTime, Int64 period)
at Duplicati.Server.LiveControls.Init()
at Duplicati.Server.LiveControls..ctor(Connection connection)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr) at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Duplicati.WebserverCore.Extensions.ServiceCollectionsExtensions.<>c.<AddDuplicati>b__0_0(IServiceProvider c) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) 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_WorkerThreadsManager() at Duplicati.Server.Database.ServerSettings.SaveSettings() at Duplicati.Server.Database.ServerSettings.set_ServerPortChanged(Boolean value) at Duplicati.Server.Program.set_ServerPortChanged(Boolean value) at Duplicati.Server.Program.StartWebServer(IReadOnlyDictionary2 options, Connection connection)
at Duplicati.Server.Program.Main(String _args)
—> System.ArgumentOutOfRangeException: dueTime (‘63879062405000’) must be less than or equal to ‘4294967294’. (Parameter ‘dueTime’)
Actual value was 63879062405000.
at System.ArgumentOutOfRangeException.ThrowGreater[T](T value, T other, String paramName)
at System.Threading.Timer.Change(Int64 dueTime, Int64 period)
at Duplicati.Server.LiveControls.Init()
at Duplicati.Server.LiveControls..ctor(Connection connection)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr) at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Duplicati.WebserverCore.Extensions.ServiceCollectionsExtensions.<>c.<AddDuplicati>b__0_0(IServiceProvider c) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) 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_WorkerThreadsManager() at Duplicati.Server.Database.ServerSettings.SaveSettings() at Duplicati.Server.Database.ServerSettings.set_ServerPortChanged(Boolean value) at Duplicati.Server.Program.set_ServerPortChanged(Boolean value) at Duplicati.Server.Program.StartWebServer(IReadOnlyDictionary2 options, Connection connection)
at Duplicati.Server.Program.Main(String _args)
— End of inner exception stack trace —
at Duplicati.Server.Program.Main(String _args)
at Duplicati.GUI.TrayIcon.HostedInstanceKeeper.<>c__DisplayClass5_0.<.ctor>b__0(Object dummy_arg)
— End of inner exception stack trace —
at Duplicati.GUI.TrayIcon.HostedInstanceKeeper..ctor(String args)
at Duplicati.GUI.TrayIcon.Program.Main(String _args)
at Duplicati.GUI.TrayIcon.Net8.Program.<>c__DisplayClass0_0.b__0()
at Duplicati.Library.Crashlog.CrashlogHelper.WrapWithCrashLog[T](Func1 method, String logdir, String applicationName) Unhandled exception. Duplicati.Library.Interface.UserInformationException: Server crashed on startup ---> System.Exception: Une erreur critique s'est produite dans Duplicati: System.ArgumentOutOfRangeException: dueTime ('63879062405000') must be less than or equal to '4294967294'. (Parameter 'dueTime') Actual value was 63879062405000. at System.ArgumentOutOfRangeException.ThrowGreater[T](T value, T other, String paramName) at System.Threading.Timer.Change(Int64 dueTime, Int64 period) at Duplicati.Server.LiveControls.Init() at Duplicati.Server.LiveControls..ctor(Connection connection) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Duplicati.WebserverCore.Extensions.ServiceCollectionsExtensions.<>c.b__0_0(IServiceProvider c)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
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_WorkerThreadsManager()
at Duplicati.Server.Database.ServerSettings.SaveSettings()
at Duplicati.Server.Database.ServerSettings.set_ServerPortChanged(Boolean value)
at Duplicati.Server.Program.set_ServerPortChanged(Boolean value)
at Duplicati.Server.Program.StartWebServer(IReadOnlyDictionary2 options, Connection connection) at Duplicati.Server.Program.Main(String[] _args) ---> System.ArgumentOutOfRangeException: dueTime ('63879062405000') must be less than or equal to '4294967294'. (Parameter 'dueTime') Actual value was 63879062405000. at System.ArgumentOutOfRangeException.ThrowGreater[T](T value, T other, String paramName) at System.Threading.Timer.Change(Int64 dueTime, Int64 period) at Duplicati.Server.LiveControls.Init() at Duplicati.Server.LiveControls..ctor(Connection connection) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Duplicati.WebserverCore.Extensions.ServiceCollectionsExtensions.<>c.b__0_0(IServiceProvider c)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
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_WorkerThreadsManager()
at Duplicati.Server.Database.ServerSettings.SaveSettings()
at Duplicati.Server.Database.ServerSettings.set_ServerPortChanged(Boolean value)
at Duplicati.Server.Program.set_ServerPortChanged(Boolean value)
at Duplicati.Server.Program.StartWebServer(IReadOnlyDictionary2 options, Connection connection) at Duplicati.Server.Program.Main(String[] _args) --- End of inner exception stack trace --- at Duplicati.Server.Program.Main(String[] _args) at Duplicati.GUI.TrayIcon.HostedInstanceKeeper.<>c__DisplayClass5_0.<.ctor>b__0(Object dummy_arg) --- End of inner exception stack trace --- at Duplicati.GUI.TrayIcon.HostedInstanceKeeper..ctor(String[] args) at Duplicati.GUI.TrayIcon.Program.Main(String[] _args) at Duplicati.GUI.TrayIcon.Net8.Program.<>c__DisplayClass0_0.<Main>b__0() at Duplicati.Library.Crashlog.CrashlogHelper.WrapWithCrashLog[T](Func1 method, String logdir, String applicationName)
at Duplicati.GUI.TrayIcon.Net8.Program.Main(String args)

1 Like

Amazing! Changing the startup delay to empty did it for me as well. I did not need to change the last-update-check value.
Although I am using WindowsService.exe that calls the Server, it worked. I stopped the service through services.msc, changed the value of startup-delay to empty (but not null), started the service and I had immediate access to the UI.
Question is: why does this occur? We should probably prevent startup-delay to be set to 0s.

Amazing indeed! And thanks @RandomGuy for figuring out the problematic value.

It turns out that the value 0s can be interpreted as “0 seconds after midnight” in fr-CA locale.
Problematically, the UI will default to 0s when saving the settings, causing the problem to re-appear.

For coding inclined people, this reproduces the problem:

var ci = CultureInfo.GetCultureInfo("fr-CA"); // en-US and most other locales do not match
if (DateTime.TryParse("0s", ci, DateTimeStyles.AssumeLocal, out var t))
    Console.WriteLine(t.ToString());
else
    Console.WriteLine("No match");

Apart from the fix to the database, I do not have a good workaround.

It is not a problem in the canary builds, because it does not try to parse the delay as a date at all.
But knowing this, there are likely other problems with parsing a date.

I’m guessing my issue below is also a bug caused by this?

If so, is there a fix for that one?

It could be, if the distance between two backups is also parsed as a valid then it would also break.
I will follow up in the other topic.

In any case, I have a fix ready now.