RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1232508 - AttributeError: When using gi.repository you must not import static modules like "gobject"
Summary: AttributeError: When using gi.repository you must not import static modules l...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.2
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-16 23:35 UTC by Brian Lane
Modified: 2015-11-19 11:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 11:48:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2122 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2015-11-19 10:31:14 UTC

Description Brian Lane 2015-06-16 23:35:57 UTC
Description of problem:
Import fails due to incorrect use of GObject


Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 227, in run
    threading.Thread.run(self, *args, **kwargs)
Please make your choice from above:   File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/tui/spokes/source.py", line 81, in _initialize
    threadMgr.wait(THREAD_PAYLOAD)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 112, in wait
    self.raise_if_error(name)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 227, in run
    threading.Thread.run(self, *args, **kwargs)
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/packaging/__init__.py", line 1256, in _runThread
    payload.updateBaseRepo(fallback=fallback, checkmount=checkmount)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/packaging/yumpayload.py", line 141, in inner_method
    ret = method(yum_payload, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/packaging/yumpayload.py", line 524, in updateBaseRepo
    self.reset(root=root, releasever=releasever)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/packaging/yumpayload.py", line 195, in reset
    self._resetYum(root=root, releasever=releasever)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/packaging/yumpayload.py", line 220, in _resetYum
    for repo in self._yum.repos.listEnabled():
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1075, in <lambda>
    repos = property(fget=lambda self: self._getRepos(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 692, in _getRepos
    self.conf # touch the config class first
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1083, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 401, in _getConfig
    self.plugins.run('postconfig')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/subscription-manager.py", line 131, in postconfig_hook
    from subscription_manager.injectioninit import init_dep_injection
  File "/usr/share/rhsm/subscription_manager/injectioninit.py", line 22, in <module>
    from subscription_manager.cert_sorter import CertSorter
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 27, in <module>
    from subscription_manager import file_monitor
  File "/usr/share/rhsm/subscription_manager/file_monitor.py", line 58, in <module>
    class Monitor(gobject.GObject):
  File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 62, in __getattr__
    raise AttributeError(_static_binding_error)
AttributeError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183


I hit this while running anaconda --dirinstall --text from a RHEL 7.2 minimal install.

Comment 2 Adrian Likins 2015-06-17 15:12:16 UTC
the yum 'subscription-manager' plugin uses code from subscription-manager, that currently uses the gtk2/pygtk bindings, which conflict with use of gtk3/pygobject/gi used in anaconda.

Simplest workaround is to disable the 'subscription-manager' yum plugin for that case. It's not really meant to be from anaconda (anaconda from an installer image doesn't include it).


There is a subman branch under review now that ports it to gtk3/pygobject/gi, which should also resolve the error.

Comment 3 Brian Lane 2015-06-17 15:56:40 UTC
Disabling subscription manager works fine for me, but customers will hit this when they use anaconda --dirinstall, anaconda --image or livemedia-creator in no-virt mode (which runs anaconda directly) so a fix is a good idea.

Comment 4 Adrian Likins 2015-07-08 21:36:35 UTC
master branch of subscription-manager now supports gobject/gtk2 and 3. The default for RHEL5->RHEL7.1 will be gtk/gobject 2, while RHEL will default to gtk3 for 7.2 and later.

Also, the gobject based file_monitor.py module that was causing the issues here is no longer gobject based. So currently, the yum plugins mostly avoid use of gobject modules (though the dbus default mainloop can be invoked, but that seems to be okay).

(change was over a range of commits, but 3c43eb843cf035246e3f2281c6bdcd9c2044877d is the main merge into master, and 1.15.3-1 the first build with the change)

Comment 5 Brian Lane 2015-07-09 20:22:53 UTC
Thanks for the update.

Comment 6 John Sefler 2015-07-16 12:26:32 UTC
Brian,
Since I am not an anaconda expert, please retest your anaconda scenario with the latest nightly subscription-manager (should be 1.15.3-1 or newer) and verify Adrian's fix.

Comment 8 Brian Lane 2015-07-18 00:05:51 UTC
Tried 1.15.6-1 and it works fine for me, thanks!

Comment 10 errata-xmlrpc 2015-11-19 11:48:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2122.html


Note You need to log in before you can comment on or make changes to this bug.