{"record":{"id":"8f2293e08ad256d0","repo":"semaphoreui/semaphore","slug":"panic-err","errorCode":null,"errorMessage":"panic(err)","messagePattern":"panic\\(err\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/config.go","lineNumber":929,"sourceCode":"\t\tif err := SetNoNewPrivs(); err != nil {\n\t\t\tpanic(fmt.Errorf(\"failed to set no_new_privs: %w\", err))\n\t\t}\n\t}\n\n\tvar encryption []byte\n\n\thash, _ := base64.StdEncoding.DecodeString(Config.CookieHash)\n\tif len(Config.CookieEncryption) > 0 {\n\t\tencryption, _ = base64.StdEncoding.DecodeString(Config.CookieEncryption)\n\t}\n\n\tCookie = securecookie.New(hash, encryption)\n\n\tif Config.WebHost != \"\" {\n\t\tvar err error\n\t\tWebHostURL, err = url.Parse(Config.WebHost)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif len(WebHostURL.String()) == 0 {\n\t\t\tWebHostURL = nil\n\t\t}\n\t} else {\n\t\tWebHostURL = nil\n\t}\n\n\tif Config.Runner.Token != \"\" && Config.Runner.TokenFile != \"\" {\n\t\tpanic(\"SEMAPHORE_RUNNER_TOKEN and SEMAPHORE_RUNNER_TOKEN_FILE are mutually exclusive\")\n\t}\n\n\tif Config.Runner.TokenFile != \"\" {\n\t\trunnerTokenBytes, err := os.ReadFile(Config.Runner.TokenFile)\n\t\tif err == nil {\n\t\t\tConfig.Runner.Token = strings.TrimSpace(string(runnerTokenBytes))\n\t\t}","sourceCodeStart":911,"sourceCodeEnd":947,"githubUrl":"https://github.com/semaphoreui/semaphore/blob/1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa/util/config.go#L911-L947","documentation":"Panics from ConfigInit in util/config.go when the configured web host (Config.WebHost, e.g. the public URL of the Semaphore UI) cannot be parsed by url.Parse. It is a fail-fast guard on startup configuration: the URL is needed to build absolute links and API references, so an unparseable value (control characters, invalid percent-encoding, a malformed bracketed host) aborts boot instead of producing broken URLs later.","triggerScenarios":"Thrown at util/config.go:929 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the web_host value in the config file / SEMAPHORE_WEB_HOST env var to a full valid URL such as https://semaphore.example.com","Check for stray whitespace, quotes, or unescaped special characters in the configured URL","Validate the URL with a parser before deploying the config","If no public URL is needed, leave web_host empty so the field is skipped"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1774ccb71a0a8b82eb74ea24c23ac9ab713de2fa","analyzedAt":"2026-09-07T11:00:33.293Z","contentChangedAt":"2026-09-07T11:00:33.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}