Bug 886551

Summary: firewalld GUI running in non X environment
Product: [Fedora] Fedora Reporter: Petr Sklenar <psklenar>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jpopelka, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-18 20:37:28 UTC 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 Petr Sklenar 2012-12-12 14:27:52 UTC
Description of problem:
try all GUI related to firewalld in nonX environment

Version-Release number of selected component (if applicable):
firewalld-0.2.11-1.fc18.noarch

How reproducible:
deterministic

Steps to Reproduce:
1, firewall-config, firewall-offline-cmd , firewall-applet
[root@qa-psklenar ~]# firewall-config 
No protocol specified

** (firewall-config:2868): WARNING **: Could not open X display
Traceback (most recent call last):
  File "/usr/bin/firewall-config", line 23, in <module>
    from gi.repository import Gtk, GObject
  File "/usr/lib64/python2.7/site-packages/gi/importer.py", line 76, in load_module
    dynamic_module._load()
  File "/usr/lib64/python2.7/site-packages/gi/module.py", line 244, in _load
    overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 1624, in <module>
    raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialized

[root@qa-psklenar ~]# firewall-offline-cmd 
Traceback (most recent call last):
  File "/usr/bin/firewall-offline-cmd", line 382, in <module>
    if conf.enabled == False:
AttributeError: 'NoneType' object has no attribute 'enabled'


[root@qa-psklenar ~]# firewall-applet 
No protocol specified

** (firewall-applet:2888): WARNING **: Could not open X display
Traceback (most recent call last):
  File "/usr/bin/firewall-applet", line 23, in <module>
    from gi.repository import Gtk, GLib, GObject, Gio, Notify, NetworkManager
  File "/usr/lib64/python2.7/site-packages/gi/importer.py", line 76, in load_module
    dynamic_module._load()
  File "/usr/lib64/python2.7/site-packages/gi/module.py", line 244, in _load
    overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
  File "/usr/lib64/python2.7/site-packages/gi/overrides/Gtk.py", line 1624, in <module>
    raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialized


  
Actual results:
traceback

Expected results:
could not open display
This is a graphical application and requires DISPLAY to be set.

Additional info:
some another GUI
[root@qa-psklenar ~]# system-config-printer
system-config-printer: could not open display
This is a graphical application and requires DISPLAY to be set.

Comment 1 Jiri Popelka 2012-12-12 16:45:03 UTC
from bug #886529, comment #2:
> I could see the same issue when running without X environment:
> firewall-cmd --reload
> Error: org.fedoraproject.slip.dbus.service.PolKit.NotAuthorizedException.org.fedoraproject.FirewallD1.config:

Comment 2 Jiri Popelka 2012-12-12 16:45:52 UTC
[16:50] <psklenar> akostadinov:  twoerner about bug 886529, is there some way how could I authenticate to dbus from non X environment?
[16:51] <psklenar> otherwise then the right error message for bug 886529 would be smth like: please open your X session, authenticate to polkit then try again :)
[16:53] <twoerner> psklenar: no, there is no text polkit agent
[16:53] <twoerner> psklenar: the result from polkit is the same if the password was wrong or if there was no agent


So what about adding to firewall-cmd something like 
if (not X and user != root) then
 print "open your X session or run firewall-cmd as superuser"

Comment 3 Petr Sklenar 2012-12-13 08:32:24 UTC
(In reply to comment #2)
> So what about adding to firewall-cmd something like 
> if (not X and user != root) then
>  print "open your X session or run firewall-cmd as superuser"

+1
personally I would like to see such an error message.

Comment 4 Jiri Popelka 2012-12-13 16:40:27 UTC
firewall-config, firewall-applet and firewall-cmd (comment #1) fixed upstream:
http://git.fedorahosted.org/cgit/firewalld.git/commit/?id=0cf1dcb9db2f99482e8a44e4e6f0ded7cc1f4a9b

(In reply to comment #0)
> [root@qa-psklenar ~]# firewall-offline-cmd 
> Traceback (most recent call last):
>   File "/usr/bin/firewall-offline-cmd", line 382, in <module>
>     if conf.enabled == False:
> AttributeError: 'NoneType' object has no attribute 'enabled'

This was completely different problem, fixed upstream:
http://git.fedorahosted.org/cgit/firewalld.git/commit/?id=15f29f20343bcb06df8141670f58f59ebede32d5

Comment 5 Fedora Update System 2013-01-14 16:18:09 UTC
firewalld-0.2.12-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/firewalld-0.2.12-1.fc18

Comment 6 Fedora Update System 2013-01-15 02:27:41 UTC
Package firewalld-0.2.12-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing firewalld-0.2.12-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-0810/firewalld-0.2.12-1.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-01-18 20:37:30 UTC
firewalld-0.2.12-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.