Error fireware on centos 7
Question: I'm using the code below to open port 80 on my sever:

    
    
    sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
    

but I get this error:

    
    
    Traceback (most recent call last):
      File "/bin/firewall-cmd", line 24, in <module>
        from gi.repository import GObject
      File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 37, in <module>
        from . import _gi ImportError: /lib64/libgirepository-1.0.so.1:
    undefined symbol: g_type_class_adjust_private_offset
    

Please help me fix it. Thanks!


Answer: I had the same problem on some Centos 7, OpenVZ VMs which came without
firewalld installed. Simply installing the firewalld RPM package didn't work
because on startup, firewalld would say:

    
    
    # /usr/sbin/firewalld --nofork --nopid
    Traceback (most recent call last):
      File "/usr/sbin/firewalld", line 132, in <module>
        from firewall.server import server
      File "/usr/lib/python2.7/site-packages/firewall/server/server.py", line 32, in <module>
        from gi.repository import GObject, GLib
      File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 37, in <module>
        from . import _gi
    ImportError: /lib64/libgirepository-1.0.so.1: undefined symbol: g_type_class_adjust_private_offset
    

After a great deal of faffing about, I've found that (as of June 2016) a
simple 'yum update' is enough to make it all work. I'm none the wiser which
packages are actually the culprit, but getting everything up to date is
probably a good thing.

