{"record":{"id":"f8215c550c94dc6d","repo":"goharbor/harbor","slug":"invalid-scope-should-be-d-d-or-d","errorCode":null,"errorMessage":"invalid scope, should be %d, %d or %d","messagePattern":"invalid scope, should be (.+?), (.+?) or (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/config/metadata/type.go","lineNumber":133,"sourceCode":"\n\tif val > 65535 {\n\t\treturn fmt.Errorf(\"network port should be less than 65535\")\n\t}\n\n\treturn err\n}\n\n// LdapScopeType - The LDAP scope is a int type, but its is limit to 0, 1, 2\ntype LdapScopeType struct {\n\tIntType\n}\n\n// validate - Verify the range is limited\nfunc (t *LdapScopeType) validate(str string) error {\n\tif str == \"0\" || str == \"1\" || str == \"2\" {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"invalid scope, should be %d, %d or %d\",\n\t\tcommon.LDAPScopeBase,\n\t\tcommon.LDAPScopeOnelevel,\n\t\tcommon.LDAPScopeSubtree)\n}\n\n// Int64Type ...\ntype Int64Type struct {\n}\n\nfunc (t *Int64Type) validate(str string) error {\n\t_, err := parseInt64(str)\n\treturn err\n}\n\nfunc (t *Int64Type) get(str string) (any, error) {\n\treturn parseInt64(str)\n}\n","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/lib/config/metadata/type.go#L115-L151","documentation":"LdapScopeType.validate rejected the ldap_scope setting because it is not one of the string forms '0', '1' or '2', which map to LDAPScopeBase, LDAPScopeOnelevel and LDAPScopeSubtree; the message prints the numeric constants (0, 1, 2).","triggerScenarios":"Thrown at src/lib/config/metadata/type.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ldap_scope to 0 (base), 1 (onelevel) or 2 (subtree)","Check that the value was not quoted or given as a float string","Re-apply the LDAP configuration once corrected"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}