ControlSystemStudio / phoebus

A framework and set of tools to monitor and operate large scale control systems, such as the ones in the accelerator community.
http://phoebus.org/
Eclipse Public License 1.0
92 stars 89 forks source link

No user message if settings are not found #3099

Open georgweiss opened 3 months ago

georgweiss commented 3 months ago

With the recent changes to properties/settings handling, user might end up in a situation where startup of Phoebus fails without any useful error message. For instance:

In this case user must be aware of the requirement to create a file (even if empty) /user/home/my-settings.ini.

It would be nice to be able to show an error dialog when Phoebus launches. However, as the startup is structured currently, this would have to be a Swing or AWT dialog, but maybe that is OK?

kasemir commented 3 months ago

A swing dialog from the phoebus launcher for -settings /bad/path/missing_file.ini would be OK. But that's where I'd stop, and not try to add more intelligence to this.

You can already provide a launcher for your site. In there, you decide which mandatory and optional settings you want to support. If you want to support $HOME/my-settings.ini, you need to handle that in your launcher. Somewhat like this if they should be optional:

#!/bin/bash

OPT=""
if [ -r "$HOME/my-settings.ini" ]
then
  OPT+="-settings $HOME/my-settings.ini"
fi
...
java -jar ... $OPT "$@"

.. or like this if it should be required:

...
else
 xmessage "Cannot find  $HOME/my-settings.ini"
 exit 1
fi

Trying to handle all this in the phoebus launcher would mean that we need -optional_settings /path/to/something.ini in addition to -settings, then maybe options to decide how an error should be displayed, all of which is site specific and can already be handled in the script that starts phoebus.

georgweiss commented 3 months ago

The point is to avoid console and start script, and xmessage would be Linux specific (?). My Mac and Windows users just install Phoebus from IT management systems, and then (rightly) expect it to launch. So I need a way to tell them that they did not read the instructions of putting a settings file where it is supposed to be.

Of course no more logic is needed/wanted, just a message and then exit.

shroffk commented 3 months ago

A swing dialog from the phoebus launcher for -settings /bad/path/missing_file.ini would be OK. But that's where I'd stop, and not try to add more intelligence to this.

+1

I think a swing dialog would fix your use case right... we could also create a crash log ~/.phoebus/logs/why_phoebus_did_not run and the dialog can point to it

I have encountered a variety of problems of this nature where people try to install our Phoebus on their own. It would be a lot of work to figure out all of them ( missing file, file present but permissions are wrong, etc... add remote file systems and other infrastructure specific things can result in a lot of unique issues )

georgweiss commented 3 months ago

OK, thanks for the feed-back.

I will implement this based on this discussion.