Skip to content
New issue

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

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

Already on GitHub? # to your account

POST request is throwing errors. #178

Open
ghost opened this issue May 31, 2017 · 1 comment
Open

POST request is throwing errors. #178

ghost opened this issue May 31, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented May 31, 2017

Can you please share a sample post request.

Currently, I am using bees attack -n 10 -c 10 -XPOST -u 'http://sample/default.html' -K -P json -p sample.json and it is throwing

Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "build/bdist.linux-x86_64/egg/beeswithmachineguns/bees.py", line 764, in attack
_sting(param)
File "build/bdist.linux-x86_64/egg/beeswithmachineguns/bees.py", line 383, in _sting
response = urlopen(request)
File "/usr/local/lib/python2.7/dist-packages/future-0.16.0-py2.7.egg/future/backports/urllib/request.py", line 171, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/dist-packages/future-0.16.0-py2.7.egg/future/backports/urllib/request.py", line 500, in open
response = meth(req, response)
File "/usr/local/lib/python2.7/dist-packages/future-0.16.0-py2.7.egg/future/backports/urllib/request.py", line 612, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/dist-packages/future-0.16.0-py2.7.egg/future/backports/urllib/request.py", line 538, in error
return self._call_chain(*args)
File "/usr/local/lib/python2.7/dist-packages/future-0.16.0-py2.7.egg/future/backports/urllib/request.py", line 466, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/dist-packages/future-0.16.0-py2.7.egg/future/backports/urllib/request.py", line 620, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
HTTPError: HTTP Error 500: Internal Server Error

@FliesLikeABrick
Copy link
Contributor

@rajesh7221 the beeswithmachineguns code makes a call out to the target URI once per instance that is starting. This backtrace indicates that this call is receiving a 500 error from your server, which is an unhandled exception in the code.

This does not appear to be a BWMG issue, but your server is throwing 500 for some reason (admittedly, the code could handle this a bit more gracefully)

I will see about adding a patch to improve handling of HTTPError on this request, then this issue can be closed

FliesLikeABrick added a commit to FliesLikeABrick/beeswithmachineguns that referenced this issue Nov 28, 2017
… information printed for _sting request failures, and is a fatal error. Modified to be non-fatal, prints error to stderr. This is not ideal, urllib.errors does not seem to exist on python2, was unable to find a way to catch HTTPError or URLERror specifically, so had to go with overly-broad exception catching
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant