Bug 1198369
| Summary: | UnboundLocalError: local variable 'state' referenced before assignment | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | John Sefler <jsefler> |
| Component: | subscription-manager | Assignee: | Chris "Ceiu" Rog <crog> |
| Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.7 | CC: | crog, dgoodwin, skallesh, wpoteat |
| Target Milestone: | rc | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-07-22 06:53:26 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1125249 | ||
Although this is a regression, it is not a blocker for rhel6.7 since it happens rarely. If it does occur, the user should re-try. If compliance status includes reasons that do not include a prod id, this could get triggered. unmapped guest related? It's similar to https://bugzilla.redhat.com/show_bug.cgi?id=1201727 Looks like this got broken in: commit 3d5a9a5dba480d75f52ff7201af01496c871ab58 Author: Adrian Likins <alikins> Date: Mon Jan 19 13:16:12 2015 -0500 1183122: Fix KeyErrors building dbus ent status If the info returned from a cert_sorter.get_compliance_status didn't have keys we expected, we broke. Attempt to be more lenient about the structure of compliance status. Ignore missing keys, empty lists, etc. Move refresh_compliance_status to managerlib, and add tests to test_managerlib. I'm not going to say it's DBUS. But it's DBUS. (more accurately, the cockpit related changes we backed out for 7.1). We believe this will be fixed by reverting the dbus code that triggers events on compliance status changes. subscription-manager.git: cf23450fc1d519a7d0e90611499047ce2e7c3334 Will appear in subscription-manager-1.15.3-1 Since I don't have an exact reproducer, I'm going to let this one bake for a little while. If it does not re-surface through automated test runs, then I'll move it to VERIFIED. I have reproduced this a few times but of late with following version have not seen the traceback
server type: Red Hat Subscription Management
subscription management server: 0.9.49-1
subscription management rules: 5.15
subscription-manager: 1.14.5-1.el6
python-rhsm: 1.14.2-1.el6
[root@dhcp35-135 ~]# subscription-manager register --force --user admin --org admin
The system with UUID c854f8c0-6695-4450-96e5-55f2f1d596dd has been unregistered
Password:
The system has been registered with ID: da824863-9f6d-4286-bca3-f73a2e0b4d75
[root@dhcp35-135 ~]# subscription-manager list --installed
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Awesome OS Server Bits
Product ID: 37060
Version: 6.1
Arch: ALL
Status: Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:
Ends:
[root@dhcp35-135 ~]# subscription-manager facts | grep is_guest
virt.is_guest: True
[root@dhcp35-135 ~]# subscription-manager list --all --avail --matches "*data center*"
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Server Basic (data center)
Provides:
SKU: awesomeos-server-basic-dc
Contract: 4
Pool ID: 8ac681e44cc1fa3e014cc1fb9f261fc9
Provides Management: No
Available: 5
Suggested: 1
Service Level: None
Service Type: Self-Support
Subscription Type: Standard
Ends: 04/15/2016
System Type: Physical
Subscription Name: Awesome OS Server Basic (data center)
Provides:
SKU: awesomeos-server-basic-dc
Contract: 5
Pool ID: 8ac681e44cc1fa3e014cc1fb9c081f15
Provides Management: No
Available: 10
Suggested: 1
Service Level: None
Service Type: Self-Support
Subscription Type: Standard
Ends: 04/15/2016
System Type: Physical
[root@dhcp35-135 ~]# subscription-manager attach --pool 8ac681e44cc1fa3e014cc1fb9c081f15
Successfully attached a subscription for: Awesome OS Server Basic (data center)
[root@dhcp35-135 ~]# subscription-manager attach --pool 8ac681e44cc1fa3e014cc1fb9f261fc9
Successfully attached a subscription for: Awesome OS Server Basic (data center)
[root@dhcp35-135 ~]# subscription-manager status
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Invalid
Awesome OS Server Basic (data center):
- Only supports 8 of 32 vCPUs.
Awesome OS Server Bits:
- Not supported by a valid subscription.
We have not observed the trace back both in automated as well manual tests,hence marking verified!! 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-1345.html |
Description of problem: Encountering a traceback with the scenario presented below against a standalone candlepin server with TESTDATA deployed Version-Release number of selected component (if applicable): [root@jsefler-os6 ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.9.45-1 subscription management rules: 5.14 subscription-manager: 1.14.1-1.el6 python-rhsm: 1.14.1-1.el6 How reproducible: not always Steps to Reproduce: [root@jsefler-os6 ~]# subscription-manager register --username=testuser1 --org=admin Password: The system has been registered with ID: 4815e98f-978f-4c61-ba1d-e4a21bb3cebe [root@jsefler-os6 ~]# [root@jsefler-os6 ~]# subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Awesome OS Server Bits Product ID: 37060 Version: 6.1 Arch: ALL Status: Not Subscribed Status Details: Not supported by a valid subscription. Starts: Ends: [root@jsefler-os6 ~]# subscription-manager facts | grep is_guest virt.is_guest: True [root@jsefler-os6 ~]# [root@jsefler-os6 ~]# subscription-manager list --all --avail --matches "*data center*" +-------------------------------------------+ Available Subscriptions +-------------------------------------------+ Subscription Name: Awesome OS Server Basic (data center) Provides: SKU: awesomeos-server-basic-dc Contract: 4 Pool ID: 8a9087e34bdb9471014bdb954f5f05e0 Provides Management: No Available: 5 Suggested: 1 Service Level: None Service Type: Self-Support Subscription Type: Standard Ends: 02/29/2016 System Type: Physical Subscription Name: Awesome OS Server Basic (data center) Provides: SKU: awesomeos-server-basic-dc Contract: 4 Pool ID: 8a9087e34bdb9471014bdb954fc90633 Provides Management: No Available: Unlimited Suggested: 1 Service Level: Full-Service Service Type: Drive-Through Subscription Type: Standard Ends: 02/29/2016 System Type: Virtual [root@jsefler-os6 ~]# [root@jsefler-os6 ~]# subscription-manager attach --pool=8a9087e34bdb9471014bdb954fc90633 Successfully attached a subscription for: Awesome OS Server Basic (data center) [root@jsefler-os6 ~]# subscription-manager attach --pool 8a9087e34bdb9471014bdb954f5f05e0 Successfully attached a subscription for: Awesome OS Server Basic (data center) Traceback (most recent call last): File "/usr/share/rhsm/subscription_manager/dbus_interface.py", line 59, in emit_status self.validity_iface.emit_status() File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 68, in __call__ return self._proxy_method(*args, **keywords) File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__ **keywords) File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Python.UnboundLocalError: Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/dbus/service.py", line 702, in _message_cb retval = candidate_method(self, *args, **keywords) File "/usr/libexec/rhsmd", line 202, in emit_status self._dbus_properties = refresh_compliance_status(self._dbus_properties) File "/usr/share/rhsm/subscription_manager/managerlib.py", line 920, in refresh_compliance_status entitlements[label] = (name, state, message) UnboundLocalError: local variable 'state' referenced before assignment [root@jsefler-os6 ~]# subscription-manager status +-------------------------------------------+ System Status Details +-------------------------------------------+ Overall Status: Invalid Awesome OS Server Basic (data center): - Only supports 2GB of 4GB of RAM. UNABLE_TO_GET_NAME: - Guest has not been reported on any host and is using a temporary unmapped guest subscription. Awesome OS Server Bits: - Not supported by a valid subscription. NOTICE: Both the Traceback and the "UNABLE_TO_GET_NAME" results are unexpected.