{"record":{"id":"00b09b352baf6dba","repo":"goharbor/harbor","slug":"port-number-should-be-a-none-zero-integer-and-less","errorCode":null,"errorMessage":"port number should be a none zero integer and less or equal 65535, but current is %d","messagePattern":"port number should be a none zero integer and less or equal 65535, but current is (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/jobservice/config/config.go","lineNumber":316,"sourceCode":"\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) {\n\t\t\treturn fmt.Errorf(\"certificate for protocol %s is not correctly configured\", c.Protocol)\n\t\t}\n\t}\n\n\tif c.PoolConfig == nil {\n\t\treturn errors.New(\"no worker worker is configured\")\n\t}","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/jobservice/config/config.go#L298-L334","documentation":"Validation in Configuration.validate: the configured port is not a valid port (zero, negative, or above 65535), so the job service cannot bind with this setting.","triggerScenarios":"Thrown at src/jobservice/config/config.go:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a valid port (1-65535) in jobservice configuration","Check the env variable overriding the port for bad values","Avoid port conflicts by choosing a free port"],"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"}