goharbor/harbor · error
bad _REDIS_URL_CORE
Error message
bad _REDIS_URL_CORE
What it means
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.
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/core/main.go:154 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/9286a97b48e8bbd5.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/main.go:154
os.Exit(0)
}
func main() {
// Start pprof server
lib.StartPprof()
runMode := flag.String("mode", "normal", "The harbor-core container run mode, it could be normal, migrate or skip-migrate, default is normal")
flag.Parse()
web.BConfig.WebConfig.Session.SessionOn = true
web.BConfig.WebConfig.Session.SessionName = config.SessionCookieName
// the core db used for beego session
redisCoreURL := os.Getenv("_REDIS_URL_CORE")
if len(redisCoreURL) > 0 {
_, err := url.Parse(redisCoreURL)
if err != nil {
panic("bad _REDIS_URL_CORE")
}
// configure the beego session redis
web.BConfig.WebConfig.Session.SessionProvider = session.HarborProviderName
web.BConfig.WebConfig.Session.SessionProviderConfig = redisCoreURL
}
log.Info("initializing cache ...")
// the harbor db used for harbor business, use core db if not specified
redisHarborURL := os.Getenv("_REDIS_URL_HARBOR")
if redisHarborURL == "" {
redisHarborURL = redisCoreURL
}
u, err := url.Parse(redisHarborURL)
if err != nil {
panic("bad _REDIS_URL_HARBOR")
}
if err := cache.Initialize(u.Scheme, redisHarborURL); err != nil {
log.Fatalf("failed to initialize cache: %v", err)View on GitHub (pinned to 7b2fd08cc5)