Bug 635792 - rhn-satellite-activate raising cert exceptions with negative ents
Summary: rhn-satellite-activate raising cert exceptions with negative ents
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 540
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Justin Sherrill
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: sat540-blockers
TreeView+ depends on / blocked
 
Reported: 2010-09-20 17:43 UTC by Partha Aji
Modified: 2010-09-20 21:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-20 21:49:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Partha Aji 2010-09-20 17:43:24 UTC
I was using

http://svn.rhndev.redhat.com/viewcvs/*checkout*/trunk/pm/satellite-certs/satellite-5.3/redhat-cperry-webdev-rhel6-flex-no-beta-debug-rhx.cert?rev=196195


rhn-satellite-activate --rhn-cert=redhat-cperry-webdev-rhel6-flex-no-beta-debug-rhx.cert  --ignore-version-mismatch
RHN_PARENT: satellite.rhn.webdev.redhat.com
Population of the Channel Family permissions failed.
Return value: 6
Standard-out: 13:12:35 Red Hat Network Satellite - live synchronization
13:12:35    url: https://satellite.rhn.webdev.redhat.com
13:12:35    debug/output level: 1
13:12:38    db:  rhnsat/<password>@fjs12
13:12:38 
13:12:38 Retrieving / parsing channel-families data
13:12:41 channel-families data complete
+++ sending log as an email +++


Standard-error: 
SYNC ERROR: unhandled exception occurred:

(Check logs/email for potentially more detail)



<rhnFault class (code = 23, text = 'ORA-20290: (not_enough_entitlements_in_base_org) - You do not have enough entitlements in the base org.: org_id [1] family [rhel-ppc-server-cluster-z] max [-299]')>
(23, 'ORA-20290: (not_enough_entitlements_in_base_org) - You do not have enough entitlements in the base org.: org_id [1] family [rhel-ppc-server-cluster-z] max [-299]', 'Could not update database entry.')


No systems are subscribed to rhel-ppc-server-cluster-z, the only diff between the cert that was already in the database vs cert I am trying to activate w.r.t to  rhel-ppc-server-cluster-z is the fact that the existing cert had 0 flex ents while the new cert has 500 flex ents

Comment 1 Clifford Perry 2010-09-20 19:11:11 UTC
I hit this as well. Best I can tell the number/value thrown is the difference between the Flex and the Physical entitlements and negating... 

So 500 Flex in new cert, 140 physical in new cert and we get error thrown about -360 (140 - 500 = -360). 

We got a fairly serious bug either in the schema for activation or code which passes values to schema for activation of entitlements in DB.

Cliff

[root@hp-dl585g5-01 ~]# rhn-satellite-activate --rhn-cert=./redhat-cperry-webdev-rhel6-flex-no-beta-debug-rhx.cert\?rev\=196195 -vv --ignore-version-mismatch
RHN_PARENT: satellite.rhn.webdev.redhat.com
HTTP_PROXY: None
HTTP_PROXY_USERNAME: None
HTTP_PROXY_PASSWORD: <password>
CA_CERT: /usr/share/rhn/RHNS-CA-CERT
Checking cert XML sanity and GPG signature: '/usr/bin/validate-sat-cert.pl --keyring /etc/webapp-keyring.gpg /etc/sysconfig/rhn/rhn-entitlement-cert.xml-1GQFZH'
Database connectioned initialized: refer to /etc/rhn/rhn.conf
Attempting local RHN Certificate push (and therefore activation)
Executing: remote XMLRPC deactivation (if necessary).
Executing: remote XMLRPC activation call.
Executing: '/usr/bin/satellite-sync --list-channels --ca-cert /usr/share/rhn/RHNS-CA-CERT'

Population of the Channel Family permissions failed.
Return value: 6
Standard-out: 14:31:52 Red Hat Network Satellite - live synchronization
14:31:52    url: https://satellite.rhn.webdev.redhat.com
14:31:52    debug/output level: 1
14:31:52    db:  rhnsat/<password>@rhnsat
14:31:52 
14:31:52 Retrieving / parsing channel-families data
14:32:03 channel-families data complete
+++ sending log as an email +++


Standard-error: 
SYNC ERROR: unhandled exception occurred:

(Check logs/email for potentially more detail)

<rhnFault class (code = 23, text = 'ORA-20290: (not_enough_entitlements_in_base_org) - You do not have enough entitlements in the base org.: org_id [1] family [rhel-rhaps] max [-360]')>
(23, 'ORA-20290: (not_enough_entitlements_in_base_org) - You do not have enough entitlements in the base org.: org_id [1] family [rhel-rhaps] max [-360]', 'Could not update database entry.')




ERROR: Population of the Channel Family permissions failed.
[root@hp-dl585g5-01 ~]# grep -i rhaps redhat-cperry-*
redhat-cperry-rhel6-lite.cert?rev=195961:  <rhn-cert-field name="channel-families" flex="0" quantity="140" family="rhel-rhaps"/>
redhat-cperry-webdev-rhel6-flex-no-beta-debug-rhx.cert?rev=196195:  <rhn-cert-field name="channel-families" flex="500" quantity="140" family="rhel-rhaps"/>
[root@hp-dl585g5-01 ~]# grep -i rhaps redhat-cperry-* /etc/sysconfig/rhn/rhn-entitlement-cert.xml
redhat-cperry-rhel6-lite.cert?rev=195961:  <rhn-cert-field name="channel-families" flex="0" quantity="140" family="rhel-rhaps"/>
redhat-cperry-webdev-rhel6-flex-no-beta-debug-rhx.cert?rev=196195:  <rhn-cert-field name="channel-families" flex="500" quantity="140" family="rhel-rhaps"/>
/etc/sysconfig/rhn/rhn-entitlement-cert.xml:  <rhn-cert-field name="channel-families" flex="500" quantity="140" family="rhel-rhaps"/>
[root@hp-dl585g5-01 ~]# rhn-satellite-activate --vv
usage: rhn-satellite-activate [options]

rhn-satellite-activate: error: no such option: --vv
[root@hp-dl585g5-01 ~]# rhn-satellite-activate -vv
NOTE: using backup cert as default: /etc/sysconfig/rhn/rhn-entitlement-cert.xml
RHN_PARENT: satellite.rhn.webdev.redhat.com
HTTP_PROXY: None
HTTP_PROXY_USERNAME: None
HTTP_PROXY_PASSWORD: <password>
CA_CERT: /usr/share/rhn/RHNS-CA-CERT
Checking cert XML sanity and GPG signature: '/usr/bin/validate-sat-cert.pl --keyring /etc/webapp-keyring.gpg /etc/sysconfig/rhn/rhn-entitlement-cert.xml-g3wvec'
Database connectioned initialized: refer to /etc/rhn/rhn.conf
Attempting local RHN Certificate push (and therefore activation)
Executing: remote XMLRPC deactivation (if necessary).
Executing: remote XMLRPC activation call.
Executing: '/usr/bin/satellite-sync --list-channels --ca-cert /usr/share/rhn/RHNS-CA-CERT'

Population of the Channel Family permissions failed.
Return value: 6
Standard-out: 14:38:45 Red Hat Network Satellite - live synchronization
14:38:45    url: https://satellite.rhn.webdev.redhat.com
14:38:45    debug/output level: 1
14:38:46    db:  rhnsat/<password>@rhnsat
14:38:46 
14:38:46 Retrieving / parsing channel-families data
14:38:49 channel-families data complete
+++ sending log as an email +++


Standard-error: 
SYNC ERROR: unhandled exception occurred:

(Check logs/email for potentially more detail)

<rhnFault class (code = 23, text = 'ORA-20290: (not_enough_entitlements_in_base_org) - You do not have enough entitlements in the base org.: org_id [1] family [rhel-rhaps] max [-360]')>
(23, 'ORA-20290: (not_enough_entitlements_in_base_org) - You do not have enough entitlements in the base org.: org_id [1] family [rhel-rhaps] max [-360]', 'Could not update database entry.')




ERROR: Population of the Channel Family permissions failed.
[root@hp-dl585g5-01 ~]# 
[root@hp-dl585g5-01 ~]# cat /etc/motd
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
                 This System is reserved by cperry.

 To return this system early. You can run the command: return2beaker.sh
  Ensure you have your logs off the system before returning to Beaker

 To extend your reservation time. You can run the command:
  extendtesttime.sh
 This is an interactive script. You will be prompted for how many
  hours you would like to extend the reservation.
  Please use this command responsibly, Everyone uses these machines.

 You should verify the watchdog was updated succesfully after
  you extend your reservation.
  https://beaker.engineering.redhat.com/recipes/34942

 For ssh, kvm, serial and power control operations please look here:
  https://beaker.engineering.redhat.com/view/hp-dl585g5-01.rhts.eng.bos.redhat.com

      Beaker Test information:
                         HOSTNAME=hp-dl585g5-01.rhts.eng.bos.redhat.com
                            JOBID=18735
                         RECIPEID=34942
                    RESULT_SERVER=127.0.0.1:7088
                           DISTRO=RHEL5-Server-U5
                     ARCHITECTURE=x86_64
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
[root@hp-dl585g5-01 ~]#

Comment 2 Justin Sherrill 2010-09-20 21:49:47 UTC
The real issue here is that quantity in the certs should be flex + normal quantity, but this addition isn't being done.  If you edit the cert and add the flex number to quantity and leave the flex number alone it works just fine.

Closing as not a bug for satellite since hosted needs the change.


Note You need to log in before you can comment on or make changes to this bug.