splunk / splunk-sdk-python

Splunk Software Development Kit for Python
http://dev.splunk.com
Apache License 2.0
698 stars 370 forks source link

Maximum recursion depth exceeded #294

Closed pablo-secu closed 2 years ago

pablo-secu commented 4 years ago

Hi,

I created a simple splunk app to test splunk SDK, it works but I get an error when there are lots of events (~20000):

RuntimeError: maximum recursion depth exceeded while calling a Python object

I have already checked the python recursionlimit (= 1000 by default)

Here my code:

@Configuration()
class test(ReportingCommand):

    """  TODO

    ## Requirements:
        TODO
    ## Description:
        TODO

    ## Syntax:
        TODO

    ## Example:
        TODO

    """

    @Configuration()
    def map(self, events):
        return events

    def reduce(self, events):
        events_list = list(events)
        event={}
        for evt in event_list:
            event["test"]=evt
            yield event

dispatch(test, sys.argv, sys.stdin, sys.stdout, __name__)

Here the error:

11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr: Traceback (most recent call last):
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:   File "/opt/splunk/etc/apps/test/bin/test.py", line 104, in <module>
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:     class test(ReportingCommand):
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:   File "/opt/splunk/etc/apps/test/bin/splunklib/searchcommands/decorators.py", line 85, in __call__
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:     o.ConfigurationSettings.fix_up(o)
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:   File "/opt/splunk/etc/apps/test/bin/splunklib/searchcommands/reporting_command.py", line 274, in fix_up
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:     ConfigurationSetting.fix_up(f.ConfigurationSettings, settings)
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:   File "/opt/splunk/etc/apps/test/bin/splunklib/searchcommands/decorators.py", line 159, in fix_up
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:     setting = setting.getter(fget(backing_field_name, value))
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:   File "/opt/splunk/etc/apps/test/bin/splunklib/searchcommands/decorators.py", line 127, in getter
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:     return self._copy_extra_attributes(property.getter(self, function))
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:   File "/opt/splunk/etc/apps/test/bin/splunklib/searchcommands/decorators.py", line 115, in __init__
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr:     property.__init__(self, fget=fget, fset=fset, fdel=fdel, doc=doc)
11-26-2019 07:49:39.192 ERROR ChunkedExternProcessor - stderr: RuntimeError: maximum recursion depth exceeded while calling a Python object
11-26-2019 07:49:39.198 ERROR ChunkedExternProcessor - EOF while attempting to read transport header
11-26-2019 07:49:39.198 ERROR ChunkedExternProcessor - Error in 'test' command: External search command exited unexpectedly with non-zero error code 1.

The error seems to come from splunklib.

Thanks

akaila-splunk commented 2 years ago

Hi @pablo-secu , We are not able to repro this issue on our end. We have used the latest version of SDK and Splunk enterprise.

Please share commands.conf details for the app. Also please try using the latest version of SDK and Splunk and let us know if the issue still persists.

ashah-splunk commented 2 years ago

@pablo-secu Closing this issue due to no response on it. Please reopen if this is still an issue.