Bug 1259747

Summary: PyGIWarning: GnomeKeyring was imported without specifying a version first.
Product: [Fedora] Fedora Reporter: Karel Volný <kvolny>
Component: python-keyringAssignee: Ratnadeep Debnath <rtnpro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: amedeo.salvati, apevec, apevec, charles.butterfield, christer.j.eriksson, dahorak, dondavis, ecerqueira, fritz, i, ikke, jan.public, jdennis, jholmes, jose.castro.leon, jruzicka, juan, kevin, lars, mark, ncross, p, praiskup, rbean, rtnpro, vashirov, whayutin
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-keyring-5.0-5.fc24 python-keyring-5.0-5.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-10 17:49:23 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
patch as described in comment #2
none
Diff of the spec file for including the patch none

Description Karel Volný 2015-09-03 09:22:25 EDT
Description of problem:
Trying to use some tools, I'm getting an error from novaclient.

Version-Release number of selected component (if applicable):
python-novaclient-2.23.0-2.fc23.noarch

How reproducible:
always

Steps to Reproduce:
1. (setup variables)
2. nova list

Actual results:
/usr/lib/python2.7/site-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import GnomeKeyring
...

Expected results:
(no such error)

Additional info:
Comment 1 Lars Kellogg-Stedman 2015-09-28 09:37:34 EDT
This means that every single OpenStack client invocation starts with this particular error message.

$ openstack catalog list > /dev/null
/usr/lib/python2.7/site-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import GnomeKeyring

$ glance image-list > /dev/null
/usr/lib/python2.7/site-packages/keyring/backends/Gnome.py:6: PyGIWarning: GnomeKeyring was imported without specifying a version first. Use gi.require_version('GnomeKeyring', '1.0') before import to ensure that the right version gets loaded.
  from gi.repository import GnomeKeyring

Besides being annoying I know that in the past this sort of unexpected output has confused some of the openstack puppet modules.
Comment 2 Lars Kellogg-Stedman 2015-09-28 10:31:16 EDT
You can "fix" (?) this problem by modifying the top of /usr/lib/python2.7/site-packages/keyring/backends/Gnome.py, replacing this:

    try:
        from gi import Repository
        if Repository.get_default().enumerate_versions('GnomeKeyring'):
            from gi.repository import GnomeKeyring
    except ImportError:
        pass

With this:

    try:
        from gi import Repository, require_version
        if Repository.get_default().enumerate_versions('GnomeKeyring'):
            require_version('GnomeKeyring', '1.0')
            from gi.repository import GnomeKeyring
    except ImportError:
        pass
Comment 3 Justin Holmes 2015-11-06 21:28:10 EST
Can confirm that this "fix" works for me on fedora 23 as well. Any chance of getting this packaged into a bug fix?
Comment 4 Ilkka Tengvall 2015-11-12 02:48:22 EST
"me too", works in fedora 23.
Comment 5 Donny Davis 2015-11-16 17:30:57 EST
+1 works here too
Comment 6 Juan Jimenez 2015-11-26 13:14:01 EST
Another +1
Comment 7 Christer 2015-12-03 10:49:36 EST
Another +1 for fixing this Fedora 23
Comment 8 wes hayutin 2016-01-08 10:28:45 EST
+1 for a f23 fix
Comment 9 John Dennis 2016-01-08 17:20:34 EST
Why isn't this fixed?

It was first reported 4 months ago, the fix is trivial and well known. It's very annoying. Please get a fix pushed out into stable ASAP. Don't forget about rawhide either.


Note: same bug has been filed in a few other places:

http://permalink.gmane.org/gmane.linux.debian.devel.python.modules/25136
https://bugs.launchpad.net/python-keystoneclient/+bug/1517907
Comment 10 Lars Kellogg-Stedman 2016-01-08 17:43:45 EST
Please try to keep the contents of bug reports polite.  Fedora is a volunteer project, and folks are kind enough to donate their time to help maintain packages.

In this case, one reason it hasn't been fixed is that it was initially filed against the wrong component, so the package maintainer wasn't even aware of it until earlier today when moved it to python-keyring.
Comment 11 John Dennis 2016-01-08 17:50:34 EST
My apologies for not seeing it was only assigned today.
Comment 12 Eduardo 2016-01-13 11:47:02 EST
just would like to share that the fix reported by  Lars Kellogg-Stedman at 2015-09-28 10:31:16 EDT also worked in my F23 with latest codes (updated at Jan 13 2016)
Comment 13 Alan Pevec 2016-01-14 16:43:25 EST
*** Bug 1271641 has been marked as a duplicate of this bug. ***
Comment 14 Alan Pevec 2016-01-14 16:45:00 EST

*** This bug has been marked as a duplicate of bug 1195985 ***
Comment 15 Ralph Bean 2016-03-14 13:26:50 EDT
Alan, can you give us some explanation about how this bug is a duplicate of #1195985?

We got some feedback today that this bug is causing some performance issues in ansible:  http://willthames.github.io/2016/03/12/ansible-slow-startup-on-fedora-23.html
Comment 16 Jan Vlug 2016-05-02 05:25:01 EDT
I would also like to see a confirmation that this is a duplicate of bug 1271641, because the "fix" of comment 2 indeed works.

Couldn't this issue be fixed separately from bug 1271641?

Please package it in a bug fix for Fedora 23.
Comment 17 Jan Vlug 2016-06-22 10:30:55 EDT
Please re-open this bug as I still get this error when using hg in Fedora 24.
Comment 18 Kevin Fenzi 2016-06-22 11:56:29 EDT
Reopening. Maintainers: Can we take another look here please...
Comment 19 Charles Butterfield 2016-09-04 14:30:06 EDT
Many thanks to  Lars Kellogg-Stedman, his fix saved my bacon too.  Not sure why there is so much resistance to fixing this.  Perhaps the maintainers are using some other version and don't see these problem every time they execute a command, but for the rest of us its a royal pain.
Comment 20 Nick Cross 2016-09-10 12:54:40 EDT
I am seeing this error message in .xsession-errors on F24 as well
Comment 21 Fritz Elfert 2016-09-30 17:02:48 EDT
Still in F24. (tested using python-novaclient-3.3.1-1.fc24.noarch. Shows the same behavior)

Fix as suggested in comment #2 still applies nicely.
So: what's the holdup?
Come on guys, PLEASE fix this already. (Or at least respond with a reason *why* you don't fix this).
Comment 22 Fritz Elfert 2016-09-30 17:28 EDT
Created attachment 1206372 [details]
patch as described in comment #2
Comment 23 Fritz Elfert 2016-09-30 17:31 EDT
Created attachment 1206373 [details]
Diff of the spec file for including the patch

Hopefully, providing the patch and the diff for the spec file speed up fixing this!
Comment 24 Kevin Fenzi 2016-10-02 17:08:07 EDT
So, I looked into this a bit... seems that rawhide and f25 got an update to this package to version 9.0. 

This bug was actually fixed upstream in version 5.5, but f23 and f24 have 5.0. 

I'm not the maintainer here, but I'm going to push the fix anyhow. :) 

If folks could please test and karma the updates that would be great.
Comment 25 Fedora Update System 2016-10-03 03:19:43 EDT
python-keyring-5.0-5.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0e264302f4
Comment 26 Fedora Update System 2016-10-03 03:22:27 EDT
python-keyring-5.0-5.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-68185dfc26
Comment 27 Fedora Update System 2016-10-10 17:49:23 EDT
python-keyring-5.0-5.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 28 Fedora Update System 2016-10-10 21:17:51 EDT
python-keyring-5.0-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.