{"record":{"id":"9286a97b48e8bbd5","repo":"goharbor/harbor","slug":"bad-redis-url-core","errorCode":null,"errorMessage":"bad _REDIS_URL_CORE","messagePattern":"bad _REDIS_URL_CORE","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/main.go","lineNumber":154,"sourceCode":"\n\tos.Exit(0)\n}\n\nfunc main() {\n\t// Start pprof server\n\tlib.StartPprof()\n\n\trunMode := flag.String(\"mode\", \"normal\", \"The harbor-core container run mode, it could be normal, migrate or skip-migrate, default is normal\")\n\tflag.Parse()\n\n\tweb.BConfig.WebConfig.Session.SessionOn = true\n\tweb.BConfig.WebConfig.Session.SessionName = config.SessionCookieName\n\t// the core db used for beego session\n\tredisCoreURL := os.Getenv(\"_REDIS_URL_CORE\")\n\tif len(redisCoreURL) > 0 {\n\t\t_, err := url.Parse(redisCoreURL)\n\t\tif err != nil {\n\t\t\tpanic(\"bad _REDIS_URL_CORE\")\n\t\t}\n\t\t// configure the beego session redis\n\t\tweb.BConfig.WebConfig.Session.SessionProvider = session.HarborProviderName\n\t\tweb.BConfig.WebConfig.Session.SessionProviderConfig = redisCoreURL\n\t}\n\n\tlog.Info(\"initializing cache ...\")\n\t// the harbor db used for harbor business, use core db if not specified\n\tredisHarborURL := os.Getenv(\"_REDIS_URL_HARBOR\")\n\tif redisHarborURL == \"\" {\n\t\tredisHarborURL = redisCoreURL\n\t}\n\tu, err := url.Parse(redisHarborURL)\n\tif err != nil {\n\t\tpanic(\"bad _REDIS_URL_HARBOR\")\n\t}\n\tif err := cache.Initialize(u.Scheme, redisHarborURL); err != nil {\n\t\tlog.Fatalf(\"failed to initialize cache: %v\", err)","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/core/main.go#L136-L172","documentation":"Fatal configuration error at harbor-core startup: the _REDIS_URL_CORE environment variable is non-empty but url.Parse rejects it, meaning the Redis connection string for the core database (used for beego sessions) is malformed. The process panics immediately because the session backend cannot be configured with an unparseable URL.","triggerScenarios":"Thrown at src/core/main.go:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix _REDIS_URL_CORE to a valid URL such as redis://arbitrary_username:password@redishost:6379/0","Check for stray quotes, whitespace, missing scheme, or unescaped special characters in the password","Restart the core container after correcting the variable in harbor.yml / the deployment environment"],"exampleFix":null,"handlingStrategy":"try-catch","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"}