Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 795862

Summary: Activation Keys for Orgs with multiple environment paths show undefined method productName error
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: Content ManagementAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney, inecas
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-22 19:57:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Error message in the web ui none

Description Og Maciel 2012-02-21 16:56:32 UTC
Created attachment 564751 [details]
Error message in the web ui

Description of problem:

Unable to register a system with activation key. May be related to fact that Org has multiple environment paths?

Version-Release number of selected component (if applicable):

* subscription-manager-0.96.17-1.el6.x86_64
* candlepin-0.5.20-1.el6.noarch
* candlepin-tomcat6-0.5.20-1.el6.noarch
* katello-0.1.238-4.el6.noarch
* katello-all-0.1.238-4.el6.noarch
* katello-certs-tools-1.0.2-2.el6.noarch
* katello-cli-0.1.54-2.el6.noarch
* katello-cli-common-0.1.54-2.el6.noarch
* katello-common-0.1.238-4.el6.noarch
* katello-configure-0.1.64-5.el6.noarch
* katello-glue-candlepin-0.1.238-4.el6.noarch
* katello-glue-foreman-0.1.238-4.el6.noarch
* katello-glue-pulp-0.1.238-4.el6.noarch
* katello-httpd-ssl-key-pair-1.0-1.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-repos-0.1.5-1.el6.noarch
* katello-selinux-0.1.5-2.el6.noarch
* katello-trusted-ssl-cert-1.0-1.noarch
* pulp-0.0.265-1.el6.noarch
* pulp-admin-0.0.265-1.el6.noarch
* pulp-client-lib-0.0.265-1.el6.noarch
* pulp-common-0.0.265-1.el6.noarch
* pulp-selinux-server-0.0.265-1.el6.noarch

How reproducible:


Steps to Reproduce:
1. Created a Seattle org
2. Added a Library -> Dev1 -> QE1 -> GA1 environment for Seattle
3. Added a Library -> Dev2 environment for Seattle
4. Added a custom provider CFSE with a SE product and 2 repositories:
  * el6-tools:  http://download.lab.bos.redhat.com/rel-eng/CloudForms/1.0/latest/el6-tools/x86_64/
  * el6-se: http://download.lab.bos.redhat.com/rel-eng/CloudForms/1.0/latest/el6-se/x86_64/
5. Created new package filter with katello-agent package and associated it with CFSE -> FE -> el6-tools repository
6. Performed sync process manually
7. Promoted all of CFSE product Library -> Dev1
8. Deleted the package filter with katello-agent
9. Promoted all of CFSE product Library -> Dev2
  
Actual results:

Registering my client failed with Pool with id ff808081359ca54e0135a0557fe701a4 could not be found. Going to Systems -> Activation Keys, selecting my activation key and then clicking the Applied Subscriptions gives me a undefined method `productName' for nil:NilClass message in the web ui

Expected results:


Additional info:

subscription-manager:
====================
# subscription-manager register --org Seattle --activationkey ak01
Pool with id ff808081359ca54e0135a0557fe701a4 could not be found

client's rhsm.log:
==================
2012-02-21 11:26:19,592 [ERROR]  @connection.py:385 - No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 376, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 252, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 191, in _request
    context.load_cert(self.cert_file, keyfile=self.key_file)
  File "/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Context.py", line 76, in load_cert
    m2.ssl_ctx_use_cert(self.ctx, certfile)
SSLError: No such file or directory

katello/katello.log:
====================

[ERROR: 2012-02-21 11:27:41 #11959] undefined method `productName' for nil:NilClass
[ERROR: 2012-02-21 11:27:41 #11959] undefined method `productName' for nil:NilClass
[ERROR: 2012-02-21 11:27:41 #11959] #<NoMethodError: undefined method `productName' for nil:NilClass>
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/app/controllers/activation_keys_controller.rb:316:in `pools_hash'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/app/controllers/activation_keys_controller.rb:315:in `each'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/app/controllers/activation_keys_controller.rb:315:in `pools_hash'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/app/controllers/activation_keys_controller.rb:308:in `retrieve_applied_pools'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/app/controllers/activation_keys_controller.rb:77:in `applied_subscriptions'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/base.rb:150:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/rendering.rb:11:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb:18:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:462:in `_run__279009836__process_action__1378587212__callbacks'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:221:in `_conditional_callback_around_2776'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/lib/util/threadsession.rb:79:in `thread_locals'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:220:in `_conditional_callback_around_2776'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:446:in `_run__279009836__process_action__1378587212__callbacks'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `send'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:94:in `send'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:94:in `run_callbacks'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/callbacks.rb:17:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/rescue.rb:17:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/notifications.rb:52:in `instrument'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/notifications.rb:52:in `instrument'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/base.rb:119:in `process'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/abstract_controller/rendering.rb:41:in `process'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal.rb:138:in `dispatch'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal.rb:178:in `action'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:62:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:27:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/route_set.rb:150:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:93:in `recognize'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:68:in `optimized_each'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/code_generation.rb:92:in `recognize'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-mount-0.7.1/lib/rack/mount/route_set.rb:141:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:493:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/warden-1.0.5/lib/warden/manager.rb:35:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/warden-1.0.5/lib/warden/manager.rb:34:in `catch'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/warden-1.0.5/lib/warden/manager.rb:34:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/sass-3.1.4/lib/sass/../sass/plugin/rack.rb:54:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/head.rb:14:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/methodoverride.rb:24:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/flash.rb:182:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/cookies.rb:302:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/query_cache.rb:32:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/query_cache.rb:12:in `cache'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/query_cache.rb:31:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/sendfile.rb:102:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/rack/logger.rb:13:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/runtime.rb:17:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/lock.rb:34:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:168:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `send'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:52:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:46:in `each'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/urlmap.rb:46:in `call'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:84:in `pre_process'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `catch'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:82:in `pre_process'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:57:in `process'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/controllers/controller.rb:86:in `start'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `send'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `run_command'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/bin/thin:6
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/script/thin:24:in `load'
[ERROR: 2012-02-21 11:27:41 #11959] /usr/share/katello/script/thin:24
[ERROR: 2012-02-21 11:27:41 #11959] Rendering 500:undefined method `productName' for nil:NilClass

Comment 1 Ivan Necas 2012-02-22 08:43:23 UTC
What steps were used to craete the activation key?

Comment 2 Ivan Necas 2012-02-22 09:00:46 UTC
Reproduced when:
1. creating activation key
2. assigning product to activation key
3. deleting product

@Og: Is it possible that this was your case as well?

Comment 3 Og Maciel 2012-02-22 13:44:04 UTC
Hi Ivan, during the process of creating my product and environments, I hit one issue related to having the same product name on different providers, but the activation key was created iirc after Org, Product and Envs were created and all content was synced and promoted.

Comment 4 Og Maciel 2012-02-22 13:45:13 UTC
That was bug 784712

Comment 6 Ivan Necas 2012-02-22 15:53:56 UTC
Create another BZ with another scenario reproducing this problem: https://bugzilla.redhat.com/show_bug.cgi?id=796283

Could not reproduce with provided scenario

Comment 7 Og Maciel 2012-02-22 19:57:56 UTC
Closing it in favor of the new bug filed by Ivan.