docker/cli ยท error

fragments are not allowed: %q

Error message

fragments are not allowed: %q

What it means

Error "fragments are not allowed: %q" thrown in docker/cli.

Source

Thrown at cli/connhelper/ssh/ssh.go:67

	var sp Spec

	if u.User != nil {
		sp.User = u.User.Username()
		if _, ok := u.User.Password(); ok {
			return nil, errors.New("plain-text password is not supported")
		}
	}
	sp.Host = u.Hostname()
	if sp.Host == "" {
		return nil, errors.New("hostname is empty")
	}
	sp.Port = u.Port()
	sp.Path = u.Path
	if u.RawQuery != "" {
		return nil, fmt.Errorf("query parameters are not allowed: %q", u.RawQuery)
	}
	if u.Fragment != "" {
		return nil, fmt.Errorf("fragments are not allowed: %q", u.Fragment)
	}

	return &sp, nil
}

// Spec of SSH URL
type Spec struct {
	User string
	Host string
	Port string
	Path string
}

// Args returns args except "ssh" itself combined with optional additional
// command and args to be executed on the remote host. It attempts to quote
// the given arguments to account for ssh executing the remote command in a
// shell. It returns nil when unable to quote the remote command.
func (sp *Spec) Args(remoteCommandAndArgs ...string) []string {

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cli/connhelper/ssh/ssh.go:67 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/02cb2984ecab6958.json. Report an issue: GitHub.