{"record":{"id":"111dd4952e04d5fe","repo":"dagger/dagger","slug":"failed-to-create-telemetry-proxy-listener-w","errorCode":null,"errorMessage":"failed to create telemetry proxy listener: %w","messagePattern":"failed to create telemetry proxy listener: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/dagger/run.go","lineNumber":226,"sourceCode":"\t\t\t}\n\n\t\t\tcmdErr = subCmd.Run()\n\t\t} else {\n\t\t\tsubCmd.Stdout = stdout\n\t\t\tsubCmd.Stderr = stderr\n\t\t\tcmdErr = subCmd.Run()\n\t\t}\n\n\t\treturn cmdErr\n\t})\n}\n\n// setupTelemetryProxy creates an OpenTelemetry proxy server and returns\n// environment variables so that child processes can export to it.\nfunc setupTelemetryProxy(ctx context.Context) ([]string, error) {\n\tlistener, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create telemetry proxy listener: %w\", err)\n\t}\n\n\totelProto := \"http/protobuf\"\n\totelEndpoint := \"http://\" + listener.Addr().String()\n\n\tmux := http.NewServeMux()\n\n\t// Handle traces\n\tmux.HandleFunc(\"/v1/traces\", func(w http.ResponseWriter, r *http.Request) {\n\t\tbody, bodyErr := io.ReadAll(r.Body)\n\t\tif bodyErr != nil {\n\t\t\thttp.Error(w, bodyErr.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tvar req coltracepb.ExportTraceServiceRequest\n\t\tif unmarshalErr := proto.Unmarshal(body, &req); unmarshalErr != nil {\n\t\t\thttp.Error(w, unmarshalErr.Error(), http.StatusBadRequest)\n\t\t\treturn","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/internal/cmd/dagger/run.go#L208-L244","documentation":"Wrapped by setupTelemetryProxy when its loopback TCP listener (127.0.0.1:0) cannot be created. The OTLP proxy needs a local port; failure indicates no free ports, a missing loopback interface, or FD exhaustion on the host.","triggerScenarios":"Thrown at internal/cmd/dagger/run.go:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Free file descriptors or ports on the host","Verify 127.0.0.1 loopback is available","Skip the proxy (unset telemetry forwarding) if not needed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}