slimtoolkit/slim · error

no image references for image index

Error message

no image references for image index

What it means

OnImageIndexCreateCommand validates that at least one image reference was provided for building an image index (fat manifest). If cparams.ImageNames is empty, xc.FailOn aborts with this error because an index with no constituent images is meaningless.

Source

Thrown at pkg/app/master/command/registry/handler_image_index.go:75

			})

		exitCode := command.ECTCommon | command.ECCNoDockerConnectInfo
		xc.Out.State("exited",
			ovars{
				"exit.code": exitCode,
				"version":   v.Current(),
				"location":  fsutil.ExeDir(),
			})
		xc.Exit(exitCode)
	}
	xc.FailOn(err)

	if gparams.Debug {
		version.Print(xc, cmdName, logger, client, false, gparams.InContainer, gparams.IsDSImage)
	}

	if len(cparams.ImageNames) == 0 {
		xc.FailOn(fmt.Errorf("no image references for image index"))
	}

	if !cparams.UseDockerCreds &&
		!(cparams.CredsAccount != "" && cparams.CredsSecret != "") {
		xc.FailOn(fmt.Errorf("missing auth params"))
	}

	remoteOpts := []remote.Option{
		remote.WithContext(context.Background()),
	}

	remoteOpts, err = ConfigureAuth(cparams.CommonCommandParams, remoteOpts)
	xc.FailOn(err)

	nameOpts := []name.Option{
		name.WeakValidation,
	}

View on GitHub (pinned to 81940d17fa)

Solutions

  1. Pass one or more image references as arguments to the index create command
  2. Populate cparams.ImageNames with valid references before calling OnImageIndexCreateCommand
  3. Verify argument parsing (flags vs positionals) isn't swallowing the image names

Example fix

// before
ImageNames: []string{}
// after
ImageNames: []string{"registry.example.com/app:v1-amd64", "registry.example.com/app:v1-arm64"}
Defensive patterns

Strategy: validation

Validate before calling

if len(ImageNames) == 0 {
    return errors.New("at least one image reference is required to create an index")
}

Prevention

When it happens

Trigger: Calling the image-index create command without any image name arguments or with cparams.ImageNames left as an empty slice when invoking the handler programmatically.

Common situations: Forgetting to pass the individual image tags before the index name; a parsing bug that fails to populate ImageNames; config file where the images list is empty or misnamed.

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


AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31). Data as JSON: /api/errors/51e6f3c624c09818. Report an issue: GitHub.