Duplicati Tray Icon When Running as Linux Service

I am running duplicati as a linux service but I want to see the tray icon to better keep track of weather duplicati is running or not and if backups are succeeding or failing. When I try to run duplicati --no-hosted-server --serverurl=http://localhost:8200 I get the following error:

$ duplicati --no-hosted-server --serverurl=http://localhost:8200
Unexpected error: System.NullReferenceException: Object reference not set to an instance of an object
at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequest[T] (System.String method, System.String urlfragment, System.Collections.Generic.Dictionary2[TKey,TValue] queryparams) [0x00147] in <6464f4e1314f4170b4321fea9336fe01>:0 at Duplicati.GUI.TrayIcon.HttpServerConnection.UpdateStatus () [0x00001] in <6464f4e1314f4170b4321fea9336fe01>:0 at Duplicati.GUI.TrayIcon.HttpServerConnection..ctor (System.Uri server, System.String password, System.Boolean saltedpassword, Duplicati.GUI.TrayIcon.Program+PasswordSource passwordSource, System.Boolean disableTrayIconLogin, System.Collections.Generic.Dictionary2[TKey,TValue] options) [0x000cb] in <6464f4e1314f4170b4321fea9336fe01>:0
at Duplicati.GUI.TrayIcon.Program.RealMain (System.String _args) [0x0049f] in <6464f4e1314f4170b4321fea9336fe01>:0

I see someone else with a similar situation here Tray Icon won't load when I run duplicati as a systemd service but I don’t see any resolution. Does anyone have any ideas or suggestions?


This seems to point to a Github issue:

From what I can read in that issue, it seems that the error occurs when the tray icon cannot connect to the server (bad error message if that is the case).

If you have a password set on the server, make sure you supply it with --webserver-password=.... Other than that it seems like a prominent problem experienced by many, so we should look into it.

I just tested this, and can replicate the error message if I try to connect without a password.

After fixing the null error, I get this message:

Request error: System.Net.WebException: The remote server returned an error: (401) Not logged in.

I removed my password from duplicati then ran duplicati --no-hosted-server --serverurl=http://localhost:8200 and my tray icon now works. So it seems like the issue is with the password functionality.

I added the password back and then ran duplicati --no-hosted-server --serverurl=http://localhost:8200 --webserver-password=myp@ssw0rd! and it goes back to crashing.

I thought maybe the tray icon application was tripping up on some of the special characters in my password so I tried putting the password in single and then double quotes - neither works.

For now I am just going to leave password protection disabled. The tray icon is much more important to me than having a password on my backups. I’ll try to add this to the bug ticket for further reference though.

Thanks everyone!

Thanks for reporting. I only tested without sending a password. I will try again with a password from both server and tray.

IIRC it’s a multi-part problem. One is that TrayIcon might be going before separate server is done starting. Another is that reading needed login secret from the server DB might be blocked, e.g. by file permissions. Below is an interesting idea from some years ago, but I don’t know what became of it.

Other notes:

Tray Icon does not start after setting a UI password (Service Mode)
Tray icon bypasses UI password

I have uploaded a new canary build that fixes the problem (in my tests).