Closed lllama closed 4 years ago
Same issue on Linux Kali
Same on Ubuntu:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/j4v/Git/aws-inventory/aws_inventory/invoker.py", line 97, in _probe_services
num_threads=config.MAX_THREADS)
File "/home/j4v/Git/aws-inventory/aws_inventory/invoker.py", line 188, in thread_work
worker.start()
File "/usr/lib/python2.7/threading.py", line 736, in start
_start_new_thread(self.__bootstrap, ())
error: can't start new thread
Use Ubuntu Desktop
@chilithomas I've run it in Ubuntu but the issue is with python. @bitsandsalsa have you had the time to look into this? For my part it's a blocker.
Ran into this on MacOS Sierra as well
We use a pool of worker threads to call APIs for a given service in a region. The threads were never stopping because they did not know when they were done. The result would be too many threads or too many open connections for the process.
Command with branch in shell
~/gitProjects/aws-inventory/ develop$: python aws_inventory.py --profile MYPROFILE
.
.
.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/Users/37272/gitProjects/aws-inventory/aws_inventory/invoker.py", line 97, in _probe_services
num_threads=config.MAX_THREADS)
File "/Users/37272/gitProjects/aws-inventory/aws_inventory/invoker.py", line 188, in thread_work
worker.start()
File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 736, in start
_start_new_thread(self.__bootstrap, ())
error: can't start new thread
From my testing with the develop branch. Let me know if there's any logs I can send over
I'm having trouble reproducing this. In a Windows 10 VM, I could hit it when I get to around 100,000 threads (as reported by threading.active_acount()
) if I force a worker pool of around 10,000 threads and wait a few services, but even if somehow your system was creating a thread per API call or even a whole worker pool per API, I don't see how you could hit that many threads. This assumes you are using the default operation blacklist.
Try setting the MAX_THREADS
variable in config.py to 1. I am not sure if the bug is caused by something in your AWS account or your execution environment.
--debug
commandline option and add some of that output here.MAX_THREADS
: I'd be happy to try that out
After removing my directory and recloning for specifically the develop branch, my run did complete. I apologize about the incorrect report
Thanks for working through this. @j4v @inquisb @lllama I think the bug may be fixed. If you have a chance, see if this works for you too.
Cleaning out issues. It looks like this was already resolved, so I'm closing this. Thank you for your contribution.
This is under Windows. Runs for a bit and then errors. I've adjusted the number of threads (even down to 1) and still run into it. I'll dig into it a little more and update this issue if I find anything else.