Bug 2222286

Summary: tuna without a subcommand on a machine without a display doesn't exit gracefully
Product: Red Hat Enterprise Linux 9 Reporter: John Kacur <jkacur>
Component: tunaAssignee: John Kacur <jkacur>
Status: NEW --- QA Contact: Qiao Zhao <qzhao>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.4CC: bhu, mstowell, qzhao, rt-maint
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Kacur 2023-07-12 14:37:26 UTC
If you run tuna without a subcommand it tries to run a gui.
If you are installed on a server without a display you get some kind of an error message. It would be better to detect the situation and exit gracefully with some kind of an explanation or usage message.
You get the same result when you issue the gui subcommand

Comment 1 John Kacur 2023-07-12 14:41:12 UTC
 su -c "tuna gui"
Password:(tuna:7645): Gtk-CRITICAL **: 11:31:55.573: _gtk_css_lookup_resolve: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((provider)); GType __t = ((_gtk_style_provider_private_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed
/usr/lib/python3.9/site-packages/tuna/tuna_gui.py:40: Warning: g_object_set_data_full: assertion 'G_IS_OBJECT (object)' failed
  self.wtree.add_objects_from_file(tuna_glade, ("mainbig_window", "tuna"))(tuna:7645): Gtk-ERROR **: 11:31:55.573: Can't create a GtkStyleContext without a display connection
Trace/breakpoint trap (core dumped)
[acme@nine linux]$