docker/cli ยท error

got wrong object to inspect :%v

Error message

got wrong object to inspect :%v

What it means

Error "got wrong object to inspect :%v" thrown in docker/cli.

Source

Thrown at cli/command/config/formatter.go:133

		return ""
	}
	return c.c.Spec.Annotations.Labels[name]
}

// inspectFormatWrite renders the context for a list of configs
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
	if fmtCtx.Format != configInspectPrettyTemplate {
		return inspect.Inspect(fmtCtx.Output, refs, string(fmtCtx.Format), getRef)
	}
	return fmtCtx.Write(&configInspectContext{}, func(format func(subContext formatter.SubContext) error) error {
		for _, ref := range refs {
			configI, _, err := getRef(ref)
			if err != nil {
				return err
			}
			config, ok := configI.(swarm.Config)
			if !ok {
				return fmt.Errorf("got wrong object to inspect :%v", ok)
			}
			if err := format(&configInspectContext{Config: config}); err != nil {
				return err
			}
		}
		return nil
	})
}

type configInspectContext struct {
	swarm.Config
	formatter.SubContext
}

func (ctx *configInspectContext) ID() string {
	return ctx.Config.ID
}

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cli/command/config/formatter.go:133 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/aa63bd497ef80cac.json. Report an issue: GitHub.