newsapps / beeswithmachineguns

A utility for arming (creating) many bees (micro EC2 instances) to attack (load test) targets (web applications).
http://apps.chicagotribune.com/
MIT License
6.44k stars 632 forks source link

Type error returned when starting attack #218

Open joehep opened 6 years ago

joehep commented 6 years ago

I have built a Docker container using Ubuntu and am seeing the following error when I direct my bees to attack.

root@005e10755623:/data# bees attack -n 10000 -c 250 -u https://host.redacted.com/api
Read 5 bees from the roster: us-east-1a
Connecting to the hive.
Assembling bees.
Each of 5 bees will fire 2000 rounds, 50 at a time.
Stinging URL sequentially so it will be cached for the attack.
Organizing the swarm.
Bee 0 is joining the swarm.
Bee 1 is joining the swarm.
Bee 2 is joining the swarm.
Bee 3 is joining the swarm.
Bee 4 is joining the swarm.
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 "/usr/local/lib/python2.7/dist-packages/beeswithmachineguns/bees.py", line 801, in attack
    summarized_results = _summarize_results(results, params, csv_filename)
  File "/usr/local/lib/python2.7/dist-packages/beeswithmachineguns/bees.py", line 543, in _summarize_results
    complete_results = [r['complete_requests'] for r in summarized_results['complete_bees']]
TypeError: sequence index must be integer, not 'str'

I have tried this on my Mac, Centos, and Ubuntu. I have used several versions of Python - from 2.7.10 to 3.6.5 an each has given the same error.

BEARTRAPTHERAPPER commented 6 years ago

Try cms++ it should be better equiped for a multiple data transfer....

FayeGibbins commented 6 years ago

I'm seeing this too. +1 on getting a fix please

FayeGibbins commented 6 years ago

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.6/site-packages/beeswithmachineguns/bees.py", line 801, in attack summarized_results = _summarize_results(results, params, csv_filename) File "/usr/local/lib/python3.6/site-packages/beeswithmachineguns/bees.py", line 543, in _summarize_results complete_results = [r['complete_requests'] for r in summarized_results['complete_bees']] File "/usr/local/lib/python3.6/site-packages/beeswithmachineguns/bees.py", line 543, in complete_results = [r['complete_requests'] for r in summarized_results['complete_bees']] TypeError: 'gaierror' object is not subscriptable

mrblog commented 5 years ago

I've tried every version of Python available for Amazon Linux to get bees installed and every combination gets to a different point of progress, but ultimately fails with some Python error or another. I started with the default python2.7 then tried the latest available via yum, python 3.6. Then I tried python 2.6, and finally python 3.4, which is where I am now. I had to upgrade boto to 2.49.0 to even get it to authenticate. And now this TypeError: 'gaierror' object is not subscriptable error when trying to initiate the attack is where I am. Can anybody provide a set of versions of python, boto, and other dependencies that actually works on Amazon Linux? Perhaps I'll have better luck with Ubuntu?

mrblog commented 5 years ago

I get the same TypeError: 'gaierror' object is not subscriptable error with Python 3.6. The same on Amazon Linux and Ubuntu.

With Python 2.7 I get the error TypeError: sequence index must be integer, not 'str as above and that is on a new install of Ubuntu instead of Amazon Linux.

There must be a combination that works.

rene1983 commented 5 years ago

I get the same TypeError: 'gaierror' object is not subscriptable error with Python 3.6. The same on Amazon Linux and Ubuntu.

With Python 2.7 I get the error TypeError: sequence index must be integer, not 'str as above and that is on a new install of Ubuntu instead of Amazon Linux.

There must be a combination that works.

I get the same problem with latest Amazon Linux 2 / Python 2.6 and Ubuntu 18 / Python 2.7. Is this project dead?

RyanBeatty commented 5 years ago

I'm getting this error when running with the default ami that the tool chooses. Anybody have a workaround?

KishoreAllaparthi commented 5 years ago

Any workaround ?

rene1983 commented 5 years ago

this project is dead

KishoreAllaparthi commented 5 years ago

Are there any other alternatives to beeswithmachineguns?

bycEEE commented 3 years ago

A couple years late.

https://github.com/newsapps/beeswithmachineguns/blob/4b8783dc36d327ad95b711db39054d64bd718344/beeswithmachineguns/bees.py#L416

https://github.com/newsapps/beeswithmachineguns/blob/4b8783dc36d327ad95b711db39054d64bd718344/beeswithmachineguns/bees.py#L766

Paramiko tries to connect using eg. ip-10-10-120-230.ec2.internal. That doesn't resolve to anything for me locally, my workaround is editing:

'instance_name': instance.private_dns_name if instance.public_dns_name == "" else instance.public_dns_name,

to:

'instance_name': instance.private_ip_address,