docker/cli ยท error

something went wrong decoding auth config

Error message

something went wrong decoding auth config

What it means

Error "something went wrong decoding auth config" thrown in docker/cli.

Source

Thrown at cli/config/configfile/file.go:310

	base64.StdEncoding.Encode(encoded, msg)
	return string(encoded)
}

// decodeAuth decodes a base64 encoded string and returns username and password
func decodeAuth(authStr string) (string, string, error) {
	if authStr == "" {
		return "", "", nil
	}

	decLen := base64.StdEncoding.DecodedLen(len(authStr))
	decoded := make([]byte, decLen)
	authByte := []byte(authStr)
	n, err := base64.StdEncoding.Decode(decoded, authByte)
	if err != nil {
		return "", "", err
	}
	if n > decLen {
		return "", "", errors.New("something went wrong decoding auth config")
	}
	userName, password, ok := strings.Cut(string(decoded), ":")
	if !ok || userName == "" {
		return "", "", errors.New("invalid auth configuration file")
	}
	return userName, strings.Trim(password, "\x00"), nil
}

// GetCredentialsStore returns a new credentials store from the settings in the
// configuration file
func (c *ConfigFile) GetCredentialsStore(registryHostname string) credentials.Store {
	store := credentials.NewFileStore(c)

	if helper := getConfiguredCredentialStore(c, getAuthConfigKey(registryHostname)); helper != "" {
		store = newNativeStore(c, helper)
	}

	envConfig := os.Getenv(DockerEnvConfigKey)

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cli/config/configfile/file.go:310 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/956b0635ea9c4b0f.json. Report an issue: GitHub.