slimtoolkit/slim · error
no target selected
Error message
no target selected
What it means
This error is thrown by the CLI pull command handler when no target image reference was supplied. The code checks cparams.TargetType and, if empty, requires at least one positional CLI argument; with zero args there is nothing to pull, so it prints 'missing pull target' and returns this error to abort the command.
Source
Thrown at pkg/app/master/command/registry/cli.go:246
cflag(FlagOCI),
},
Action: func(ctx *cli.Context) error {
gcvalues := command.GlobalFlagValues(ctx)
xc := app.NewExecutionContext(
fullCmdName(PushCmdName),
gcvalues.QuietCLIMode,
gcvalues.OutputFormat)
cparams, err := PushCommandFlagValues(ctx)
if err != nil {
xc.Out.Error("params", err.Error())
return err
}
if cparams.TargetType == "" {
if ctx.Args().Len() < 1 {
xc.Out.Error("params.target", "missing pull target")
return fmt.Errorf("no target selected")
}
cparams.TargetRef = ctx.Args().First()
cparams.TargetType = ttDocker
}
OnPushCommand(xc, gcvalues, cparams)
return nil
},
},
{
Name: CopyCmdName,
Usage: CopyCmdNameUsage,
Action: func(ctx *cli.Context) error {
gcvalues := command.GlobalFlagValues(ctx)
xc := app.NewExecutionContext(
fullCmdName(CopyCmdName),
gcvalues.QuietCLIMode,View on GitHub (pinned to 81940d17fa)
Solutions
- Pass the image reference as the first positional argument, e.g. 'registry pull nginx:latest'
- Set target parameters explicitly in the params/config if invoking programmatically
- Check the command usage/help (xc.Out.Error prints 'missing pull target') to confirm expected arguments
- Quote or default shell variables so an empty expansion doesn't drop the argument
Example fix
// before registry pull // after registry pull nginx:latest
Defensive patterns
Strategy: validation
Validate before calling
if len(args) == 0 {
return fmt.Errorf("usage: registry pull <image-ref>")
} Prevention
- Always pass the image reference as the first positional argument
- Validate CLI arguments in wrapper scripts before invoking the command
- Use shell parameter expansion with defaults: IMAGE_REF=${IMAGE_REF:?image ref required}
When it happens
Trigger: Running the registry pull command without a target argument (ctx.Args().Len() < 1) and without target type/ref already set in cparams, e.g. 'docker run ... registry pull' with no image name.
Common situations: Users forget the image argument in scripts or CI pipelines; shell variables holding the image name expand to empty; incorrect subcommand usage where the image is expected as a flag but was never passed.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- no image references for image index
- No global params
- podPort cannot be empty
- unknown sensor mode
- missing command
AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31).
Data as JSON: /api/errors/1fe5254ff83240ed.
Report an issue: GitHub.