Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1151941

Summary: java/lang/OutOfMemoryError when running client.schedule.listFailedActions API call on big DB
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: APIAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED DEFERRED QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 560CC: tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-09 11:24:53 UTC Type: Bug
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: 1162131    

Description Jan Hutař 2014-10-13 07:00:27 UTC
Description of problem:
There is "java/lang/OutOfMemoryError" error when running client.schedule.listFailedActions API call on big DB (not instantly, but after few minutes).


Version-Release number of selected component (if applicable):
spacewalk-java-2.0.2-87.el6sat.noarch
spacewalk-schema-2.0.2-17.el6sat.noarch
satellite-schema-5.6.0.19-3.el6sat.noarch


How reproducible:
always with given DB dump


Steps to Reproduce:
1. Have Satellite with big DB dump
2. In python shell run:
   >>> import xmlrpclib
   >>> client = xmlrpclib.Server('https://<fqdn>/rpc/api', verbose=0)
   >>> key = client.auth.login('<user>', '<pass>')
   >>> failed_list = client.schedule.listFailedActions(key)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: unhandled internal exception: java.lang.reflect.InvocationTargetException'>


Actual results:
OutOfMemoryError. For full logs see attachement.


Expected results:
API call should work


Additional info:
This was reported while working on bug 1115149.

Comment 3 Jan Hutař 2014-10-13 07:35:01 UTC
Reusing workaround noted in https://access.redhat.com/solutions/93253 there is 45326 actions in the DB (do nt know if it is a lot or few):

# spacewalk-sql -i
psql (8.4.20)
Type "help" for help.

rhnschema=# SELECT COUNT(*) FROM rhnAction WHERE id in
rhnschema-# (select id from rhnUserActionOverview
rhnschema(# where org_id = 1
rhnschema(# and user_id = 1
rhnschema(# and action_status_id = 2
rhnschema(# and archived = 0);
 count 
-------
 45326
(1 row)

Comment 4 Jan Hutař 2014-10-13 07:39:10 UTC
Surprisingly client.schedule.listCompletedActions API call works as expected:

>>> completed_list = client.schedule.listCompletedActions(key)
>>> len(completed_list)
45326

anyway, client.schedule.archiveActions fails on this number of actions:

>>> archive_result=client.schedule.archiveActions(key,action_ids)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1243, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for ibm-x3250m4-09.rhts.eng.bos.redhat.com/rpc/api: 503 Service Temporarily Unavailable>

Comment 5 Tomas Lestach 2018-04-09 11:24:53 UTC
We have re-reviewed this bug, as part of an ongoing effort to improve Satellite/Proxy feature and bug updates, review and backlog.

This is a low priority bug and has no currently open customer cases. While this bug may still valid, we do not see it being implemented prior to the EOL of the Satellite 5.x product. As such, this is being CLOSED DEFERRED. 

Closing now to help set customer expectations as early as possible. You are welcome to re-open this bug if needed.