Bug 498275

Summary: obtainReactivationKey doesnt update key in webui and old key is not replaced
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: APIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Sayli Karmarkar <skarmark>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, mmraka
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:55:32 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:
Bug Depends On:    
Bug Blocks: 456996    

Description Sayli Karmarkar 2009-04-29 17:33:03 UTC
Description of problem:

reference bz# 496318 : 

So, here are two issues that I am seeing. 

#1. I register a system and create reactivation key using api client.system.obtainReactivationKey(key, sysemid). It shows up created key in webUI for first time but not after that. 

[root@rlx-3-20 ~]# rhnreg_ks --activationkey="1-aa3b47975110ee23d6ac98cb6c72229d" --force
[root@rlx-3-20 ~]# 

The system is registered without error and with usage-limit set to 1. So when you generate reactivation key multiple times, call seems to succeed however key cannot be seen in webui after first couple of times. 

Steps: 
1. Register a system to satellite.
2. client.system.obtainReactivationKey(key, sysid)
4. Go to https://sat-url/network/systems/details/activation.pxt?sid=1000010302
(You can see the created reactivation key )
3. rhnreg_ks --activationkey=key --force  (This will succeed)
4. Follow sequence 2 to 4  3-4 times and check whether activation key is shown each time in webui 

Observed: 
Reactivation key is not see on webui after initial try which shouldn't happen.


#2. If I invoke api multiple times without actually using reactivation key, old key doesnt seem to have replaced by new key. I can still register systems using old key. (unlike the behavior when we create reactivation key using webui.)

Steps: 
1. Register a system to satellite.
2. client.system.obtainReactivationKey(key, sysid)  (lets say generated key value is key1)
3. client.system.obtainReactivationKey(key, sysid)  (lets say generated key value is key2)
3. rhnreg_ks --activationkey=key1 --force  (This will succeed)
   So basically when we generated key2, key1 was not removed or replaced by key2. It still exists.     


If we follow above 2 sequences just using generate reactivation key in webui, we can see the key every time and also the new key is replaced by old key. So, if we try to register using old key it gives invalid key which makes sense.

Comment 1 Brad Buckingham 2009-04-30 15:50:57 UTC
master git commit: 8fa2b65fedf786fc8841633cd456a3f4131acaa6
vader git commit: 66b40db71571aca6acb98d604c580267f4e91fb0

After investigation, the issue was that the API was creating a new reactivation key but not removing any existing ones when invoking the API.  Updated the API
to remove the existing and create a new.

Comment 2 Sayli Karmarkar 2009-05-12 18:38:20 UTC
verified.

Comment 3 Michael Mráka 2009-08-26 11:13:25 UTC
Validated in stage -> RELEASE_PENDING.

#1 - Reactivation key is always shown in webUI and works.
#2 - Old key is no longer valid.
  rhnreg_ks --serverUrl=http://dell-pem710-01.rhts.eng.bos.redhat.com/XMLRPC --activationkey=re-1-fbdd7c94eaefbadf3c238591852cd264  --force
Error Message:
    Could not find token 're-1-fbdd7c94eaefbadf3c238591852cd264'
Error Class Code: 60
Error Class Info: 
     The activation token specified could not be found on the server.
     Please retry with a valid key.

Comment 4 Brandon Perkins 2009-09-10 19:55:32 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html