sar49
June 16, 2025, 12:06pm
1
I get the following error when having a dask command in a SLURM script. The following is the script section that is erroring and the corresponding error. I am not sure how to continue.
dask worker --scheduler-file “$SCHED_FILE” --nprocs 1 --nthreads 32 --memory-limit auto --interface ib0
Usage: dask worker [OPTIONS] [SCHEDULER] [PRELOAD_ARGV]…
Try ‘dask worker -h’ for help.
Error: Got unexpected extra argument: (1)
Hi @sar49 , welcome to Dask community!
I think the problem comes from --nprocs
which doesn’t exist anymore. Could you try the command by replacing it with --nworkers
?
But I have to admit there is also probably a problem in the error message, I’ll try to look at that too!
I ended up creating an issue, because I’m not sure how to best handle this case.
opened 12:49PM - 20 Jun 25 UTC
needs triage
**Describe the issue**:
Dask worker cli error message is not always helpful as[… it doesn't check for unknown options](https://github.com/dask/distributed/blob/main/distributed/cli/dask_worker.py#L40). It might be hard to understand what is wrong. (See discussion in https://dask.discourse.group/t/unexpected-dask-argument/3979).
**Minimal Complete Verifiable Example**:
```
dask worker --scheduler-file random_file --nprocs 1
```
outputs:
```
Usage: dask worker [OPTIONS] [SCHEDULER] [PRELOAD_ARGV]…
Try ‘dask worker -h’ for help.
Error: Got unexpected extra argument: (1)
```
Which is true: `1` is an argument, but in this case, a user wants to know that `--nprocs` is not a valid option.
**Anything else we need to know?**:
This is probably due to the need to have a `preload` free argv in the `dask worker` command. So options are not enforced in click.
I'd be happy to help, but I'm not a click expert and I'm not sure of the side effects of enabling options checking.