Red Hat Satellite receives traceback error : " ORA-00001: unique constraint (RHNSAT.RHN_SP_SNEP_UQ) violated "
Environment
- Red Hat Satellite 5.4
- Red Hat Satellite 5.5
- Red Hat Satellite 5.6
Issue
- After upgrading from Red Hat Satellite 5.3 to 5.4 , Satellite is receiving traceback messages with following error :
ORA-00001: unique constraint (RHNSAT.RHN_SP_SNEP_UQ) violated
- Complete traceback message :
Exception Handler Information
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheRequest.py", line 120, in call_function
response = apply(func, params)
File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 983, in update_packages
server.save_packages()
File "/usr/share/rhn/server/rhnServer/server_wrapper.py", line 73, in save_packages
ret = self.save_packages_byid(self.server["id"], schedule=schedule)
File "/usr/share/rhn/server/rhnServer/server_packages.py", line 218, in save_packages_byid
h.execute_bulk(package_data)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 202, in execute_bulk
ret = ret + apply(self.executemany, (), subdict)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 177, in executemany
return apply(self._execute_wrapper, (self._executemany, ) + p, kw)
File "/usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py", line 118, in _execute_wrapper
raise apply(sql_base.SQLError, ret)
SQLError: (1, 'ORA-00001: unique constraint (RHNSAT.RHN_SP_SNEP_UQ) violated\n', "insert into rhnServerPackage (server_id, name_id, evr_id, package_arch_id, installtime) values (:sysid, LOOKUP_PACKAGE_NAME(:n), LOOKUP_EVR(:e, :v, :r), LOOKUP_PACKAGE_ARCH(:a), TO_DATE(:instime, 'YYYY-MM-DD HH24:MI:SS') )")
Resolution
- Re-register the client to the satellite server once again by following below mentioned steps:
- Delete the existing system profile for client form the satellite server.
- Delete the existing systemid file from the client by running this command:
# rm -rf /etc/sysconfig/rhn/systemid
- Now register the client once again with the satellite server.
Root Cause
- As per tracebacks a unique constraint(server/system ID) is violated. Each system registered to the Satellite is to have a unique system ID.
- As per traceback and sosreport of client systems, could see client systems (cloned) had same system ID.
Diagnostic Steps
- Complete traceback message:
Exception type server.rhnSQL.sql_base.SQLError
Exception while handling function registration.update_packages
Request object information:
URI: /XMLRPC
Remote Host: xx.xx.xx
Server Name: xx.xx.xx:443
Headers passed in:
Accept-Encoding: identity
Content-Length: 240931
Host: xx.xx.xx:443
content-type: text/xml
user-agent: rhn.rpclib.py/$Revision: 136589 $
x-client-version: 1
x-info: RPC Processor (C) Red Hat, Inc (version 183383)
x-rhn-client-capability: packages.verifyAll(1)=1,caneatCheese(1)=1,packages.extended_profile(1)=1,reboot.reboot(1)=1,packages.verify(1)=1,packages.runTransaction(1)=1,packages.update(2)=2,packages.rollBack(1)=1
x-rhn-transport-capability: follow-redirects=3
x-transport-info: Extended Capabilities Transport (C) Red Hat, Inc (version 136589)
x-up2date-version: 0.4.20-9.el5
Extra information about this error:
SQL Error generated: (1, 'ORA-00001: unique constraint (RHNSAT.RHN_SP_SNEP_UQ) violated\n', "insert into rhnServerPackage (server_id, name_id, evr_id, package_arch_id, installtime) values (:sysid, LOOKUP_PACKAGE_NAME(:n), LOOKUP_EVR(:e, :v, :r), LOOKUP_PACKAGE_ARCH(:a), TO_DATE(:instime, 'YYYY-MM-DD HH24:MI:SS') )")
Exception Handler Information
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheRequest.py", line 120, in call_function
response = apply(func, params)
File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 983, in update_packages
server.save_packages()
File "/usr/share/rhn/server/rhnServer/server_wrapper.py", line 73, in save_packages
ret = self.save_packages_byid(self.server["id"], schedule=schedule)
File "/usr/share/rhn/server/rhnServer/server_packages.py", line 218, in save_packages_byid
h.execute_bulk(package_data)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 202, in execute_bulk
ret = ret + apply(self.executemany, (), subdict)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 177, in executemany
return apply(self._execute_wrapper, (self._executemany, ) + p, kw)
File "/usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py", line 118, in _execute_wrapper
raise apply(sql_base.SQLError, ret)
SQLError: (1, 'ORA-00001: unique constraint (RHNSAT.RHN_SP_SNEP_UQ) violated\n', "insert into rhnServerPackage (server_id, name_id, evr_id, package_arch_id, installtime) values (:sysid, LOOKUP_PACKAGE_NAME(:n), LOOKUP_EVR(:e, :v, :r), LOOKUP_PACKAGE_ARCH(:a), TO_DATE(:instime, 'YYYY-MM-DD HH24:MI:SS') )")
- Use the following command to identify the remote hosts from error_log in RHN Satellite and compare with tracebacks.
$ grep ^Remote httpd-logs/httpd/error_log*
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments