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

slave run in docker didn't work. #784

Closed
ityoung opened this issue Apr 26, 2018 · 3 comments
Closed

slave run in docker didn't work. #784

ityoung opened this issue Apr 26, 2018 · 3 comments

Comments

@ityoung
Copy link

ityoung commented Apr 26, 2018

Description of issue

slave run in docker seems not work.

I start a master on my host, and then start a slave node in docker container, then the master print the error message below.

If I run slave node at the host master runs, then it works perfectly.

On master:

locust --master --host=http://192.168.3.158

On slave:

locust --slave --master-host=192.168.0.29

192.168.3.158: server I want to test;
192.168.0.29: my pc

Error message I got:

root@yangxin-PC:~/PycharmProjects/gt-performance-test/tests# locust --master --host=http://192.168.3.158
[2018-04-26 15:38:25,323] yangxin-PC/INFO/locust.main: Starting web monitor at *:8089
[2018-04-26 15:38:25,323] yangxin-PC/INFO/locust.main: Starting Locust 0.8.1
[2018-04-26 15:38:25,344] yangxin-PC/INFO/locust.runners: Client '65dce4343730_6092c759726eb4540ca9fe9c8a14c829' reported as ready. Currently 1 clients ready to swarm.
[2018-04-26 15:38:25,345] yangxin-PC/ERROR/stderr: Traceback (most recent call last):
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: File "/usr/local/lib/python3.5/dist-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: File "/usr/local/lib/python3.5/dist-packages/locustio-0.8.1-py3.5.egg/locust/runners.py", line 332, in client_listener
    events.slave_report.fire(client_id=msg.node_id, data=msg.data)
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: File "/usr/local/lib/python3.5/dist-packages/locustio-0.8.1-py3.5.egg/locust/events.py", line 34, in fire
    handler(**kwargs)
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: File "/usr/local/lib/python3.5/dist-packages/locustio-0.8.1-py3.5.egg/locust/stats.py", line 587, in on_slave_report
    global_stats.total.extend(StatsEntry.unserialize(data["stats_total"]))
[2018-04-26 15:38:25,346] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,347] yangxin-PC/ERROR/stderr: KeyError: 'stats_total'
[2018-04-26 15:38:25,347] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,347] yangxin-PC/ERROR/stderr: Thu Apr 26 15:38:25 2018
[2018-04-26 15:38:25,347] yangxin-PC/ERROR/stderr: 
[2018-04-26 15:38:25,347] yangxin-PC/ERROR/stderr: <Greenlet at 0x7f4cc4a9cd58: <bound method MasterLocustRunner.client_listener of <locust.runners.MasterLocustRunner object at 0x7f4cc4a729b0>>> failed with KeyError
@robooo
Copy link

robooo commented Apr 26, 2018

I get similar error when I was running not same versions of locust on master and slave (0.8 and 0.8.1)
Check if you have same versions, and be aware
pip install locustio -> 0.8.1
pip install locust -> 0.8

@ityoung
Copy link
Author

ityoung commented Apr 27, 2018

@robooo thanks, but I check the version, and they are all 0.8.1.

When I run master on docker container, I can fetch it through web-UI on my host's browser. Did I need to map some port to make host fetch container?

@ityoung
Copy link
Author

ityoung commented Apr 27, 2018

@robooo oh my... I get into container, clean all about locust in site-packages, and reinstall locust with source code, now it works perfectly!

I have no idea why I seemed installing a error one, I'm using

pip install locustio==0.8.1

and when container started, it says Starting Locust 0.8.1

I will close this issue. Many thanks!

@ityoung ityoung closed this as completed Apr 27, 2018
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

2 participants