Skip to content

Dask worker CLI error message might be misleading #9094

Closed

Description

@guillaumeeb

Describe the issue:

Dask worker cli error message is not always helpful as it doesn't check for unknown options. 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.

Activity

  1. chirodip98 commented on Apr 5, 2026

    @chirodip98

    Can I take it up?

  2. crusaderky commented on May 1, 2026

    @crusaderky
    Collaborator

    Can I take it up?

    Please do.
    However please be aware of collisions with #9240.

  3. added
    p1
    p3
    enhancement
    good first issue
    and removed
    p1
    on May 1, 2026
  4. ernestprovo23 commented on May 28, 2026

    @ernestprovo23
    Contributor

    hey — happy to pick this up if chirodip98 hasn't started. saw the note about the #9240 collision and that's merged now, so the path looks clear.

    quick check first: with --nprocs gone post-#9240, the original MCVE probably hits click's NoSuchOption path directly. i'll repro on main, then tighten the fallback UsageError in validate_preload_argv to point users at --help and explain the preload-argv ordering rule. small PR with a couple cli tests.

    flagging in case anyone has context i'm missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuep3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions