{"record":{"id":"2435bfe90d7bfb7d","repo":"pulumi/pulumi","slug":"failed-to-start-otlp-receiver-w","errorCode":null,"errorMessage":"failed to start OTLP receiver: %w","messagePattern":"failed to start OTLP receiver: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/go/common/util/cmdutil/trace.go","lineNumber":250,"sourceCode":"\tif endpoint == \"\" && logExporter == nil {\n\t\treturn nil\n\t}\n\n\tvar spanExporter otelreceiver.SpanExporter\n\tif endpoint != \"\" {\n\t\tvar err error\n\t\tspanExporter, err = otelreceiver.NewExporter(endpoint)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create OTLP exporter: %w\", err)\n\t\t}\n\t}\n\n\treceiver, err := otelreceiver.Start(spanExporter, logExporter)\n\tif err != nil {\n\t\tif spanExporter != nil {\n\t\t\t_ = spanExporter.Shutdown(context.Background())\n\t\t}\n\t\treturn fmt.Errorf(\"failed to start OTLP receiver: %w\", err)\n\t}\n\n\tep := receiver.Endpoint()\n\n\totelMu.Lock()\n\totelReceiver = receiver\n\tlogReceiverEndpoint = ep\n\tif spanExporter != nil {\n\t\totelEndpoint = ep\n\t}\n\totelMu.Unlock()\n\n\tif spanExporter != nil {\n\t\t// Start the AppDash bridge so that legacy OpenTracing plugins can send\n\t\t// spans that get converted to OTLP and forwarded to the same exporter.\n\t\tbridge, err := otelreceiver.StartAppDashBridge(spanExporter)\n\t\tif err != nil {\n\t\t\t_ = receiver.Shutdown(context.Background())","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/go/common/util/cmdutil/trace.go#L232-L268","documentation":"After an OTLP exporter is created, cmdutil starts the OTLP receiver; failure is wrapped with this message. On failure it shuts down the already-created span exporter before returning, so the wrapped error is the receiver's own startup error.","triggerScenarios":"Calling the tracing setup with a valid endpoint/deferred exporter but otelreceiver.Start fails — e.g. the receiver cannot bind its local span-receiving port or its internal OTLP pipeline cannot initialize.","commonSituations":"Port already in use by another process (including a previously leaked pulumi process); sandbox restricting local port binding; OTLP collector misconfiguration preventing pipeline startup.","solutions":["Check for another process holding the receiver port (lsof -i / netstat) and kill it","Re-run after confirming no stale pulumi processes remain (profile/trace listeners leak if the process crashed)","Run in an environment that permits local socket binding","Inspect the wrapped %w error for the bind/pipeline failure detail"],"exampleFix":"// before\nlsof -i :4317  # stale process holding port\n// after\nkill <stale-pid>\npulumi up --trace=http://localhost:4317","handlingStrategy":"try-catch","validationCode":"// verify no listener already occupies the receiver port\nif l, err := net.Listen(\"tcp\", \"127.0.0.1:4317\"); err != nil {\n\treturn fmt.Errorf(\"receiver port busy: %w\", err)\n} else { l.Close() }","typeGuard":null,"tryCatchPattern":"if err := startTracing(ctx, endpoint); err != nil {\n\tif strings.Contains(err.Error(), \"failed to start OTLP receiver\") {\n\t\t// likely port in use; clean stale processes then retry once\n\t}\n}","preventionTips":["Kill leaked pulumi processes that hold trace ports after crashes","Avoid running multiple traced CLIs concurrently on the same host","Ensure the environment permits local socket binding (containers/sandboxes)"],"tags":["opentelemetry","otlp","tracing","network"],"backgroundTag":"port-already-in-use","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}