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

extend web ui not working since 2.22.0 #2629

Closed
2 tasks done
obriat opened this issue Mar 13, 2024 · 4 comments
Closed
2 tasks done

extend web ui not working since 2.22.0 #2629

obriat opened this issue Mar 13, 2024 · 4 comments
Labels

Comments

@obriat
Copy link

obriat commented Mar 13, 2024

Prerequisites

Description

Since 2.22.0 the extend web ui is not working with the new UI.

How to reproduce

git clone git@github.com:locustio/locust.git
git fetch 
git checkout tags/2.24.0 -b 2.24.0-branch
python3 -m venv .venv
source .venv/bin/activate
pip install locust flask
locust  -L DEBUG  -f examples/extend_web_ui/extend.py

Debug info

http://localhost:8089 => New UI ok
http://localhost:8089/extend =>KO: blank page with "Object of type Undefined is not JSON serializable" message

curl -v http://localhost:8089/extend
*   Trying 127.0.0.1:8089...
* Connected to localhost (127.0.0.1) port 8089 (#0)
> GET /extend HTTP/1.1
> Host: localhost:8089
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 INTERNAL SERVER ERROR
< Content-Type: text/html; charset=utf-8
< Content-Length: 49
< Access-Control-Allow-Origin: *
< Date: Wed, 13 Mar 2024 09:37:49 GMT
<
* Connection #0 to host localhost left intact
Object of type Undefined is not JSON serializable

logs :

CRITICAL/locust.web: Object of type Undefined is not JSON serializable

No stack trace or additional info. Same with "404 Not Found", it should return the missing path for debugging purpose

Command line

locust -f examples/extend_web_ui/extend.py

Locustfile contents

https://github.com/locustio/locust/tree/2.24.0/examples/extend_web_ui

Python version

Python 3.10.12

Locust version

locust 2.24.0

Operating system

WSL 2.1.5.0 (core 5.15.146.1-2), Windows : 10.0.19045.4046

@obriat obriat added the bug label Mar 13, 2024
@andrewbaldwin44
Copy link
Collaborator

andrewbaldwin44 commented Mar 13, 2024

Hi @obriat, as of Locust version 2.22.0, the modern UI is the new default for the web UI. If you want to view the legacy extend example you can view it with the --legacy-ui flag:

locust -f examples/extend_web_ui/extend.py --legacy-ui

The modern UI can equally be extended, see the extend_modern_web_ui.py example:

locust -f examples/extend_modern_web_ui.py

Please let us know if this fixes your issue

@obriat
Copy link
Author

obriat commented Mar 13, 2024

Sorry to have open this issue, but I posted a message on slack and I got no anwser :(

I missed the 2.22.0 changelog, but I think a note should be added into the doc, no?

@andrewbaldwin44
Copy link
Collaborator

Sorry about that, I missed your message on slack. Good idea to rename / add a comment so that it is clear one is for extending the legacy UI 👍

@obriat
Copy link
Author

obriat commented Mar 14, 2024

oh, also mark the "/examples/extend_web_ui" as deprecated

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

2 participants