Error message "environment is not allowed to be empty" when trying to report results from locust load test #320
Replies: 3 comments 11 replies
-
Hi @afaderoTextNow ! |
Beta Was this translation helpful? Give feedback.
-
@ludeknovy QQ - in the docker-compose file there are 2 JWT environment variables, |
Beta Was this translation helpful? Give feedback.
-
@ludeknovy QQ - My locust load tests are organized in different files in terms of function areas and I added listeners at the end of each of the files which have different scenarios. I have the ability to run individual tests and what I'm seeing is that my tests are being reported to the incorrect scenario or should I say the last scenario listed (see logs below). In this case I'm running the user_profiles tests but it's reporting to the user_sessions [2025-05-29 12:19:45,608] TN00939/INFO/locust.main: Starting Locust 2.37.6
[2025-05-29 12:19:45,609] TN00939/INFO/locust.main: Starting web interface at http://0.0.0.0:8089, press enter to open your default browser.
scenario_name user_sessions
scenario_name messaging
scenario_name user_profiles
[2025-05-29 12:19:45,617] TN00939/INFO/locust.main: Locust is running with the UserClass Picker Enabled |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there, first of all thank you for providing this awesome tool. I'm trying to set it up for continuous uploading using the
jtl_listener_service.py
and then adding the listener to my load test by adding the following snippet to my testfrom jtl_listener_service import JtlListener @events.init.add_listener def on_locust_init(environment, **_kwargs): JtlListener(env=environment, project_name="project name", scenario_name="scenario name", hostname="hostname", backend_url="http://IP_ADDRESS")
.Issue I'm having is that I getting this error when I try to run my locust load test, which I think is being triggered by this line
payload = {"environment": self.env.host}
injtl_listener_service.py
[2025-05-13 17:41:31,456] TN00939/INFO/root: Logging with token [2025-05-13 17:41:31,589] TN00939/INFO/root: Login with token returned {'jwtToken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI0ZTkwMWExMS04MzdkLTRmMDgtYmUxYi1lZmE2NGI3OGE5MzYiLCJpYXQiOjE3NDcxNzI0OTEsImV4cCI6MTc0NzM0NTI5MX0.HE0-ORV7HXqYc1WXKVF2BemZQxWH-CDi1BBjafExCTk'} [2025-05-13 17:41:31,589] TN00939/INFO/root: Starting async item in Reporter [2025-05-13 17:41:31,607] TN00939/INFO/root: Reporter responded with {'message': '"environment" is not allowed to be empty'} [2025-05-13 17:41:31,607] TN00939/ERROR/root: Error while starting the test [2025-05-13 17:41:31,608] TN00939/INFO/locust.runners: sys.exit(1) called (use log level DEBUG for callstack)
.I started up my test environment using the docker-compose file and when I check the logs for
jtl_reporter_be
I have the following logs as well{"level":"info","message":"Express server listening on port 5000","timestamp":"2025-05-13 21:40:40"} {"level":"info","message":"Bree scheduler was started","timestamp":"2025-05-13 21:40:40"} {"level":"info","message":"By using this app you agree with the use of analytics in this app to help improve user experience and the overall functionality of the app.","timestamp":"2025-05-13 21:40:40"} {"level":"info","message":"POST /api/auth/login-with-token 200 52ms","meta":{}} {"level":"debug","message":"User 4e901a11-837d-4f08-be1b-efa64b78a936 with role admin accessing a resource with allowed roles: operator,admin","timestamp":"2025-05-13 21:41:31"} {"data":null,"isBoom":true,"isServer":false,"level":"error","output":{"headers":{},"payload":{"error":"Bad Request","message":"\"environment\" is not allowed to be empty","statusCode":400},"statusCode":400},"timestamp":"2025-05-13 21:41:31"} {"level":"info","message":"POST /api/projects/local_load_tests/scenarios/send_text_message/items/start-async 400 5ms","meta":{}} Worker for job "analytics-report" online undefined Worker for job "analytics-report" exited with code 0 undefined
I've checked the documentation and I'm not sure what I'm missing and any help you can provide will be greatly appreciated. Tx
Beta Was this translation helpful? Give feedback.
All reactions