{"record":{"id":"38e60d38d5543c0e","repo":"amir20/dozzle","slug":"invalid-scheme-s","errorCode":null,"errorMessage":"invalid scheme: %s","messagePattern":"invalid scheme: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/docker/client.go","lineNumber":119,"sourceCode":"\t}\n\tinfo := infoResult.Info\n\n\thost := container.Host{\n\t\tName:     info.Name,\n\t\tEndpoint: \"local\",\n\t\tType:     \"local\",\n\t}\n\n\tif hostname != \"\" {\n\t\thost.Name = hostname\n\t}\n\n\treturn NewClient(cli, host), nil\n}\n\nfunc NewRemoteClient(host container.Host) (*DockerClient, error) {\n\tif host.URL.Scheme != \"tcp\" {\n\t\treturn nil, fmt.Errorf(\"invalid scheme: %s\", host.URL.Scheme)\n\t}\n\n\topts := []client.Opt{\n\t\tclient.WithHost(host.URL.String()),\n\t}\n\n\tif host.ValidCerts {\n\t\tlog.Debug().Str(\"caCertPath\", host.CACertPath).Str(\"certPath\", host.CertPath).Str(\"keyPath\", host.KeyPath).Msg(\"Using TLS for remote client\")\n\t\topts = append(opts, client.WithTLSClientConfig(host.CACertPath, host.CertPath, host.KeyPath))\n\t} else {\n\t\tlog.Debug().Msg(\"Not using TLS for remote client\")\n\t}\n\n\topts = append(opts, client.WithUserAgent(\"Docker-Client/Dozzle\"))\n\n\tcli, err := client.New(opts...)\n\n\tif err != nil {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/docker/client.go#L101-L137","documentation":"NewRemoteClient validates that the remote host URL uses the 'tcp' scheme before constructing a Docker API client. Docker's remote API client only speaks tcp:// (with tls:// handled via options). Any other scheme in container.Host.URL means the host entry is malformed for remote connections.","triggerScenarios":"Calling NewRemoteClient (via CreateMultiHostService) with a container.Host whose URL.Scheme is not \"tcp\", e.g. a host configured as \"unix:///var/run/docker.sock\", \"http://host:2375\", or a typo like \"tcpp://host:2375\".","commonSituations":"Users put a unix socket path in a remote host definition in dozzle config/env, copy an HTTP URL from browser tooling, or misconfigure DOZZLE_REMOTE_HOST entries with the wrong scheme prefix.","solutions":["Change the remote host URL scheme to tcp, e.g. tcp://192.168.1.10:2375","If you intended a local socket, do not add it as a remote host; local unix sockets are handled by the default client","Validate host entries before passing them to CreateMultiHostService"],"exampleFix":"// before\nhosts := []container.Host{{Name: \"node1\", URL: mustParse(\"unix:///var/run/docker.sock\")}}\nsvc, err := docker.NewRemoteClient(host)\n// after\nhosts := []container.Host{{Name: \"node1\", URL: mustParse(\"tcp://192.168.1.10:2375\")}}\nsvc, err := docker.NewRemoteClient(host)","handlingStrategy":"validation","validationCode":"u, err := url.Parse(hostURL)\nif err != nil || u.Scheme != \"tcp\" {\n    return fmt.Errorf(\"remote host must use tcp:// scheme, got %q\", hostURL)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write remote host URLs as tcp://host:2375","Use unix sockets only for the local daemon, never in remote host entries","Document the accepted scheme in config templates"],"tags":["docker","remote-host","url-scheme","configuration"],"backgroundTag":"invalid-url-format","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}