{"record":{"id":"78c619f91fd35fd3","repo":"juanfont/headscale","slug":"s-http-client-is-nil","errorCode":null,"errorMessage":"%s http client is nil","messagePattern":"(.+?) http client is nil","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integration/scenario.go","lineNumber":1160,"sourceCode":"\t}\n\n\tbody, _, err := doLoginURLWithClient(hostname, loginURL, hc, true)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn body, nil\n}\n\n// doLoginURLWithClient performs the login request using the provided HTTP client.\n// When followRedirects is false, it will return the first redirect without following it.\nfunc doLoginURLWithClient(hostname string, loginURL *url.URL, hc *http.Client, followRedirects bool) (\n\tstring,\n\t*url.URL,\n\terror,\n) {\n\tif hc == nil {\n\t\treturn \"\", nil, fmt.Errorf(\"%s http client is nil\", hostname) //nolint:err113\n\t}\n\n\tif loginURL == nil {\n\t\treturn \"\", nil, fmt.Errorf(\"%s login url is nil\", hostname) //nolint:err113\n\t}\n\n\tlog.Printf(\"%s logging in with url: %s\", hostname, loginURL.String())\n\n\tctx := context.Background()\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, loginURL.String(), nil)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"%s creating http request: %w\", hostname, err)\n\t}\n\n\toriginalRedirect := hc.CheckRedirect\n\tif !followRedirects {\n\t\thc.CheckRedirect = func(req *http.Request, via []*http.Request) error {","sourceCodeStart":1142,"sourceCodeEnd":1178,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/integration/scenario.go#L1142-L1178","documentation":"Error \"%s http client is nil\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at integration/scenario.go:1160 when the library encounters an invalid state.","commonSituations":"The node's HTTP client was not initialized before the login flow. Ensure the tailscale client container is created and running first.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (http client is nil); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (http client is nil); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}