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

Locust is not starting with pyzmq 23.0.0 #2099

Closed
marcinh opened this issue May 19, 2022 · 5 comments
Closed

Locust is not starting with pyzmq 23.0.0 #2099

marcinh opened this issue May 19, 2022 · 5 comments
Labels

Comments

@marcinh
Copy link
Contributor

marcinh commented May 19, 2022

Describe the bug

With latest ZMQ release (23.0.0) Locust stopped working - following error appears on Master:

locust-master: File "/root/.local/share/virtualenvs/locust-1T7N9san/bin/locust", line 8, in <module>
locust-master: sys.exit(main())
locust-master: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/main.py", line 230, in main
locust-master: runner = environment.create_master_runner(
locust-master: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/env.py", line 138, in create_master_runner
locust-master: return self._create_runner(
locust-master: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/env.py", line 116, in _create_runner
locust-master: self.runner = runner_class(self, *args, **kwargs)
locust-master: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/runners.py", line 619, in __init__
locust-master: self.server = rpc.Server(master_bind_host, master_bind_port)
locust-master: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/rpc/zmqrpc.py", line 58, in __init__
locust-master: BaseSocket.__init__(self, zmq.ROUTER)
locust-master: AttributeError: module 'zmq.green' has no attribute 'ROUTER'

and similar on worker:

locust-worker_four: Traceback (most recent call last):
locust-worker_four: File "/root/.local/share/virtualenvs/locust-1T7N9san/bin/locust", line 8, in <module>
locust-worker_four: sys.exit(main())
locust-worker_four: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/main.py", line 236, in main
locust-worker_four: runner = environment.create_worker_runner(options.master_host, options.master_port)
locust-worker_four: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/env.py", line 154, in create_worker_runner
locust-worker_four: return self._create_runner(
locust-worker_four: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/env.py", line 116, in _create_runner
locust-worker_four: self.runner = runner_class(self, *args, **kwargs)
locust-worker_four: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/runners.py", line 1051, in __init__
locust-worker_four: self.client = rpc.Client(master_host, master_port, self.client_id)
locust-worker_four: File "/root/.local/share/virtualenvs/locust-1T7N9san/lib/python3.9/site-packages/locust/rpc/zmqrpc.py", line 71, in __init__
locust-worker_four: BaseSocket.__init__(self, zmq.DEALER)
locust-worker_four: AttributeError: module 'zmq.green' has no attribute 'DEALER'

Expected behavior

Actual behavior

Steps to reproduce

Install Locust with inclusion of latest ZMQ release - start master o start worker

Environment

  • OS: CentOS
  • Python version: 3.9
  • Locust version: 2.8.4
  • Locust command line that you ran:
  • Locust file contents (anonymized if necessary):
@marcinh marcinh added the bug label May 19, 2022
@shyim
Copy link

shyim commented May 19, 2022

Lock the version and release a new version? 🤔
https://github.com/locustio/locust/blob/master/setup.cfg#L43

@shyim
Copy link

shyim commented May 19, 2022

added to my requirements.txt

pyzmq==22.3.0

and its working now 😅

@xorphitus
Copy link

PyZMQ 23.0.0 was released about 3 hours before this issue report. It moved the constants to enums and I think it's the cause.
https://github.com/zeromq/pyzmq/blob/main/docs/source/changelog.md#2300

Maybe this commit affected.

@walsm232
Copy link

This is also causing issues with my application when run in a Master / Worker mode. Needed to pin 22.3.0 to resolve it. The issue seems to be with pyzmq v.23.0.0

@cyberw cyberw closed this as completed in 92c9174 May 19, 2022
cyberw added a commit that referenced this issue May 19, 2022
xorphitus added a commit to xorphitus/terraform-aws-loadtest-distribuited that referenced this issue May 20, 2022
Older Locust involves a PyZMQ breaking change due to unlocked version.
Details: locustio/locust#2099
@FelipeMiranda
Copy link

FelipeMiranda commented May 26, 2022

Quick and Dirt fix for version 2.4.3 marcosborges/terraform-aws-loadtest-distribuited if don't wish to update to Locust 2.9.0

file: locust.entrypoint.leader.full.sh.tpl

...
# LOCUST
export LOCUST_VERSION="2.4.3"
sudo pip3 install locust==$LOCUST_VERSION
sudo pip3 uninstall pyzmq
sudo pip3 install pyzmq=="22.3.0"
...

file: locust.entrypoint.node.full.sh.tpl

...
# LOCUST
export LOCUST_VERSION="2.4.3"
sudo pip3 install locust==$LOCUST_VERSION
sudo pip3 uninstall pyzmq
sudo pip3 install pyzmq=="22.3.0"
...

marcosborges pushed a commit to marcosborges/terraform-aws-loadtest-distribuited that referenced this issue Jun 10, 2022
Older Locust involves a PyZMQ breaking change due to unlocked version.
Details: locustio/locust#2099
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants