question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

command line options parsed incorrectly

See original GitHub issue

Describe the bug

I’m trying to use following docker-compose file to run headless mode locust, but every time i ran i got error: /ERROR/locust.main: Unknown User(s). It used to work when i using docker-compose file in the docs(https://docs.locust.io/en/stable/running-in-docker.html?#docker-compose)

version: '3'

services:
  master:
    image: locustio/locust
    ports:
     - "8089:8089"
    volumes:
      - /home/load-test/locust:/mnt/locust
    command: -f /mnt/locust/${LOCUST_FILE} \
             -H ${LOAD_HOST} \
             --headless \
             --users 1000 \
             --spawn-rate 10 \ 
             --run-time 30m \
             --master \
             --html /mnt/locust/${NODE}.html \
             --stop-timeout 99 \
             ${NODE}

  worker:
    image: locustio/locust
    volumes:
      - /home/load-test/locust:/mnt/locust
    command: -f /mnt/locust/${LOCUST_FILE} --worker --master-host master

Expected behavior

Running correctly

Actual behavior

/ERROR/locust.main: Unknown User(s):  --run-time,  --headless,  --stop-timeout,  --spawn-rate,  Test_node,  -H, 30m, /mnt/locust/Test_node.html, 10,  --master,  --users,  --html, 99, 1000, http://localhost:7554

The order of options is different every time i ran:

/ERROR/locust.main: Unknown User(s): 99, http://localhost:7554, 30m,  --stop-timeout,  --html,  --spawn-rate,  Test_node,  --headless,  --users,  -H,  --master, 10, /mnt/locust/Test_node.html,  --run-time, 1000

Steps to reproduce

Using abovedocker-compose file with this cmd: LOCUST_FILE=locustfile.py LOAD_HOST=http://localhost:7554 NODE=Test_node docker-compose up

Environment

  • OS: Linux version 5.4.0-109-generic (buildd@ubuntu) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1))
  • Python version: Python 3.9.13
  • Locust version: locust 2.11.1
  • Locust command line that you ran:
  • Locust file contents (anonymized if necessary):

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mikenestercommented, Sep 21, 2022

What I’m thinking could be a fix here is, in docker-compose.yml, instead of this:

services:
  master:
    image: locustio/locust
    ports:
     - "8089:8089"
    volumes:
      - /home/load-test/locust:/mnt/locust
    command: -f /mnt/locust/${LOCUST_FILE} \
             -H ${LOAD_HOST} \
             --headless \
             --users 1000 \
             --spawn-rate 10 \ 
             --run-time 30m \
             --master \
             --html /mnt/locust/${NODE}.html \
             --stop-timeout 99 \
             ${NODE}

try:

services:
  master:
    image: locustio/locust
    ports:
     - "8089:8089"
    volumes:
      - /home/load-test/locust:/mnt/locust
    command: -f /mnt/locust/${LOCUST_FILE} -H ${LOAD_HOST} --headless --users 1000 --spawn-rate 10 --run-time 30m --master --html /mnt/locust/${NODE}.html --stop-timeout 99 ${NODE}
0reactions
github-actions[bot]commented, Oct 25, 2022

This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!

Read more comments on GitHub >

github_iconTop Results From Across the Web

command line arguments given to a C# program are parsed ...
I created a little batch file that would display the command line parameters. With your first command line, I get 1 -p 2...
Read more >
How to parse a command line with an an invalid parameter #315
I want to parse command line but with the possibility of providing an incorrect parameter. I tried for example: Parser.Default.
Read more >
Error parsing the command-line arguments - TeraByte Unlimited
yes, it's normal. When you pass the parameters from the command prompt the \" will escape the " to be a " and...
Read more >
How Command Line Parameters Are Parsed - David Deley
The parameter parsing rules are determined by cmd.exe which processes the batch file. The parameter parsing rules are determined by WScript.exe which processes ......
Read more >
Update-name "Problem Parsing the Command Line Arguments"
It is saying that --update-name is an unused command line option as if it had a syntax error. Would the version of Plink...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found