Windows 11 2024H2 - TrayIcon won't load when starting Duplicati as a service

I’m running Duplicati as a service.

Because of this I don’t want to run a “normal” version of the tray that would spawn another instance of the server as well. When I try to use any of the arguments that would just launch the tray, it fails.

I’ve tried numerous iterations of the command line, and most fail without even writing a log file.

For brevity I’ve only included the output from a few of the attempts.

The actual service is running fine. It’s actually running on the local system, but I shouldn’t need to reference the db location or similar, I think?

I’ve tried with and without a password on the UI.

Windows 2024H2

#Works, detects existing server, starts on 8300 & Logs tofile
.\Duplicati.GUI.TrayIcon.exe --log-level=Profiling --log-file=“c:\tray-icon-log.txt”

#Doesn’t work, no log
.\Duplicati.GUI.TrayIcon.exe --log-level=Profiling --log-file=“c:\tray-icon-log.txt” --no-hosted-server

When running the TrayIcon without a hosted server, you must provide the server password via the option --webservice-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=.

No password provided, unable to connect to server, exiting

#Doesn’t work, no log
.\Duplicati.GUI.TrayIcon.exe --log-level=Profiling --log-file=“c:\tray-icon-log.txt” --no-hosted-server --serverurl=https://localhost:8200 --webservice-password=“XXXXX”

PS C:\Program Files\Duplicati 2> .\Duplicati.GUI.TrayIcon.exe --log-level=Profiling --log-file=“c:\tray-icon-log.txt” --no-hosted-server --serverurl=https://localhost:8200 --webservice-password=“XXXXX”
PS C:\Program Files\Duplicati 2> Unexpected error: System.AggregateException: One or more errors occurred. (Response status code does not indicate success: 400 (Missing XSRF Token. Please reload the page).)
—> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Missing XSRF Token. Please reload the page).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequestInternalAsync[T](String method, String endpoint, String body, Nullable1 timeout) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequestInternal[T](String method, String endpoint, String body, Nullable1 timeout) at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequest[T](String method, String urlfragment, String body, Nullable1 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, Nullable1 timeout) at Duplicati.GUI.TrayIcon.HttpServerConnection.UpdateStatus(Boolean longpoll) at Duplicati.GUI.TrayIcon.HttpServerConnection..ctor(Uri server, String password, PasswordSource passwordSource, Boolean disableTrayIconLogin, String acceptedHostCertificate, Dictionary2 options)
at Duplicati.GUI.TrayIcon.Program.StartTray(String _args, Dictionary`2 options, HostedInstanceKeeper hosted, String password, String acceptedHostCertificate)

Is this an old setup, recently updated, new setup, or what? If updated, was this OK before?

Please provide Duplicati version, and make sure your service config runs what you expect.

You probably were aiming for --hosturl. Make sure server https is set up (else don’t ask).

is the 2.0.8.1 code, probably the same in earlier versions. If you think you’re on 2.1, make sure Windows service doesn’t have Path to executable pointed, e.g. at some 2.0.8.1 autoupdate.

looks like the 2.1 way, although I didn’t actually look it up. Basically, check for version mismatch.
If you mean to be on 2.1 but service isn’t configured that way, note current config and reinstall it.

This is how it is supposed to work, but you need --hosturl as @ts678 mentions, and it is default regular http (not https, unless you enabled it manually):

.\Duplicati.GUI.TrayIcon.exe --log-level=Profiling --log-file=“c:\tray-icon-log.txt” --no-hosted-server --hosturl=http://localhost:8200 --webservice-password=“XXXXX”

I am a bit confused as well, but the XSRF tokens are a thing from 2.0.8.1 and older, so it is possible there is a version mismatch.

This might be the issue I wrote about as

and happens because if someone ever does a service install after having ever done autoupdate, configuration of service picks up the new version path from whatever updates folder it resides in. Updating the main Duplicati install to C:\Program Files\Duplicati 2 won’t change that config.

User should go see what’s configured in the service, either in services GUI or sc qc duplicati

I see. So the error is only present if the user has installed one version, updated, and then used Duplicati.WindowsService.exe INSTALL on this updated version, as it will then point into the updates folder.

I guess it would then fail at some point anyway, once enough updates are installed.

I was considering wiping the updates folder when starting 2.1.0.2+ but I decided against it, in case the user wants to downgrade.

Yes, or at least it was thought in the issue

Windows service install/uninstall/start invalidates update by writing into it, causing version downgrade #5088

Looking at the Properties of the service shows that it starts the update directly, which is going to be a problem if something removes it because there are too many updates. I forget what the limit is, but I think that there is one. It will get hit slowly in Beta. Canary is faster.

Although service issue seems fairly definite, we don’t yet know if this is what was seen here.

Will wait to see what @harr2969 finds.

Apologies. I’m in IT and it appears I turned into a “user” (shudders)

I’m a long time Duplicati user (since Crashplan went paid) with it running as a service for quite a while.
I recently updated and noticed the tray icon is gone.
“You are currently running Duplicati - 2.0.8.1_beta_2024-05-07”

I see a newer version available ([Duplicati v2.1.0.2] is available, ) , I’ll update before I do too much else.

Is 2.0.8.1 what you think you updated to, or what the GUI thinks you’re running?

Duplicati v2.1.0.2 might already be installed. You can check in first “works” case.
TrayIcon without the --no-hosted-server should reveal your latest update well.

Windows probably has an opinion too, e.g. (Windows 10 here though) Apps has:

image

Technically 2.1.0.3 is the current recent Beta, but stack trace could be by 2.1.0.2.

EDIT:

By that, I mean

is not something that 2.0.8.1 TrayIcon can say, so you might have mismatched version.

I had installed a long time ago, and converted to service long after.

Based on the feedback here I noticed the path in the service command line

“C:\ProgramData\Duplicati\updates\2.0.6.3\Duplicati.WindowsService.exe” “–server-datafolder=C:\ProgramData\Duplicati\Data”

I was able to uninstall the service and run re-install. I noticed versions in the update folder of 2.0.6.1, 2.0.6.3 and 2.0.7.1.

Now I’m having issues with my sqllite DB and backup jobs not converting. It comes up clean and doesn’t load the overall config nor the specific backup jobs. I’m on the latest version now and the service does run and point to the programdata folder.

“C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe” SERVER “–webservice-interface=loopback” “–log-retention=3M” "–server-datafolder=C:\ProgramData\Duplicati" --unencrypted-database “–log-file=C:\ProgramData\Duplicati\duplicati.log” “–usage-reporter-level=None”

But that’s not where the config used to point. Why change?

Was: "--server-datafolder=C:\ProgramData\Duplicati\Data"
Now: "--server-datafolder=C:\ProgramData\Duplicati\"

I’m not sure how Duplicati treats a backslash double quote.
Command Prompt would take that as a literal double quote.

But main question is – did you leave all your config behind?

I’m glad you caught that because somehow I missed it – thank you much. Service is running on latest version… now lets see about that tray icon again.

Ok, all upgraded now, the Tray icon behaves slightly differently - it will load but freezes on double click (or right-click and open, but works on right-click and quit)

I’ve tried it without the password, then with a password. It doesn’t log when I’ve tried to add that.

This first command doesn’t launch the icon, just gives error
PS C:\Program Files\Duplicati 2> .\Duplicati.GUI.TrayIcon.exe --no-hosted-server --hosturl=“http://localhost:8200” --webservice-password=“”

When running the TrayIcon without a hosted server, you must provide the server password via the option --webservice-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=.

No password provided, unable to connect to server, exiting

This second command runs, but the tray app will freeze on double click (I get a "Window (Not Responding))
PS C:\Program Files\Duplicati 2> .\Duplicati.GUI.TrayIcon.exe --no-hosted-server --hosturl=“http://localhost:8200” --webservice-password=“XXXX”

This third command is same as second. No logs generated at all.
.\Duplicati.GUI.TrayIcon.exe --no-hosted-server --hosturl=“http://localhost:8200” --webservice-password=“XXXX” “–log-file=C:\ProgramData\Duplicati\duplicati-tray.log” “–log-level=debug”

Any further tips further appreciated. It’s actually already been unexpected that I was able to resolve the issue with the service and not have to start from scratch, so thank you both.

and you can follow that back to the forum if you want to help characterize this for investigation.

is the known behavior for regular (without --no-hosted-server TrayIcon. Link to issue is there.

Error seems quite clear. It needs a password. Empty one isn’t enough.

The freeze in second test might be the “appears to hang” (though you did a double-click instead).

Third test (“same as second”) seems to add logging. Maybe developer can comment on the logs.

Have you looked in the event logs in Windows Application log? Sometimes info is available there.

What is the status with the service? You seem to have a password, so direct browse should work.

In some tests, TrayIcon appeared to interact with Duplicati as expected. Is only issue initial open?

No, it doesn’t generate logs at all.

No info related to duplicati in any windows event log. (system or application)

Service is working well, thank you. Just tray icon not working.

I’ll try again. Change it to “seems to add logging options”. Maybe dev can comment on log plan because lack of logs is an impediment to figuring out what went wrong. Could logs catch more?

Meaning on open, or at all? Mine seemed to be able to communicate back and forth with server.

Runs when you open it, then acts as described ( freezes when using open function. )

Anyone have thoughts on actions I should take for further troubleshooting?

Thanks for the detailed probing. I was able to reproduce this with 2.1.0.2 but since I fixed that issue, I have not been able to reproduce.

Based on the descriptions here, I will try some different setups in a fresh environment and hopefully I can reproduce the behavior and fix the problem.

Just wanted to confirm that I don’t get any logging from the trayicon to the windows event log when testing with --windows-eventlog
and still no logging when using --log-file
I’ve tried from command line vs PowerShell and to different log output locations as well as “as admin” just in case.

Current testing is
.\Duplicati.GUI.TrayIcon.exe --no-hosted-server --hosturl=“http://localhost:8200” --webservice-password=“xxx” --windows-eventlog

Thanks!

It would be worth checking Task Manager if there is any chance that there are multiple Duplicati.
Having said that, I started 2.1.0.2 then 2.1.0.3, got a tray icon for each, and pausing one showed pause in both. I took a guess that 2.1.0.3 was the lower icon, so did right-click open. Got a hang. Thinking maybe I got 2.1.0.2 by mistake, I tried the other one. Got a hang. Task Manager shows Image path name column, so I know what was up. I also did manual launch from two zip installs.

Each hang leaves a remnant on the task bar, and a mis-shapen leftover of the system tray menu.

image

image

I did a Right-click Close window on the first taskbar Duplicati, thought to be 2.1.0.3, and 2.1.0,3 vanished from Task Manager. I did have to force it down from popup saying it wasn’t responding.

The fix is not explicitly mentioned in the 2.1.0.3 summary of changes since 2.1.0.2, but I thought I tested it before and it seemed to work. Regardless, now it doesn’t even on a fresh TrayIcon start. Windows service side is still 2.1.0.2 if it matters.