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 1185958 - Error looking up OSTree origin file.
Summary: Error looking up OSTree origin file.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: J.C. Molet
URL:
Whiteboard:
: 1170324 1257787 (view as bug list)
Depends On:
Blocks: rhsm-rhel72
TreeView+ depends on / blocked
 
Reported: 2015-01-26 17:03 UTC by John Sefler
Modified: 2015-11-19 11:48 UTC (History)
6 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1257787 1 None None None 2021-01-20 06:05:38 UTC
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

Internal Links: 1257787

Description John Sefler 2015-01-26 17:03:20 UTC
Description of problem:
When package 'subscription-manager-plugin-ostree' is installed while package 'ostree' is NOT installed, Tracebacks are thrown and logged to rhsm.log during calls to subscription-manager attach and unregister modules.

In my opinion this is not a serious bug and may be working as designed.  There are no adverse side affects from the Traceback and this is probably a rare situation since subscription-manager-plugin-ostree is only an optional package and should only be installed on an Atomic system where package ostree will also be installed.


Version-Release number of selected component (if applicable):
[root@jsefler-os7 ~]# rpm -q subscription-manager-plugin-ostree ostree
subscription-manager-plugin-ostree-1.13.17-1.el7.x86_64
package ostree is not installed


How reproducible:


Steps to Reproduce:
1. Starting with a non-Atomic distribution of RHEL...
2. Install package subscription-manager-plugin-ostree
3. Register and then unregister.
4. While unregistering, tail the end of rhsm.log and you will find the following traceback...

[root@jsefler-os7 ~]# tail -f /var/log/rhsm/rhsm.log

2015-01-26 11:47:18,384 [DEBUG] subscription-manager @plugins.py:769 - Running update_content_hook in ostree_content.OstreeContentPlugin
2015-01-26 11:47:18,384 [DEBUG] subscription-manager @base_action_client.py:85 - running lib: <subscription_manager.content_action_client.ContentPluginActionInvoker object at 0x2c28390>
2015-01-26 11:47:18,385 [INFO] subscription-manager @ostree_content.py:34 - ostree update_content_hook plugin.
2015-01-26 11:47:18,387 [DEBUG] subscription-manager @__init__.py:85 - Searching for content of type: ostree
2015-01-26 11:47:18,804 [ERROR] subscription-manager @model.py:342 - Error looking up OSTree origin file.
2015-01-26 11:47:18,805 [ERROR] subscription-manager @model.py:343 - ERROR:root:Could not find any typelib for OSTree
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/gi_wrapper.py", line 25, in <module>
    from gi.repository import OSTree
ImportError: cannot import name OSTree

2015-01-26 11:47:18,805 [ERROR] subscription-manager @plugins.py:489 - Command '['python', '/usr/share/rhsm/subscription_manager/plugin/ostree/gi_wrapper.py', '--deployed-origin']' returned non-zero exit status 1
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/plugins.py", line 487, in run
    self.func(self.conduit)
  File "/usr/share/rhsm-plugins/ostree_content.py", line 36, in update_content_hook
    report = action_invoker.OstreeContentUpdateActionCommand(ent_source=conduit.ent_source).perform()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/action_invoker.py", line 67, in perform
    return self.update_repo_config()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/action_invoker.py", line 93, in update_repo_config
    self.update_origin_file(ostree_repo_config)
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/action_invoker.py", line 120, in update_origin_file
    updater.run()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/model.py", line 384, in run
    self.originfile = self._get_deployed_origin()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/model.py", line 344, in _get_deployed_origin
    raise e
CalledProcessError: Command '['python', '/usr/share/rhsm/subscription_manager/plugin/ostree/gi_wrapper.py', '--deployed-origin']' returned non-zero exit status 1
2015-01-26 11:47:18,808 [WARNING] subscription-manager @base_action_client.py:72 - Exception caught while running <subscription_manager.content_action_client.ContentPluginActionInvoker object at 0x2c28390> update
2015-01-26 11:47:18,808 [ERROR] subscription-manager @base_action_client.py:73 - Command '['python', '/usr/share/rhsm/subscription_manager/plugin/ostree/gi_wrapper.py', '--deployed-origin']' returned non-zero exit status 1
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/base_action_client.py", line 63, in _run_update
    update_report = lib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 31, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 17, in run
    return action()
  File "/usr/share/rhsm/subscription_manager/content_action_client.py", line 81, in _do_update
    return action.perform()
  File "/usr/share/rhsm/subscription_manager/content_action_client.py", line 59, in perform
    self.runner.run()
  File "/usr/share/rhsm/subscription_manager/plugins.py", line 487, in run
    self.func(self.conduit)
  File "/usr/share/rhsm-plugins/ostree_content.py", line 36, in update_content_hook
    report = action_invoker.OstreeContentUpdateActionCommand(ent_source=conduit.ent_source).perform()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/action_invoker.py", line 67, in perform
    return self.update_repo_config()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/action_invoker.py", line 93, in update_repo_config
    self.update_origin_file(ostree_repo_config)
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/action_invoker.py", line 120, in update_origin_file
    updater.run()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/model.py", line 384, in run
    self.originfile = self._get_deployed_origin()
  File "/usr/share/rhsm/subscription_manager/plugin/ostree/model.py", line 344, in _get_deployed_origin
    raise e
CalledProcessError: Command '['python', '/usr/share/rhsm/subscription_manager/plugin/ostree/gi_wrapper.py', '--deployed-origin']' returned non-zero exit status 1

Comment 2 Adrian Likins 2015-07-29 17:45:23 UTC
I'll add a dep on ostree plugin to require ostree.

I'm going to open another bug about ostree plugin, because the gi_wrapper.py tool used for gtk2 based subman isn't needed anymore with gtk3 based subscription-manager.

We also catch, log, and reraise the CalledProcessError there, but there isn't really anything that expects that. I think the plugins.py run() should be updated to log and swallow exceptions from plugins, and prevent them from bubbling up to
subman (or yum, or initial-setup, etc).

Comment 3 Adrian Likins 2015-07-29 17:49:05 UTC
https://github.com/candlepin/subscription-manager/pull/1234

spec file change pr

Comment 4 Adrian Likins 2015-07-29 17:54:28 UTC
(In reply to Adrian Likins from comment #2)

> I'm going to open another bug about ostree plugin, because the gi_wrapper.py
> tool used for gtk2 based subman isn't needed anymore with gtk3 based
> subscription-manager.
> 
https://bugzilla.redhat.com/show_bug.cgi?id=1248153

Comment 5 Adrian Likins 2015-07-29 18:00:41 UTC
(In reply to Adrian Likins from comment #2)

> We also catch, log, and reraise the CalledProcessError there, but there
> isn't really anything that expects that. I think the plugins.py run() should
> be updated to log and swallow exceptions from plugins, and prevent them from
> bubbling up to
> subman (or yum, or initial-setup, etc).

https://bugzilla.redhat.com/show_bug.cgi?id=1248154

Comment 6 Chris "Ceiu" Rog 2015-08-12 17:00:11 UTC
commit 13004a0ebf2fd58e2484f7193b53fd0d106d5f96
Author: Adrian Likins <alikins>
Date:   Wed Jul 29 13:47:37 2015 -0400

    1185958: Make ostree plugin depend on ostree.

Comment 7 Adrian Likins 2015-08-14 15:09:24 UTC
Couple of notes:

* There is no ostree on plain rhel-7.2, so adding the dep as in 13004a0ebf2fd58e2484f7193b53fd0d106d5f96 creates an unsolvable deps
(for both the upgrade from 7.1, and for the full repo closure for 7.2)

* We can hit the error in description if the plugin is installed on 7.2, and
doesn't have ostree (the default), but it attached to subs that provide ostree content.

* The plugin could be quieter about that failure, since not having ostree at all is a legit answer to 'where is my ostree origin'

* That would let us install and test the package on RHEL, but still be built and able to be pulled into atomic composes (where the ostree dep is assumed).

ie, reverting it to as it was before.

Comment 8 Chris "Ceiu" Rog 2015-08-14 18:41:45 UTC
commit e6a140d6d995887bd1f6488ef2549f913e4c3790
Author: Adrian Likins <alikins>
Date:   Fri Aug 14 11:10:28 2015 -0400

    1185958: Remove ostree plugins req on ostree
    
    ostree isn't provided in RHEL7, so the dep can't be
    resolved, and it's a base dep on atomic. This allows
    for testing/dev on non-atomic RHEL7.

Comment 10 John Sefler 2015-08-17 17:44:08 UTC
Moving back to NEW/FailedQA since the behavior in comment 0 continues with version...

[root@jsefler-7 ~]# rpm -q subscription-manager-plugin-ostree ostree
subscription-manager-plugin-ostree-1.15.9-6.el7.x86_64
package ostree is not installed

Comment 12 Adrian Likins 2015-09-21 17:20:18 UTC
github master pr at https://github.com/candlepin/subscription-manager/pull/1299

commit 075a72fe7369f8471fc90113559c3bd16f1a7ec6
Author: Adrian Likins <alikins>
Date:   Mon Sep 21 13:13:12 2015 -0400

    1185958: Quieter ostree plugin sans ostree
    
    If the ostree content plugin is installed on a system that
    doesn't have ostree installed and/or it is not an active
    ostree deployed system, more or less ignore ostree plugin
    errors.
    
    Add a new exception type for gi_wrapper related errors, and
    give it a unthreatening str() to avoid cluttering logs with
    generally harmless tracebacks.
    
    It should be every uncommon for a user to get in this situation
    unless they have specifially installed the ostree content plugin
    on a system that does not use ostree.

Comment 13 Alex Wood 2015-09-24 18:25:58 UTC
*** Bug 1170324 has been marked as a duplicate of this bug. ***

Comment 14 Adrian Likins 2015-09-24 19:53:41 UTC
*** Bug 1257787 has been marked as a duplicate of this bug. ***

Comment 15 Chris "Ceiu" Rog 2015-09-24 20:44:32 UTC
Hash listed above is incorrect. The correct hash appears to be 9051f40cfadd0155f15c04c8aada055f4f5424af

Comment 17 J.C. Molet 2015-09-29 15:29:29 UTC
[root@jmolet-vm2 ~]# rpm -q subscription-manager-plugin-ostree ostree
subscription-manager-plugin-ostree-1.15.9-12.el7.x86_64
package ostree is not installed
[root@jmolet-vm2 ~]# subscription-manager register --username=testuser1 --password=password --org=admin
Registering to: jmolet-cp0.usersys.redhat.com:8443/candlepin
The system has been registered with ID: b94288bb-8271-4d30-b6d9-3ca5c6f099e9 
[root@jmolet-vm2 ~]# subscription-manager unregister
System has been unregistered.


no tracebacks in rhsm.log

marking VERIFIED.

Comment 18 errata-xmlrpc 2015-11-19 11:48:21 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.