Cannot make 2.0.9 work as Windows Service

Hi all,
I had Duplicati 2.0.8 installed and working. I wanted to try Canary 2.0.9 and tried the following:

  • uninstalled 2.0.8 but kept database in C:\ProgramData\Duplicati\Data
  • installed 2.0.9
  • executed Duplicati.WindowsService.exe install --server-datafolder=C:\ProgramData\Duplicati\Data --webservice-password=password which executed successfully
    The I tried to connect to http://localhost:8200 but I’m getting a ERR_CONNECTION_REFUSED error
    I also tried Duplicati.GUI.TrayIcon.exe --no-hosted-server --webservice-password=password but I’m getting the following error:
C:\Program Files\Duplicati 2>Unexpected error: System.AggregateException: One or more errors occurred. (Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. (localhost:8200))
 ---> System.Net.Http.HttpRequestException: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. (localhost:8200)
 ---> System.Net.Sockets.SocketException (10061): Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequestInternalAsync[T](String method, String endpoint, String body, Nullable`1 timeout)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequestInternal[T](String method, String endpoint, String body, Nullable`1 timeout)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequest[T](String method, String urlfragment, String body, Nullable`1 timeout)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.IssueSigninToken(String password)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.ObtainSignInToken()
   at Duplicati.GUI.TrayIcon.HttpServerConnection.ObtainAccessToken()
   at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequest[T](String method, String urlfragment, String body, Nullable`1 timeout)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.UpdateStatus(Boolean longpoll)
   at Duplicati.GUI.TrayIcon.HttpServerConnection..ctor(Uri server, String password, PasswordSource passwordSource, Boolean disableTrayIconLogin, Dictionary`2 options)
   at Duplicati.GUI.TrayIcon.Program.StartTray(String[] _args, Dictionary`2 options, HostedInstanceKeeper hosted, String password)

Welcome to the forum @starob

Were there Windows operations to stop, start, or restart the service anywhere in that sequence?

It sounds like the service was either not started or went down. You can watch it in Task Manager.

Thanks for your support. Indeed the service was not running. I started it but it I still cannot login. I always get “Not logged in” even after entering the correct password at http://localhost:8200

Try a new tab, or if you want to test on current tab, try refresh. If that fails, try hard refresh.

I think I had to hard refresh once, but I haven’t figured out a reproducible way to need that.

I have noticed that the service is not started after being installed.
Would it be more logical if it started the server after install?

If you use 2.0.9.106 I have added logging to Windows Event Viewer, so you should be able to view some additional error messages there. But as @ts678 suggested, it might be the login page that is cached with the 2.0.8 version and a browser hard refresh (CTRL+F5) should fix the login page.

I’m answering as starob2 because my starob account is on hold?

Yes, absolutely. If I install a windows service it should start immediatly. At least that is my opinion. Actually it would be even better to make the Windows Service installation an option in the installation program.

CTRL+F5 did the job, thank you.

But I have a few other questions/issues:

  1. Is 2.0.9.106 fully compatible with 2.0.8.1 in regard to backing up/restoring data? I restored files from a 2.0.8.1 backup and got a hash mismatch error for one exe file. At some point there was also a message about encryption but it disappeared and never showed up again.
  2. I started Duplicati.GUI.TrayIcon.exe --no-hosted-server --webservice-password=password but it behaves strange, almost unusable. Windows asked if it should kill the process and I did. Tried this a few times but always the same.
  3. When there is a backup job scheduled for a time slot that happens to trigger while my notebook is in standby I’m getting a “Cannot connect to server” error. I assume that is related to Windows Modern Standby somehow. I tried many things like disabling WiFi during standby but I could not prevent that from happening. This is also the case with version 2.0.8.1

Appreciated your support. Thanks

Update: I fixed #2 by checking “Prevent tray icon automatic log-in”. Strangely enough it does not ask me for a password but auto logs in. Probably because I added --webservice-password=password.

I approved that account; it was caught in some anti-spam guard.

Yes, the remote data format has not changed, so you can freely go back-n-forth, at least as far as the files go.

Not sure why that option should change the “almost unusable” state. The option just disables pre-fetching a signin token for the url to open when clicking “Open”. When not opening the page from the trayicon, the option should have no effect on the TrayIcon or Server/Service.

The reason why you are not asked for a password, is likely because you are already logged in via the browser. If you click the “Logout” menu and close the tab, opening from the trayicon should once again ask you for a password.

It sounds like the network is disabled during standby but Duplicati is not suspended.

I have added an issue for pausing/delaying backups while in Modern Standby state.

1 Like

As starob2 wrote trayicon is unusable because without enabling this option the Duplicati.GUI.TrayIcon.exe process hangs after clicking Open in the context menu and nothing happens. The user has to kill the process. With it enabled the browser starts and nothing hangs.

Confirming an issue on 2.0.9.111 with an Open hang using --webservice-password=<password> option on Duplicati.GUI.TrayIcon.exe. The Pause and Quit items seem to work, but Open draws TrayIcon menu in a slightly wide way (both the text and the icons seem to stretch), then stays in spinning-circle-when-moused-over busy mode. On network, it did its issuesignintoken sequence.

Another workaround for some is to start TrayIcon with --read-config-from-db --server-datafolder="C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati"

Change if you moved your datafolder, and beware that default needs elevated admin to access…

Workaround inspired by what TrayIcon would say to the terminal, but you might not be using one:

When running the TrayIcon without a hosted server, you must provide the server password via the option --webservice-password=<password>.
If the TrayIcon instance has read access to the server database, you can also or use the option --read-config-from-db, possibly with --server-datafolder=<path>.

No password provided, unable to connect to server, exiting

At time of the Open hang, nothing comes out on the TrayIcon terminal or its profiling --log-file.

This is now the case with the latest canary build.

I have added an issue for tracking this problem

Thanks for confirming and providing extra details.

This is fixed in source and will be part of the next canary build: