{"record":{"id":"db29ec2b3046ea3a","repo":"goharbor/harbor","slug":"protocol-should-be-s-or-s-but-current-setting-i","errorCode":null,"errorMessage":"protocol should be %s or %s, but current setting is %s","messagePattern":"protocol should be (.+?) or (.+?), but current setting is (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/jobservice/config/config.go","lineNumber":309,"sourceCode":"\t\tif !utils.IsEmptyStr(it) {\n\t\t\tif c.PoolConfig.RedisPoolCfg == nil {\n\t\t\t\tc.PoolConfig.RedisPoolCfg = &RedisPoolConfig{}\n\t\t\t}\n\t\t\tv, err := strconv.Atoi(it)\n\t\t\tif err != nil {\n\t\t\t\tlog.Warningf(\"Invalid idle timeout second: %s, will use 0 instead\", it)\n\t\t\t} else {\n\t\t\t\tc.PoolConfig.RedisPoolCfg.IdleTimeoutSecond = int64(v)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Check if the configurations are valid settings.\nfunc (c *Configuration) validate() error {\n\tif c.Protocol != JobServiceProtocolHTTPS &&\n\t\tc.Protocol != JobServiceProtocolHTTP {\n\t\treturn fmt.Errorf(\"protocol should be %s or %s, but current setting is %s\",\n\t\t\tJobServiceProtocolHTTP,\n\t\t\tJobServiceProtocolHTTPS,\n\t\t\tc.Protocol)\n\t}\n\n\tif !utils.IsValidPort(c.Port) {\n\t\treturn fmt.Errorf(\"port number should be a none zero integer and less or equal 65535, but current is %d\", c.Port)\n\t}\n\n\tif c.Protocol == JobServiceProtocolHTTPS {\n\t\tif c.HTTPSConfig == nil {\n\t\t\treturn fmt.Errorf(\"certificate must be configured if serve with protocol %s\", c.Protocol)\n\t\t}\n\n\t\tif utils.IsEmptyStr(c.HTTPSConfig.Cert) ||\n\t\t\t!utils.FileExists(c.HTTPSConfig.Cert) ||\n\t\t\tutils.IsEmptyStr(c.HTTPSConfig.Key) ||\n\t\t\t!utils.FileExists(c.HTTPSConfig.Key) {","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/config/config.go#L291-L327","documentation":"Error \"protocol should be %s or %s, but current setting is %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/jobservice/config/config.go:309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}