Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda errors calling find_iocs #78

Open
fritterhoff opened this issue Jul 21, 2021 · 0 comments
Open

Lambda errors calling find_iocs #78

fritterhoff opened this issue Jul 21, 2021 · 0 comments
Labels
bug Something isn't working Extractor Extractor related issue
Milestone

Comments

@fritterhoff
Copy link
Collaborator

Calling the find_iocs method in the ioc extractor fails irregular due to unknown reasons and throws an exception <lambda>() missing 1 required positional argument: 'tokens' or <lambda>() missing 1 required positional argument: 'x'

According to the stacktrace both exceptions get caused by the ioc_finder and the pyparsing module. If the extractor is failing once he does not get into a stable state by himself - you must restart the complete microservice.

[-] ERROR: <lambda>() missing 1 required positional argument: 'tokens'   File "/app/iocextractor/core/server.py", line 178, in extract_ioc
    iocs = find_iocs(pdftext)
  File "/usr/local/lib/python3.9/site-packages/ioc_finder/ioc_finder.py", line 449, in find_iocs
    iocs['ipv4_cidrs'] = parse_ipv4_cidrs(text)
  File "/usr/local/lib/python3.9/site-packages/ioc_finder/ioc_finder.py", line 203, in parse_ipv4_cidrs
    cidrs = ioc_grammars.ipv4_cidr.searchString(text)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 2103, in searchString
    return ParseResults([t for t, s, e in self.scanString(instring, maxMatches)])
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 2103, in <listcomp>
    return ParseResults([t for t, s, e in self.scanString(instring, maxMatches)])
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 2007, in scanString
    nextLoc, tokens = parseFn(instring, preloc, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4069, in parseImpl
    loc, exprtokens = e._parse(instring, loc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4462, in parseImpl
    return self.expr._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, resultlist = self.exprs[0]._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4069, in parseImpl
    loc, exprtokens = e._parse(instring, loc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4462, in parseImpl
    return self.expr._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, resultlist = self.exprs[0]._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, resultlist = self.exprs[0]._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1716, in _parseNoCache
    tokens = fn(instring, tokensStart, retTokens)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 295, in pa
    if not bool(fn(s, l, t)):
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1316, in wrapper
    ret = func(*args[limit[0]:])
 - (Extractor: extract_ioc) - Thread ID: 139932517529344
[-] ERROR: <lambda>() missing 1 required positional argument: 'x'   File "/app/iocextractor/core/server.py", line 178, in extract_ioc
    iocs = find_iocs(pdftext)
  File "/usr/local/lib/python3.9/site-packages/ioc_finder/ioc_finder.py", line 449, in find_iocs
    iocs['ipv4_cidrs'] = parse_ipv4_cidrs(text)
  File "/usr/local/lib/python3.9/site-packages/ioc_finder/ioc_finder.py", line 203, in parse_ipv4_cidrs
    cidrs = ioc_grammars.ipv4_cidr.searchString(text)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 2103, in searchString
    return ParseResults([t for t, s, e in self.scanString(instring, maxMatches)])
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 2103, in <listcomp>
    return ParseResults([t for t, s, e in self.scanString(instring, maxMatches)])
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 2007, in scanString
    nextLoc, tokens = parseFn(instring, preloc, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4069, in parseImpl
    loc, exprtokens = e._parse(instring, loc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4462, in parseImpl
    return self.expr._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, resultlist = self.exprs[0]._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4069, in parseImpl
    loc, exprtokens = e._parse(instring, loc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4462, in parseImpl
    return self.expr._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, resultlist = self.exprs[0]._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1683, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, resultlist = self.exprs[0]._parse(instring, loc, doActions, callPreParse=False)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1716, in _parseNoCache
    tokens = fn(instring, tokensStart, retTokens)
  File "/usr/local/lib/python3.9/site-packages/pyparsing.py", line 1316, in wrapper
    ret = func(*args[limit[0]:])
 - (Extractor: extract_ioc) - Thread ID: 140165855049472
@fritterhoff fritterhoff added bug Something isn't working Extractor Extractor related issue labels Jul 21, 2021
@fritterhoff fritterhoff added this to the 0.1.2 milestone Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Extractor Extractor related issue
Projects
None yet
Development

No branches or pull requests

1 participant