docker/cli ยท error

source is required

Error message

source is required

What it means

Error "source is required" thrown in docker/cli.

Source

Thrown at opts/swarmopts/config.go:72

			options.File.Name = val
		case "uid":
			options.File.UID = val
		case "gid":
			options.File.GID = val
		case "mode":
			m, err := strconv.ParseUint(val, 0, 32)
			if err != nil {
				return fmt.Errorf("invalid mode specified: %v", err)
			}

			options.File.Mode = os.FileMode(m)
		default:
			return fmt.Errorf("invalid field in config request: %s", key)
		}
	}

	if options.ConfigName == "" {
		return errors.New("source is required")
	}
	if options.File.Name == "" {
		options.File.Name = options.ConfigName
	}

	o.values = append(o.values, options)
	return nil
}

// Type returns the type of this option
func (*ConfigOpt) Type() string {
	return "config"
}

// String returns a string repr of this option
func (o *ConfigOpt) String() string {
	configs := make([]string, 0, len(o.values))
	for _, config := range o.values {

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at opts/swarmopts/config.go:72 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/b50c47268cb1585d.json. Report an issue: GitHub.