Satellite-sync fails with error 'ORA-01400: cannot insert NULL into ("RHNSAT"."<TABLE>"."<COLUMN>")'
Environment
- Red Hat Satellite 5
- satellite-sync
Issue
- Errata not updating on Red Hat Satellite Server
- Error email from Red Hat Satellite Server
- Error message in Red Hat Satellite logs when trying to download new errata:
ERROR: server.dump.errata('<the systemid>', ['rhn-erratum-18232', 'rhn-erratum-18233', 'rhn-erratum-19324',
...
: Timeout Exception
satellite-syncis failing withSYNC ERROR
SYNC ERROR: unhandled exception occurred:
(Check logs/email for potentially more detail)
<rhnFault class (code = 54, text = 'ORA-01400: cannot insert NULL into ("RHNSAT"."RHNPACKAGECHANGELOG"."ID")')> (54, 'ORA-01400: cannot insert NULL into ("RHNSAT"."RHNPACKAGECHANGELOG"."ID")\n', '\n Package Upload Failed due to uniqueness constraint violation.\n Make sure the package does not have any duplicate dependencies or\n does not already exists on the server\n ')
unhandled exception occurredfrom satellite-sync:
SYNC ERROR: unhandled exception occurred:
Exception reported from server.example.com
Time: Thu Feb 20 10:08:20 2014
Exception type common.rhnException.rhnFault
Exception Handler Information
Traceback (most recent call last):
File "/usr/bin/satellite-sync", line 143, in main
return satsync.Runner().main()
File "/usr/share/rhn/satellite_tools/satsync.py", line 225, in main
ret = method()
File "/usr/share/rhn/satellite_tools/satsync.py", line 348, in _step_errata
self.syncer.import_errata()
File "/usr/share/rhn/satellite_tools/satsync.py", line 1894, in import_errata
sync_handlers.import_errata(chunk)
File "/usr/share/rhn/satellite_tools/sync_handlers.py", line 436, in import_errata
importer.run()
File "/usr/share/rhn/server/importlib/importLib.py", line 651, in run
self.submit()
File "/usr/share/rhn/server/importlib/errataImport.py", line 196, in submit
dml = self.backend.processErrata(self.batch)
File "/usr/share/rhn/server/importlib/backend.py", line 764, in processErrata
transactional=1)
File "/usr/share/rhn/server/importlib/backend.py", line 1446, in __processObjectCollection
return self.__processObjectCollection__(objColl, parentTable, childDict, **kwargs)
File "/usr/share/rhn/server/importlib/backend.py", line 1616, in __processObjectCollection__
return self.__doDML(dml)
File "/usr/share/rhn/server/importlib/backend.py", line 1724, in __doDML
self.__doInsert(dml.insert, dml.tables)
File "/usr/share/rhn/server/importlib/backend.py", line 1733, in __doInsert
raise rhnFault(54, str(e[1]), explain=0)
rhnFault: (54, 'ORA-01400: cannot insert NULL into ("RHNSAT"."RHNERRATAPACKAGE"."PACKAGE_ID")n', 'n Package Upload Failed due to uniqueness constraint violation.n Make sure the package does not have any duplicate dependencies orn does not already exists on the servern ')
Resolution
This issue is being tracked in Red Hat Bugzilla 1092608.
In the meantime please observe the following workaround:
If not using Inter Satellite Sync (ISS)
Clear the satellite-sync cache from the system as mentioned below:
# rm -rf /var/cache/rhn/satsync/*
After the cache has been cleared, resync the Red Hat Network Satellite server once again
# /usr/bin/satellite-sync
New errata should be downloaded during the sync
If using ISS
If this content is provided with ISS to your satellite, you should clean the cache but also regenerate the repodata for the channel attempted to be synced :
(iss-master)# rm -rf /var/cache/rhn/repodata/CHANNELLABEL/*
then go on the ISS master to https://issmaster.example.com/rhn/admin/BunchDetail.do?label=channel-repodata-bunch and click on schedule single run
check if the repodata is being regenerated and wait for until it is :
(iss-master)# tail -f /var/log/rhn/rhn_taskomatic_daemon.log | grep repomd
or
(iss-master)# watch -n2 ls -l /var/cache/rhn/repodata/CHANNELLABEL/
note that you still need to remove the sync cache on the iss slave:
(iss-slave)# rm -rfv /var/cache/rhn/*sync/*
If the content of the ISS parent changed too much between synchronizations you may have to recreate the iss slave's channel, especially if content previously synced was altered (E.G. packages removed from erratas)
Root Cause
- Satellite-sync cache on the Red Hat Network Satellite server was found to be corrupted, causing satellite-sync error. Cleaning the cache and and resyncing the Red Hat Network Satellite server will regenerate the cache.
- If using ISS to pull content into your client, the ISS master could be providing incorrect repodata
Diagnostic Steps
- Clean satellite cache and try
satellite-sync - Satellite-debug.
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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
