jaegertracing/jaeger · error

error creating writer client connection: %w

Error message

error creating writer client connection: %w

What it means

Same as the reader connection error but for the writer gRPC connection. On failure the factory closes the already-created reader connection before returning, leaving no partially initialized factory.

Source

Thrown at internal/storage/v2/grpc/factory.go:166

	}
	if f.config.MaxRecvMsgSizeMiB > 0 {
		baseOpts = append(baseOpts, grpc.WithDefaultCallOptions(
			grpc.MaxCallRecvMsgSize(f.config.MaxRecvMsgSizeMiB*1024*1024),
		))
	}

	createConn := func(telset component.TelemetrySettings, gcs *configgrpc.ClientConfig) (*grpc.ClientConn, error) {
		return newClient(telset, gcs, baseOpts...)
	}

	readerConn, err := createConn(readerTelset, readerConfig)
	if err != nil {
		return fmt.Errorf("error creating reader client connection: %w", err)
	}
	writerConn, err := createConn(writerTelset, writerConfig)
	if err != nil {
		_ = readerConn.Close()
		return fmt.Errorf("error creating writer client connection: %w", err)
	}

	f.readerConn, f.writerConn = readerConn, writerConn

	return nil
}

View on GitHub (pinned to 806f444784)

Solutions

  1. Read the wrapped cause for the writer dial failure
  2. Verify the writer endpoint differs intentionally from the reader and is reachable
  3. Match TLS/auth settings between reader and writer unless they genuinely differ
  4. Ensure the writer-side remote storage service is running

Example fix

// before
writer:
  endpoint: storage-writer:17272
// after
writer:
  endpoint: remote-storage:17271
Defensive patterns

Strategy: validation

Validate before calling

// verify writer endpoint reachability before Initialize
timeout, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
if !reachable(writerCfg.Endpoint, timeout) { /* fail fast */ }

Try / catch

err := factory.Initialize()
if err != nil && strings.Contains(err.Error(), "writer client connection") {
    // check writer-specific endpoint/TLS config
    return err
}

Prevention

When it happens

Trigger: initializeConnections succeeds dialing the reader but fails dialing the writer endpoint (e.g. separate writer config pointing at an unreachable or misconfigured server).

Common situations: Writer endpoint configured to a different host than the reader that is down; TLS/auth misconfiguration only on the writer block; typo in writer endpoint.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/9fb55bb80e7f9f82. Report an issue: GitHub.