Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicati Tray Icon Silently Dies with --no-hosted-server arg #3137

Open
pereze2 opened this issue Apr 1, 2018 · 24 comments

Comments

Projects
None yet
8 participants
@pereze2
Copy link

commented Apr 1, 2018

  • I have searched open and closed issues for duplicates.

Environment info

  • Duplicati version: 2.0.3.2_canary_2018-03-16
  • Operating system: Win10 Pro
  • Backend: none

Description

When attempting to launch the tray icon with the --no-hosted-server argument, the process very briefly appears in the task manager (twice) and then disappears with no message.

Functions normally without the argument. Duplicati is installed as a service.

Steps to reproduce

  1. Fresh install from MSI
  2. Run tray icon with --no-hosted-server arg
  • Actual result:
    Icon does not appear in tray. Monitoring task manager shows two tray icon processes spawn simultaneously and then simultaneously disappear with no other indication of what is occurring.
    Running from command prompt yields the same behavior and no further indications
  • Expected result:
    Tray icon starts and connects to host running as service

Screenshots

Debug log

No crash logs are generated as a result

@pereze2

This comment has been minimized.

Copy link
Author

commented Apr 3, 2018

This issue persists with the latest Canary build as well (2.0.3.4_canary_2018-04-02). I've noticed some "off" behavior on a Mac as well, but I haven't had a chance to document the circumstances as thoroughly.

@trfrde

This comment has been minimized.

Copy link

commented May 1, 2018

I can confirm this bug: Neither on macOS, nor on Win10 does the tray icon show up with the --no-hosted-server argument.

@jpschewe

This comment has been minimized.

Copy link

commented Aug 17, 2018

I found that this happens to me when the service is not currently running. I would argue that the tray icon should keep running even if there is no service to connect to and the icon should state that it can't connect to the service.

I ran into a race condition on a windows system that I'm working with where the tray icon started before the service finished starting up, so the tray icon disappeared.

@DaineP

This comment has been minimized.

Copy link

commented Aug 18, 2018

When attempting to launch the tray icon with the --no-hosted-server argument, the process very briefly appears in the task manager (twice) and then disappears with no message.

Confirmed to also be part of Duplicati - 2.0.3.3_beta_2018-04-02
OS - Windows 10 Home
Service is running
Observing Task Manager Processes, Duplicati can be seen to momentarily appear above Duplicati.Server.exe and then both entries disappear.

@ts678

This comment has been minimized.

Copy link

commented Aug 22, 2018

I'm not seeing this on Windows 10, provided service is up, and I use --no-hosted-server. Without that, there are various conflicts that can arise, for example, due to permission differences between service server (run as SYSTEM) and whatever tray icon runs as. One can also trip over the lock file that protects the server database from multiple servers trying to use it. Where the database lives is configurable in various ways. So setup really matters if one WANTS two servers up. By comparison, tray icon without server seems safer, yet it clearly fails somehow for some. What would help a LOT would be some error messages, so here's a possible workaround:

set AUTOUPDATER_Duplicati_SKIP_UPDATE=1

is enough to turn off the normal two-process behavior where the real work is supposed to be in the child, and parent is there only to check for updates and forward the I/O. That might be broken in tray icon. For awhile, it was broken elsewhere (but that's fixed). Or maybe there's some good reason to background, then keep quiet?

It sounds like the service-down situation is understood, but could any server-up failures obtain the messages using the above workaround? If that fails, tray icon is talkier without Windows, e.g. help text outputs on Linux.

@jpschewe

This comment has been minimized.

Copy link

commented Aug 22, 2018

I'm setting this up for my parents and really want the tray icon to always be running. The fact that it exits when using --no-hosted-server and the service isn't running makes it hard to say this is a reliable way to know that the backups are working or not. Especially since Windows hides many icons, so they need to look for the icon if it's not in an error state.

@ts678

This comment has been minimized.

Copy link

commented Aug 22, 2018

I'm not sure how decisions are made on what to work on (there's more than enough in the queue), but it seems like the forum is much more actively worked, so possibly you could make your case for the change.

Another approach might be to make extra sure that the server always runs, to keep the tray icon running, however if somehow the server goes down, I agree it would be nice if there was some problem indication. Personally, I'm not sure of the exact behavior in terms of color changes, and the limits of what's detected.

My service requires a workaround, Duplicati service stops running & Windows Service fails to start #2717

The slowness of WindowsService before starting Server perhaps also accounts for the race you mentioned. Possibly only a lot more retries are needed to work for a medium-slow start up to 30 second failure point, however I'm not sure if that would make other types of failures too slow. The retry count is possibly here.

The service-down case may or may not be related to service-up. Still awaiting message info about those...

@DaineP

This comment has been minimized.

Copy link

commented Aug 22, 2018

I'm not seeing this on Windows 10, provided service is up, and I use --no-hosted-server.

Are you on Win 10 Home? Just wondering if that's the difference.

I'm using "C:\Program Files\Duplicati 2\Duplicati.GUI.TrayIcon.exe" --no-hosted-server

You made me think that perhaps it was actually a permissions thing as I generally use my Win system as a restricted user but also when I log in as admin or run the shortcut as administrator in the restricted user account, the same thing occurs, two Duplicati entries momentarily appear in Task Mgr and then disappear.

@ts678

This comment has been minimized.

Copy link

commented Aug 22, 2018

Mine is Windows 10 Professional. Running as a "Standard User" (i.e. not in Administrators group) doesn't trigger it for me. I do use DUPLICATI_HOME on this system, though I also did a very clean installation on another Windows system without any special setup, and I couldn't get it happen there either. If yours can reproduce the issue, could you please see if you can find any error messages via workaround that I gave?

@DaineP

This comment has been minimized.

Copy link

commented Aug 23, 2018

@ts678
I presume when you say the workaround, you mean:

set AUTOUPDATER_Duplicati_SKIP_UPDATE=1

If so, I have to ask the proverbial dumb question - Where does that statement go and do you mean errors in the Duplicati logs? Certainly till now, no red warnings were shown when logging into 127.0.0.1:8200.

Sadly, as it ends up I have decided running Duplicati as a service is not going to work for me.
The primary reason for going that way was for Windows Volume Shadow Copy Service but Veracrypt folder volumes do not support VSS and that storage is key. It also ends up that getting Duplicati to see network shares mounted by the user is an issue when its running as a service. Combined with the loss of the tray icon there is little reason to go that way. I will however try the workaround on another system when I understand it :-(

That said, interestingly, when installing Duplicati on that other system as a service (also Win 10 Home), the system tray worked, once. However, after a reboot that system exhibits the same behavior discussed above.

@ts678

This comment has been minimized.

Copy link

commented Aug 23, 2018

The "set" is typed into whatever cmd.exe (Command Prompt) you used to start TrayIcon. If you did it in PowerShell it might use a different syntax. It's just setting an environment variable for TrayIcon to read.

Under the workaround what I hope will happen is that your window will get messages, not just silence. Tray Icon will presumably still die, but if it gives an explanation then that will give something to look at.

@DaineP

This comment has been minimized.

Copy link

commented Aug 28, 2018

Well, it does not mean much to me but the below is from Windows cmd.exe:

C:\>cd "C:\Program Files\Duplicati 2\

C:\Program Files\Duplicati 2>set AUTOUPDATER_Duplicati_SKIP_UPDATE=1

C:\Program Files\Duplicati 2>Duplicati.GUI.TrayIcon.exe --no-hosted-server

C:\Program Files\Duplicati 2>Unexpected error: System.NullReferenceException: Object reference not set to an instance of an object. at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequest[T](String method, String urlfragment, Dictionary2 queryparams)
at Duplicati.GUI.TrayIcon.HttpServerConnection.UpdateStatus()
at Duplicati.GUI.TrayIcon.HttpServerConnection..ctor(Uri server, String password, Boolean saltedpassword, PasswordSource passwordSource, Dictionary2 options) at Duplicati.GUI.TrayIcon.Program.RealMain(String[] _args)

Possibly interesting to also note is that when running Duplicati.GUI.TrayIcon.exe --no-hosted-server from the command line, Windows Task Manager does not show any activity but when running the same from a desktop shortcut, Task manager does indicate Duplicati momentarily starting.

@ts678

This comment has been minimized.

Copy link

commented Aug 28, 2018

Tray Icon won’t load when I run duplicati as a systemd service was another report of that, also mysterious.

@SamSirry

This comment has been minimized.

Copy link

commented Sep 19, 2018

I just want to add a little tip that might be of help: I am running Duplicati as a Windows Service, and the tray icon was working fine until I assigned a UI Password to Duplicati, then the tray icon no longer loads.

If run from a shortcut with the --no-hosted-server argument, it appears briefly in the task manager then disappears. However, if run from a command prompt, it generates a crash (like this).

@ts678

This comment has been minimized.

Copy link

commented Sep 28, 2018

Tray Icon does not start after setting a UI password (Service Mode) did some analysis of the failure but the solutions aren't pretty. I think I heard a better one proposed awhile ago but can't find that post right now.

@Taomyn

This comment has been minimized.

Copy link

commented Jan 10, 2019

I've been noticing this of late but only when I'm rebooting my server frequently - I have the Duplicati service set as "Automatic (Delayed Start)" which I recommend to other admins to prevent less important services being part of the main server start-up and slowing it down. So if I reboot and then almost immediately log in, the tray icon never appears. If I step away for 10minutes after a reboot and then log in, the tray icon is there and functioning.

I have other services that also have their own tray icons, but they normally sit their greyed out or showing some other indicator, until their service starts up - why can't Duplicati do the same?

@adlibdalom

This comment has been minimized.

Copy link

commented Feb 23, 2019

Hey!
I'm having this exact problem, but is there a work-around that actually works?
I'm getting the two processes that more or less instantly dies with the Duplicati.GUI.TrayIcon.exe --no-hosted-server flag.
Actually, I'm getting the same behavior with just --hosturl too.

@ts678

This comment has been minimized.

Copy link

commented Feb 24, 2019

I'm having this exact problem, but is there a work-around that actually works?

Which exact problem? There are various ones. Sometimes the server is down, sometimes it's just not up before TrayIcon tries to get to it (and TrayIcon doesn't wait long enough). There are others here as well.

If you're using --hosturl that almost sounds like manual start. Regardless, I'd recommend manual start with something like "set AUTOUPDATER_Duplicati_SKIP_UPDATE=1" at Command Prompt beforehand. Another workaround for the lack of error outputs might be to append "| findstr ." to TrayIcon start line. These are just debugging methods. The problem needs to be known before solutions can be proposed.

@adlibdalom

This comment has been minimized.

Copy link

commented Feb 24, 2019

Sorry for being vague; as the topic is titled "... Silently Dies with --no-hosted-server arg" I was referring to that.
The piping to findstr was a good start because that leads to actual output (something that was entirely missing before).
What I'm getting now though is this:

Unexpected error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Duplicati.GUI.TrayIcon.HttpServerConnection.PerformRequest[T](String method, String urlfragment, Dictionary`2 queryparams)
   at Duplicati.GUI.TrayIcon.HttpServerConnection.UpdateStatus()
   at Duplicati.GUI.TrayIcon.HttpServerConnection..ctor(Uri server, String password, Boolean saltedpassword, PasswordSource passwordSource, Boolean disableTrayIconLogin, Dictionary`2 options)
   at Duplicati.GUI.TrayIcon.Program.RealMain(String[] _args)

The additional arg I'm passing (apart from --no-hosted-server) is simply --hosturl=http://url.that.resolves.to.duplicati.server.ip:8200. I've got a webservice password set, if that makes any difference.
Perhaps this isn't quite as directly related to this issue as I first thought, should I start another thread for my issue?
Thanks again!

@ts678

This comment has been minimized.

Copy link

commented Feb 25, 2019

I've got a webservice password set, if that makes any difference.

If you feel comfortable with having it off for a test, that might be worth trying. The stack trace looks like the earlier issue in this thread here. You can also look at the link I later referenced. Because you're connecting to an external Duplicati server (meaning not hosted by TrayIcon) with a password, TrayIcon needs to go dig its credentials out of the Duplicati-server.sqlite database by direct file access, which it sometimes can't do if, for example, TrayIcon is running as the user and Duplicati.Server.exe is running as SYSTEM. Changing Windows security permissions can add access, but has the downside of reduced security against the user (if you care).

The above theory obviously fits better with Windows. Is that what you're running? With a Duplicati service?

@adlibdalom

This comment has been minimized.

Copy link

commented Feb 26, 2019

Sorry for the delayed response.
I'm running Duplicati in a FreeBSD jail on a FreeNAS 11.2 installation. I'd like my Win 10 client's tray app to attach to the jail's Duplicati server, if possible.
I haven't had time to try password-less yet, I'll see if it makes any difference soon™.

@ts678

This comment has been minimized.

Copy link

commented Feb 28, 2019

I haven't had time to try password-less yet, I'll see if it makes any difference soon™.

If password-less helps, then in your situation where Duplicati Server is remote, TrayIcon might need this:

Run Duplicati 2 GUI on a headless box?

The GUI can connect (e.g. from your laptop) if you supply
--no-hosted-server --hosturl=http://ip:port
--webserver-password=same_password

This looks like the alternative when one can't fetch the password from server database, e.g. when remote.

@adlibdalom

This comment has been minimized.

Copy link

commented Mar 7, 2019

Hi again!
So, I removed the web service password from the server install and managed to get the tray icon connected to the service, but the icon is extremely non-verbose, meaning I'm not getting much info out of the icon.
I would have appreciated if it reported a list of defined backup jobs, their last status, an ability to reach the logs from the job's last run and possibly the ability to run a job instantly.
I guess it'll have to be feature requests.

@DaineP

This comment has been minimized.

Copy link

commented May 21, 2019

For what its worth, I have just gone through the process of a completely clean Win 10 Home install on the same computer where I was having the above noted issue that, although the Duplicati service was definitely running,

when attempting to launch the tray icon with --no-hosted-server argument, the process very briefly appears in the task manager (twice) and then disappears with no message.

I have installed almost all the same applications on this system that were previously installed and just completed the Duplicati install. However this time I installed with "start at login" disabled as I knew I wanted to run as a service. I ran the command line to install the service and ran "Duplicati.GUI.TrayIcon.exe" --no-hosted-server
And, DaDa... The tray icon loads.

I have not "yet" set a password for accessing the UI but I'm not sure I want to. Its working so why try and break it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.