{"record":{"id":"0620f8a5c4840885","repo":"juanfont/headscale","slug":"creating-derp-server-w","errorCode":null,"errorMessage":"creating DERP server: %w","messagePattern":"creating DERP server: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"integration/scenario.go","lineNumber":1536,"sourceCode":"\t\t\tuser.syncWaitGroup.Go(func() error {\n\t\t\t\treturn c.WaitForNeedsLogin(integrationutil.PeerSyncTimeout())\n\t\t\t})\n\t\t}\n\n\t\terr := user.syncWaitGroup.Wait()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// CreateDERPServer creates a new DERP server in a container.\nfunc (s *Scenario) CreateDERPServer(version string, opts ...dsic.Option) (*dsic.DERPServerInContainer, error) {\n\tderp, err := dsic.New(s.pool, version, s.Networks(), opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating DERP server: %w\", err)\n\t}\n\n\terr = derp.WaitForRunning()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reaching DERP server: %w\", err)\n\t}\n\n\ts.derpServers = append(s.derpServers, derp)\n\n\treturn derp, nil\n}\n\ntype scenarioOIDC struct {\n\tr   *dockertest.Resource\n\tcfg *types.OIDCConfig\n}\n\nfunc (o *scenarioOIDC) Issuer() string {","sourceCodeStart":1518,"sourceCodeEnd":1554,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/integration/scenario.go#L1518-L1554","documentation":"`dsic.New` failed while creating the DERP-in-container server — dockertest could not build or run the DERP container image. The error wraps the underlying dockertest failure (image pull failure, build error, name/network conflict).","triggerScenarios":"Calling `Scenario.CreateDERPServer(version, opts...)` when the DERP image cannot be pulled/built, the Docker daemon is unreachable, or a container with the generated name already exists.","commonSituations":"Offline/dev environment without the DERP image cached; Docker disk full; stale container from a previous crashed test run holding the network/name.","solutions":["Read the wrapped dockertest error — pull/build failures name the image and reason.","Clean stale resources: `docker rm -f` leftover DERP containers or use the repo's cleanup command (`go run ./cmd/hi cleanup`).","Pre-pull the DERP image in CI before the test run.","Confirm the Docker daemon is up and disk space is available."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Cheap pre-flight before creating the DERP server.\nif _, err := pool.Client.Info(); err != nil {\n    t.Fatalf(\"docker daemon unreachable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the repo cleanup command between local test runs to clear stale containers.","Pre-pull/cache the DERP image on CI runners.","Monitor Docker disk space in long test sessions."],"tags":["docker","integration","derp","infrastructure"],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}