nccgroup / Scout2

Security auditing tool for AWS environments
http://nccgroup.github.io/Scout2/
GNU General Public License v2.0
1.73k stars 300 forks source link

Error: can't start new thread #185

Closed SirGerbs closed 7 years ago

SirGerbs commented 7 years ago

I ran into the "can't start new thread" error. Output provided below. I uninstalled scout2 v3.0.3 and installed v3.0.1, which resolved the issue. Ran the tool on Windows 7 x64 with 16GB of RAM. Let me know if you need any other information.

Connecting to AWS emr in us-east-1...
Connecting to AWS emr in us-east-2...
Connecting to AWS emr in us-west-1...
Connecting to AWS emr in us-west-2...
               14/14                0/0
Fetching ElastiCache config...
             regions           clusters    security_groups
Error: could not fetch elasticache configuration.
can't start new thread
Fetching Route53 config...
Connecting to AWS route53...
Error: could not fetch route53 configuration.
can't start new thread
Fetching SNS config...
             regions             topics      subscriptions
Error: could not fetch sns configuration.
can't start new thread
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\scripts\Scout2.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\AWSScout2\__main__.py", line 67, in main
    aws_config = report.jsrw.to_dict(aws_config)
  File "c:\python27\lib\site-packages\AWSScout2\output\js.py", line 65, in to_di
ct
    return json.loads(json.dumps(config, separators=(',', ': '), cls=Scout2Encod
er))
  File "c:\python27\lib\json\__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "c:\python27\lib\json\encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "c:\python27\lib\json\encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
MemoryError
l01cd3v commented 7 years ago

How many logical processors does your computer have? I need to look into a way to either automatically lower the number of threads or add an argument...

SirGerbs commented 7 years ago

It's got 4 logical processors.

l01cd3v commented 7 years ago

I just implemented a feature that allow choosing the amount of threading that happens : add --thread-config [1-5], with 1 being the least threads and 5 the most. I think that using a value of 1 or 2 should help with this issue.

l01cd3v commented 7 years ago

The code is only in the dev branch for now