Running sw-system-snapshot to remove a large number of snapshots encounters xmlrpclib.ProtocolError: 503 Service Temporarily Unavailable
Issue
- Listing the top 20 tables with the most number of rows shows the database contains a large number of rows in the snapshot tables.
# echo "select * from (select table_name, num_rows, blocks from user_tables where num_rows is not null order by num_rows desc, table_name) mostrows where rownum <= 20;" | sqlplus -S $(spacewalk-cfg-get default_db)
TABLE_NAME NUM_ROWS BLOCKS
------------------------------ ---------- ----------
RHNSNAPSHOTPACKAGE 1.2781E+10 30892536
RHNSNAPSHOTCONFIGREVISION 539772341 2610207
RHNSNAPSHOTSERVERGROUP 151261265 341962
RHNSNAPSHOTCHANNEL 67153280 155649
RHNSNAPSHOTCONFIGCHANNEL 50900196 253220
RHNPACKAGEFILE 24183342 409226
RHNACTIONCONFIGREVISION 21392109 155012
RHNPACKAGECAPABILITY 10315066 155012
RHNSNAPSHOT 9543388 98837
RHNSERVERPACKAGE 8405222 51023
RHNPACKAGECHANGELOG 7183360 302324
...
- For Satellite 5.8, use the below query :-
SELECT
relname as "Table",
pg_size_pretty(pg_total_relation_size(relid)) As "Size",
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "External Size"
FROM pg_catalog.pg_statio_user_tables ORDER BY relname,pg_total_relation_size(relid) DESC;
...
rhnsnapshot | 972 MB | 53 MB
rhnsnapshotchannel | 64 MB | 31 MB
rhnsnapshotconfigchannel | 533 MB | 250 MB
rhnsnapshotconfigrevision | 4305 MB | 2037 MB
rhnsnapshotinvalidreason | 48 kB | 40 kB
rhnsnapshotpackage | 24 GB | 10145 MB
rhnsnapshotservergroup | 220 MB | 117 MB
rhnsnapshottag | 1232 kB | 712 kB
...
- Following the steps in How can I remove old system snapshot data from my Satellite? and trying to delete 1 day of snapshots for a machine that have around 6000 snapshots causes the command to fail with the following errors :
[root@satellite ~]# sw-system-snapshot -da --system-id=1000058080 --start-date=20110811000000 --end-date=20110812000000
Red Hat Network username: satuser
Red Hat Network password:
Traceback (most recent call last):
File "/usr/bin/sw-system-snapshot", line 66, in ?
sys.exit(abs(main() or 0))
File "/usr/bin/sw-system-snapshot", line 58, in main
return systemSnapshot.main()
File "/usr/share/rhn/utils/systemSnapshot.py", line 81, in main
options.end_date)
File "/usr/share/rhn/utils/systemSnapshot.py", line 155, in deleteAllBetweenDates
{"startDate":startDate, "endDate":endDate})
File "/usr/lib64/python2.4/xmlrpclib.py", line 1096, in __call__
return self.__send(self.__name, args)
File "/usr/lib64/python2.4/xmlrpclib.py", line 1383, in __request
verbose=self.__verbose
File "/usr/lib64/python2.4/xmlrpclib.py", line 1137, in request
headers
xmlrpclib.ProtocolError: <ProtocolError for satellite.example.com/rpc/api: 503 Service Temporarily Unavailable>
Environment
- RHN Satellite 5.4.1
- RHN Satellite 5.5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
