Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

【Question】"Address family not supported by protocol" when start the test #556

Closed
walbx opened this issue Feb 28, 2017 · 4 comments
Closed

Comments

@walbx
Copy link

walbx commented Feb 28, 2017

Hi,the tool is awesome,but when I use it on Linux,I've come across some problems.
I think it caused by some config of hostname/ip,but I don't know how to fix it.

my environment: centos 6.5, python 2.7.12, locust 0.8a2。

when I run locust -f **.py, I got this:

[2017-02-28 18:39:42,930] vpc-25hpdepr6/INFO/locust.main: Starting web monitor at *:8089
[2017-02-28 18:39:42,931] vpc-25hpdepr6/INFO/locust.main: Starting Locust 0.8a2
[2017-02-28 18:39:42,933] vpc-25hpdepr6/ERROR/stderr: Traceback (most recent call last):
[2017-02-28 18:39:42,934] .vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/greenlet.py", line 536, in run
[2017-02-28 18:39:42,934] vpc-25hpdepr6/ERROR/stderr: result = self._run(*self.args, **self.kwargs)
[2017-02-28 18:39:42,934] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/locust/web.py", line 211, in start
[2017-02-28 18:39:42,934] .vpc-25hpdepr6/ERROR/stderr: wsgi.WSGIServer((options.web_host, options.port), app, log=None).serve_forever()
[2017-02-28 18:39:42,934] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/baseserver.py", line 360, in serve_forever
[2017-02-28 18:39:42,934] vpc-25hpdepr6/ERROR/stderr: self.start()
[2017-02-28 18:39:42,934] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/baseserver.py", line 304, in start
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: self.init_socket()
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 1451, in init_socket
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: StreamServer.init_socket(self)
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/server.py", line 127, in init_socket
[2017-02-28 18:39:42,935] .vpc-25hpdepr6/ERROR/stderr: self.socket = self.get_listener(self.address, self.backlog, self.family)
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/server.py", line 138, in get_listener
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
[2017-02-28 18:39:42,935] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/server.py", line 224, in _tcp_listener
[2017-02-28 18:39:42,936] vpc-25hpdepr6/ERROR/stderr: sock = socket(family=family)
[2017-02-28 18:39:42,936] vpc-25hpdepr6/ERROR/stderr: File "/usr/local/lib/python2.7/site-packages/gevent/_socket2.py", line 107, in __init__
[2017-02-28 18:39:42,936] vpc-25hpdepr6/ERROR/stderr: self._sock = _realsocket(family, type, proto)
[2017-02-28 18:39:42,936] vpc-25hpdepr6/ERROR/stderr: error: [Errno 97] **Address family not supported by protocol**
[2017-02-28 18:39:42,936]vpc-25hpdepr6/ERROR/stderr: Tue Feb 28 18:39:42 2017
[2017-02-28 18:39:42,936] vpc-25hpdepr6/ERROR/stderr: 
[2017-02-28 18:39:42,936] .vpc-25hpdepr6/ERROR/stderr: <Greenlet at 0x7f5627612a50: start([<class 'qs2.WebsiteUser'>], <Values at 0x7f5627589f38: {'locustfile': '/home/l)> failed with error
[2017-02-28 18:39:42,936] .vpc-25hpdepr6/INFO/locust.main: Shutting down (exit code 0), bye.
@heyman
Copy link
Member

heyman commented Feb 28, 2017

What happens if you try to specify the --web-host option manually?

You could try with:

locust --web-host=127.0.0.1
locust --web-host=0.0.0.0
locust --web-host=localhost

@walbx walbx changed the title Address family not supported by protocol 【Question】"Address family not supported by protocol" when start the test Feb 28, 2017
@walbx
Copy link
Author

walbx commented Feb 28, 2017

It's worked out very well, Many thanks!

@walbx walbx closed this as completed Feb 28, 2017
@zhukaisjtu
Copy link

zhukaisjtu commented Oct 27, 2019

Hi @heyman
Why does specify "--web-host" solve the problem?
When I deploy my code on minishift, everything works fine. When I deploy it on OpenShift in production, I face this Errno 97 problem. I followed your instructions to set --web-host=localhost or 127.0.0.1. With this specified, web ui doesn't work. However, web ui works for --web-host=0.0.0.0
Any reasons? Thanks!

@heyman
Copy link
Member

heyman commented Oct 27, 2019

@zhukaisjtu --web-host 127.0.0.1 makes the web UI only listen for connections from localhost, while setting it to 0.0.0.0 makes it listen to all interfaces. As to the original issue, I'm not really sure of the cause, but I'm guessing it's related to IPv6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants