{"record":{"id":"a5f4b0e7a6f54bfd","repo":"fatedier/frp","slug":"s-is-too-long-length-d-exceeds-maximum-d","errorCode":null,"errorMessage":"%s is too long: length %d exceeds maximum %d","messagePattern":"(.+?) is too long: length (.+?) exceeds maximum (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/name.go","lineNumber":33,"sourceCode":"package validation\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nconst (\n\t// MaxRunIDLength is the maximum number of bytes accepted for a control run ID.\n\tMaxRunIDLength = 64\n)\n\nfunc validateIdentifier(value, kind string, maxLength int) error {\n\tif value == \"\" {\n\t\treturn fmt.Errorf(\"%s cannot be empty\", kind)\n\t}\n\tif len(value) > maxLength {\n\t\treturn fmt.Errorf(\"%s is too long: length %d exceeds maximum %d\", kind, len(value), maxLength)\n\t}\n\tif !utf8.ValidString(value) {\n\t\treturn fmt.Errorf(\"%s must be valid UTF-8\", kind)\n\t}\n\tfor _, r := range value {\n\t\tif !unicode.IsPrint(r) {\n\t\t\treturn fmt.Errorf(\"%s contains non-printable character\", kind)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc ValidateRunID(runID string) error {\n\treturn validateIdentifier(runID, \"run id\", MaxRunIDLength)\n}\n","sourceCodeStart":15,"sourceCodeEnd":49,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/name.go#L15-L49","documentation":"The identifier (e.g. run ID, capped at MaxRunIDLength = 64 bytes) exceeds its byte-length limit. Length is measured in bytes via len(), not runes, so multi-byte UTF-8 content hits the cap faster. This guard prevents unbounded identifiers from bloating control-plane state and messages.","triggerScenarios":"ValidateRunID called with a value longer than 64 bytes — e.g. a custom client stuffing a JWT, hostname+UUID+timestamp, or certificate DN into RunID.","commonSituations":"Custom integrations deriving run IDs from long tokens; embedding metadata in the ID field; switching from UUID (36 chars) to a composite string that quietly crossed 64 bytes.","solutions":["Shorten the identifier to <= 64 bytes (a UUID string is safely 36)","Move any metadata out of the run ID into dedicated fields/tags","Add a length check in your client code before sending the login message"],"exampleFix":"// before\nrunID := fmt.Sprintf(\"%s-%s-%s\", hostname, jwtToken, timestamp)\n// > 64 bytes\n\n// after\nrunID := uuid.NewString() // 36 bytes","handlingStrategy":"validation","validationCode":"func runIDFits(s string) bool { return len(s) <= validation.MaxRunIDLength }","typeGuard":"func isValidRunID(s string) bool {\n    return s != \"\" && len(s) <= validation.MaxRunIDLength\n}","tryCatchPattern":null,"preventionTips":["Use UUIDs as run IDs — fixed 36 bytes","Put metadata in dedicated fields, not the ID"],"tags":["frp","protocol","identifier","length-limit","go"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}