Bug 856236

Summary: Misleading error message registering w/ activation key and passing environment
Product: Red Hat Enterprise Linux 6 Reporter: Tom McKay <tomckay>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: alikins, bkearney, jsefler, spandey
Target Milestone: rcKeywords: Triaged
Target Release: 6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:56:09 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: 771481    

Description Tom McKay 2012-09-11 14:19:41 UTC
Running subscription-manager-0.99.19-1.el6.x86_64.rpm and registering against katello with the following command fails with "Invalid credentials". Registering directly without an activation key works without a problem.

% subscription-manager register --activationkey=some-key --org=some-org --env=some-env
Invalid credentials

The katello server log:

Started GET "/katello/api/owners/zipco/environments?name=RED" for 10.11.230.167 at Tue Sep 11 10:16:36 -0400 2012
  Processing by Api::EnvironmentsController#index as JSON
  Parameters: {"name"=>"RED", "organization_id"=>"zipco"}
Setting locale: en
Completed   in 4ms
  Processing by FailedAuthenticationController#unauthenticated_api as JSON
  Parameters: {"name"=>"RED", "organization_id"=>"zipco"}
Request is unauthenticated_api for 10.11.230.167
Completed 401 Unauthorized in 6ms (Views: 3.1ms | ActiveRecord: 0.0ms)
[2012-09-11 10:16:54] ERROR OpenSSL::SSL::SSLError: SSL_accept SYSCALL returned=5 errno=0 state=SSLv3 read client certificate A
	/usr/lib/ruby/1.8/openssl/ssl-internal.rb:166:in `accept'
[2012-09-11 10:16:54] ERROR OpenSSL::SSL::SSLError: SSL_accept SYSCALL returned=5 errno=0 state=SSLv3 read client certificate A
	/usr/lib/ruby/1.8/openssl/ssl-internal.rb:166:in `accept'

Comment 2 Tom McKay 2012-09-11 14:36:31 UTC
The real problem is that specifying an environment is not permitted with an activation key since that info is included. The CLI should not be making the api call at all.

Comment 4 Bryan Kearney 2012-10-08 19:07:43 UTC
fixed in master at 01d94d23d8cdc3f64745065a936f15c81d0c3d2a

Comment 7 spandey 2012-11-28 11:00:17 UTC
Using following rpm 
subscription-manager-1.8.0-1.git.3.006a990.el6.x86_64
subscription-manager-migration-1.8.0-1.git.3.006a990.el6.x86_64
subscription-manager-firstboot-1.8.0-1.git.3.006a990.el6.x86_64
subscription-manager-gui-1.8.0-1.git.3.006a990.el6.x86_64
subscription-manager-migration-data-1.12.2.6-1.git.0.171d4c3.el6.noarch



[root@localhost ~]# subscription-manager register --serverurl dhcp201-128.englab.pnq.redhat.com:443/katello/api --activationkey test_key --org ACME_Corporation --env test
Error: Activation keys do not allow environments to be specified.

Comment 8 John Sefler 2012-11-28 16:30:44 UTC
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.1.10-1.el6.x86_64

[root@jsefler-6 ~]# subscription-manager register --serverurl dhcp201-128.englab.pnq.redhat.com:443/katello/api --activationkey test_key --org ACME_Corporation --environment test
Error: Activation keys do not allow environments to be specified.
[root@jsefler-6 ~]# echo $?
255
[root@jsefler-6 ~]# subscription-manager register --serverurl dhcp201-128.englab.pnq.redhat.com:443/katello/api --activationkey test_key --org ACME_Corporation
The system has been registered with id: 9182a6d2-4721-4d88-9812-bbaa48a2a5fd 
[root@jsefler-6 ~]#

VERIFIED: subscription-manager now blocks you with an error message when specifying option --environment together with --org when registering with an --activationkey.

Comment 10 errata-xmlrpc 2013-02-21 08:56:09 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.

http://rhn.redhat.com/errata/RHBA-2013-0350.html