{"record":{"id":"0cf3370dd3f532ca","repo":"golang/go","slug":"invalid-vcs-remote-s-s","errorCode":null,"errorMessage":"invalid vcs remote: %s %s","messagePattern":"invalid vcs remote: (.+?) (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/modfetch/codehost/vcs.go","lineNumber":119,"sourceCode":"\tcmd := vcsCmds[vcs]\n\tif cmd == nil {\n\t\treturn nil, fmt.Errorf(\"unknown vcs: %s %s\", vcs, remote)\n\t}\n\tr.cmd = cmd\n\tif local {\n\t\tinfo, err := os.Stat(remote)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !info.IsDir() {\n\t\t\treturn nil, fmt.Errorf(\"%s exists but is not a directory\", remote)\n\t\t}\n\t\tr.dir = remote\n\t\tr.mu.Path = r.dir + \".lock\"\n\t\treturn r, nil\n\t}\n\tif !strings.Contains(remote, \"://\") {\n\t\treturn nil, fmt.Errorf(\"invalid vcs remote: %s %s\", vcs, remote)\n\t}\n\tvar err error\n\tr.dir, r.mu.Path, err = WorkDir(ctx, vcsWorkDirType+vcs, r.remote)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif cmd.init == nil {\n\t\treturn r, nil\n\t}\n\n\tunlock, err := r.mu.Lock()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer unlock()\n\n\tif _, err := os.Stat(filepath.Join(r.dir, \".\"+vcs)); err != nil {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/modfetch/codehost/vcs.go#L101-L137","documentation":"In non-local mode, newVCSRepo requires the remote string to contain '://' so that WorkDir can treat it as a URL. A remote without a scheme separator (e.g. 'git@host:path', a bare path, or a misspelled URL) is rejected. The %s pair is the vcs name and the malformed remote.","triggerScenarios":"newVCSRepo with local==false and a remote string lacking '://' — typical with SCP-style ssh ('git@github.com:org/repo') or a relative path passed where an absolute URL was expected.","commonSituations":"A vanity go-import meta tag missing the scheme ('git.example.org/repo' instead of 'https://git.example.org/repo'); copy-pasted ssh alias syntax; a corrupted module cache record storing a bare path.","solutions":["Use a fully-qualified URL with scheme: https://, http://, ssh://, git://, file://.","Fix the go-import meta tag on the vanity server to emit the scheme.","For ssh remotes, expand SCP-style syntax to ssh://git@host/path before it reaches the go command.","If a local path is intended, use the local-mode (file://) or a replace directive instead."],"exampleFix":"<!-- before -->\n<meta name=\"go-import\" content=\"example.org/m mod git.example.org/m\">\n\n<!-- after -->\n<meta name=\"go-import\" content=\"example.org/m mod https://git.example.org/m\">","handlingStrategy":"validation","validationCode":"func remoteHasScheme(remote string) bool {\n    return strings.Contains(remote, \"://\")\n}\n\n// expand SCP-style ssh first if needed:\nfunc normaliseSSH(remote string) string {\n    if strings.HasPrefix(remote, \"git@\") && strings.Contains(remote, \":\") {\n        return \"ssh://\" + strings.Replace(remote, \":\", \"/\", 1)\n    }\n    return remote\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always emit a scheme in go-import meta tags.","Normalise SCP-style ssh remotes to ssh:// before passing to codehost.","Use replace directives rather than bare paths for local checkouts."],"tags":["vcs","url","vanity-import","configuration"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}