{"record":{"id":"fae79ab4208f6377","repo":"gastownhall/beads","slug":"remote-name-too-long-max-64-characters","errorCode":null,"errorMessage":"remote name too long (max 64 characters)","messagePattern":"remote name too long \\(max 64 characters\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/remotecache/url.go","lineNumber":197,"sourceCode":"\t// Already matched gitSSHPattern, so structure is valid.\n\t// Extract host and verify no control chars (already checked above).\n\tatIdx := strings.Index(rawURL, \"@\")\n\tcolonIdx := strings.Index(rawURL[atIdx:], \":\")\n\tif atIdx < 0 || colonIdx < 0 {\n\t\treturn fmt.Errorf(\"SCP-style URL must be in user@host:path format\")\n\t}\n\treturn nil\n}\n\n// ValidateRemoteName checks that a remote name is safe for use as a Dolt\n// remote identifier. Names must start with a letter and contain only\n// alphanumeric characters, hyphens, and underscores. Max 64 characters.\nfunc ValidateRemoteName(name string) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"remote name cannot be empty\")\n\t}\n\tif len(name) > 64 {\n\t\treturn fmt.Errorf(\"remote name too long (max 64 characters)\")\n\t}\n\tif strings.HasPrefix(name, \"-\") {\n\t\treturn fmt.Errorf(\"remote name must not start with a dash\")\n\t}\n\tif !validRemoteNameRegex.MatchString(name) {\n\t\treturn fmt.Errorf(\"remote name must start with a letter and contain only alphanumeric characters, hyphens, and underscores\")\n\t}\n\treturn nil\n}\n\n// MatchesRemotePattern checks whether a URL matches a glob-style pattern.\n// Patterns use path.Match semantics (e.g., \"dolthub://myorg/*\").\nfunc MatchesRemotePattern(rawURL, pattern string) bool {\n\tmatched, err := path.Match(pattern, rawURL)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn matched","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/remotecache/url.go#L179-L215","documentation":"ValidateRemoteName caps remote names at 64 bytes because they are embedded into Dolt config paths and identifiers; longer names risk ambiguity and storage issues. The check is on byte length (len), so multibyte characters count more heavily.","triggerScenarios":"Calling ValidateRemoteName with a string longer than 64 characters, e.g. a full URL or org/repo path pasted into the name slot instead of a short identifier.","commonSituations":"Users pasting `https://dolthub.com/org/very-long-repo-name` as the remote name instead of the URL field; generated names from pipelines exceeding the cap.","solutions":["Shorten the name to 64 characters or fewer (e.g. use a short alias like 'origin').","Move the long value to the URL argument; the name should be a local alias only.","Note len() counts bytes — non-ASCII names hit the cap sooner; prefer ASCII names."],"exampleFix":"// before\nValidateRemoteName(\"https://dolthub.com/myorg/a-very-long-repository-name-that-exceeds-the-limit\")\n// after\nValidateRemoteName(\"origin\")","handlingStrategy":"validation","validationCode":"if len(name) > 64 {\n    return fmt.Errorf(\"remote name must be at most 64 characters\")\n}","typeGuard":null,"tryCatchPattern":"if err := remotecache.ValidateRemoteName(name); err != nil {\n    if strings.Contains(err.Error(), \"too long\") {\n        name = name[:64]\n    }\n    return err\n}","preventionTips":["Treat remote names as short aliases, never URLs or paths.","Truncate or hash long generated names before use.","Prefer ASCII names since the limit counts bytes."],"tags":["validation","remote","naming"],"backgroundTag":"invalid-remote-name","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}