hotnops / apeman

AWS Attack Path Management Tool - Walking on the Moon
BSD 3-Clause "New" or "Revised" License
220 stars 9 forks source link

MacOS: errors when running init.aws_initialize and docker-compose #13

Closed christophetd closed 2 months ago

christophetd commented 3 months ago

After following the instructions and running this from the utils/ directory:

python -m init.aws_initialize -o ../import

I'm getting these errors:

Traceback (most recent call last):
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/christophe.tafanidereeper/go/src/github.com/DataDog/apeman/utils/init/aws_initialize.py", line 452, in <module>
    aws_initialize(args.output_directory)
  File "/Users/christophe.tafanidereeper/go/src/github.com/DataDog/apeman/utils/init/aws_initialize.py", line 394, in aws_initialize
    aws_schema = get_all_services_html(services_json)
  File "/Users/christophe.tafanidereeper/go/src/github.com/DataDog/apeman/utils/init/aws_initialize.py", line 143, in get_all_services_html
    p.start()
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
    return Popen(process_obj)
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 58, in _launch
    self.pid = util.spawnv_passfds(spawn.get_executable(),
  File "/Users/christophe.tafanidereeper/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/util.py", line 450, in spawnv_passfds
    errpipe_read, errpipe_write = os.pipe()
OSError: [Errno 24] Too many open files

On the docker-compose file I'm getting:

neo4j-1            | Warning: Folder mounted to "/data" is not writable from inside container. Changing folder owner to neo4j.
neo4j-1            | Installing Plugin 'apoc' from /var/lib/neo4j/labs/apoc-*-core.jar to /var/lib/neo4j/plugins/apoc.jar
neo4j-1            | Applying default values for plugin apoc to neo4j.conf
neo4j-1 exited with code 137
hotnops commented 3 months ago

Thanks for being the first issue! I have a fix and will commit once I have tested it.

teamhanded commented 2 months ago

ulimit -n 30000 temporarily fixes this for me.

hotnops commented 2 months ago

I don't have a macbook to test with but it should be fixed.