{"record":{"id":"464ae30a5af5aff3","repo":"dagger/dagger","slug":"setup-telemetry-proxy-w","errorCode":null,"errorMessage":"setup telemetry proxy: %w","messagePattern":"setup telemetry proxy: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/dagger/run.go","lineNumber":155,"sourceCode":"\n\treturn nil\n}\n\nfunc run(cmd *cobra.Command, args []string) error {\n\tctx := cmd.Context()\n\n\tu, err := uuid.NewRandom()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"generate uuid: %w\", err)\n\t}\n\tsessionToken := u.String()\n\n\t// Proxy OTel to the CLI and out through its locally configured exporters\n\t// so that it makes it to the TUI and into Cloud without having to also\n\t// configure the underlying command.\n\totelEnv, err := setupTelemetryProxy(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"setup telemetry proxy: %w\", err)\n\t}\n\n\treturn withEngine(ctx, client.Params{\n\t\tSecretToken:          sessionToken,\n\t\tLoadWorkspaceModules: runLoadWorkspaceModules,\n\t}, func(ctx context.Context, engineClient *client.Client) error {\n\t\tsessionL, err := net.Listen(\"tcp\", \"127.0.0.1:0\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"session listen: %w\", err)\n\t\t}\n\t\tdefer sessionL.Close()\n\n\t\tenv := os.Environ()\n\t\tsessionPort := fmt.Sprintf(\"%d\", sessionL.Addr().(*net.TCPAddr).Port)\n\t\tenv = append(env, \"DAGGER_SESSION_PORT=\"+sessionPort)\n\t\tenv = append(env, \"DAGGER_SESSION_TOKEN=\"+sessionToken)\n\t\tenv = append(env, telemetry.PropagationEnv(ctx)...)\n\t\tenv = append(env, otelEnv...)","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/internal/cmd/dagger/run.go#L137-L173","documentation":"Wrapped by run when setupTelemetryProxy fails to start the local OTLP proxy. The proxy forwards child-process telemetry to the CLI's exporters; failure means a TCP listener or mux setup error occurred, so the run command aborts before launching the engine session.","triggerScenarios":"Thrown at internal/cmd/dagger/run.go:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped listener/serve error for port or permission issues","Disable the telemetry proxy if OTel forwarding is not needed","Free the conflicting local port and retry"],"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"}