Bug 811638
Summary: | TypeError: 'NoneType' object is not subscriptable | ||
---|---|---|---|
Product: | [Community] Candlepin | Reporter: | Matt Reid <mreid> |
Component: | candlepin | Assignee: | Bryan Kearney <bkearney> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Eric Sammons <esammons> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 0.5 | CC: | alikins, jsefler, mstead |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-07-17 13:04:21 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: | 738066 |
Description
Matt Reid
2012-04-11 15:25:10 UTC
candlepin-0.5.26 seems to be the root of this. It really doesn't like None releases, and either throws NullPointerExceptions serverside, or causes later clients to fail because they expect a Release object to be returned (5.26 just returns a bare string). I think the right fix is to rev candlepin to a version with this fix (.5.27) or to backport : commit cd1bfaead0063e2549e70ff00674f52b17771edc Author: Adrian Likins <alikins> Date: Thu Mar 22 14:36:25 2012 -0400 804227: add simple model for Release Fix cases where we could NPE with no release set To a the cp version we need. I think I might be able to work around and support the "old" broken cp and the current version, but it is going to be kind of uGly client side. python-rhsm commit abc2190a6b386cee0122ff339bc50f6804feeb7a Author: Adrian Likins <alikins> Date: Fri Apr 13 14:47:46 2012 -0400 811638: Fix issues with release with candlepin 0.5.26 0.5.26 has an old version of the /consumer/*/release api, so try to handle that case as best as we can. The main issue is the getRelease just returns a bare string (and not a json encoded one). We don't have a great way to predict this, so just handle it if happens. subscription-manager commit d020040933001cb71cd7f6a0729b17f29c70478d Author: Adrian Likins <alikins> Date: Fri Apr 13 15:20:47 2012 -0400 811638: require latest python-rhsm for backcompat with cp 0.5.26 commit 351640473a25a5ee7c245aebf4ad43f154afabe9 Author: Adrian Likins <alikins> Date: Fri Apr 13 14:43:51 2012 -0400 811638: Fix issues with release with candlepin 0.5.26 0.5.26 has an old version of the /consumer/*/release api, so try to handle that case as best as we can. The main issue is the getRelease just returns a bare string (and not a json encoded one). We don't have a great way to predict this, so just handle it if happens. This patch has been reverted, as the fix has been moved into candlepin. (subscription-manager) commit 3ee403248966265411293cacfbc7f7d5402d2fd3 Author: Adrian Likins <alikins> Date: Wed Apr 18 11:09:21 2012 -0400 Revert "811638: Fix issues with release with candlepin 0.5.26" This reverts commit 351640473a25a5ee7c245aebf4ad43f154afabe9. This workaround is not needed thanks to a candlepin fix. (python-rhsm) commit 5a4d14cebe718771ac0de00560a14465783f1c95 Author: Adrian Likins <alikins> Date: Wed Apr 18 10:28:32 2012 -0400 Revert "811638: Fix issues with release with candlepin 0.5.26" This reverts commit abc2190a6b386cee0122ff339bc50f6804feeb7a. This workaround is not needed thanks to a candlepin fix. The fix in candlepin: commit 782f0e1782898fcdc6bbcea07d7817b6ae661716 Author: Adrian Likins <alikins> Date: Fri Apr 20 10:49:15 2012 -0400 814385: fix releasever schema to be varchar instead of bytea Change Consumer.releasever back to a plain string and wrap get/set to use Release model. There appears to have been a lot of second thoughts on how/where to fix this bug. With the offending candlepin 0.5.26 configured, I can reproduce the behavior in comment 2 with the latest brew builds of subscription-manager and python-rhsm... [root@jsefler-r63-server ~]# curl -k https://jsefler-f14-candlepin:8443/candlepin/status --stderr /dev/null | python -m simplejson.tool | grep version "version": "0.5.26" [root@jsefler-r63-server ~]# rpm -q subscription-manager python-rhsm subscription-manager-0.99.15-1.el6.x86_64 python-rhsm-0.99.8-1.el6.noarch [root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin The system has been registered with id: 12344465-6585-45f5-b3e6-7edb84625dfa [root@jsefler-r63-server ~]# subscription-manager release Runtime Error null at org.candlepin.resource.ConsumerResource.getRelease:1,543 [root@jsefler-r63-server ~]# subscription-manager repos --list Runtime Error null at org.candlepin.resource.ConsumerResource.getRelease:1,543 [root@jsefler-r63-server ~]# With the candlepin 0.5.28 configured, the expected behavior is observed... [root@jsefler-r63-server ~]# curl -k https://jsefler-f14-candlepin:8443/candlepin/status --stderr /dev/null | python -m simplejson.tool | grep version "version": "0.5.28" [root@jsefler-r63-server ~]# rpm -q subscription-manager python-rhsmsubscription-manager-0.99.15-1.el6.x86_64 python-rhsm-0.99.8-1.el6.noarch [root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin The system has been registered with id: 07395546-830b-4487-ac84-dc70ca602b39 [root@jsefler-r63-server ~]# subscription-manager release Release not set [root@jsefler-r63-server ~]# subscription-manager repos --list The system is not entitled to use any repositories. However, before I move this to VERIFIED, I'd like to know where Adrian's candlepin commit 782f0e1782898fcdc6bbcea07d7817b6ae661716 from comment 6 is located. I could not find it in the candlepin master branch. For master branch: commit b196708d47d4ab0d158ae72af53e1b0d8ec8cabb Author: Adrian Likins <alikins> Date: Fri Apr 20 10:49:15 2012 -0400 814385: fix releasever schema to be varchar instead of bytea Change Consumer.releasever back to a plain string and wrap get/set to use Release model. Add liquibase schema migration scripts. Note we don't have a rollback here, since psql can't change a varchar to a bytea, and any existing content in releasever was busted anyway. Final verification is against master candlepin with comment #9 deployed... [root@jsefler-f14-candlepin candlepin]# git branch * master [root@jsefler-f14-candlepin candlepin]# git show | head -n5 commit b196708d47d4ab0d158ae72af53e1b0d8ec8cabb Author: Adrian Likins <alikins> Date: Fri Apr 20 10:49:15 2012 -0400 814385: fix releasever schema to be varchar instead of bytea [root@jsefler-f14-candlepin candlepin]# [root@jsefler-r63-server ~]# subscription-manager register --username testuser1 --password password --org admin The system has been registered with id: a4a8713d-d2e9-427e-aded-a0f06e7a344e [root@jsefler-r63-server ~]# subscription-manager repos --list The system is not entitled to use any repositories. [root@jsefler-r63-server ~]# subscription-manager release Release not set [root@jsefler-r63-server ~]# subscription-manager release --set FOO Release set to: FOO [root@jsefler-r63-server ~]# subscription-manager release Release: FOO [root@jsefler-r63-server ~]# moving to VERIFIED Marking all community bugs modified or beyong as closed. |