jaegertracing/jaeger · error

failed to create gRPC server: %w

Error message

failed to create gRPC server: %w

What it means

This error is wrapped by createGRPCServer (cmd/remote-storage/app/server.go:111) when the configgrpc.ServerConfig.ToServer(...) call fails to construct the underlying grpc.Server for Jaeger remote-storage. The config (listener address, TLS/transport credentials, interceptors) is converted into an OTel-collector-style gRPC server here, and any misconfiguration is reported with this wrapper. It occurs during Server construction (NewServer), so the process fails to start.

Source

Thrown at cmd/remote-storage/app/server.go:111

	if tm.Enabled {
		unaryInterceptors = append(unaryInterceptors, tenancy.NewGuardingUnaryInterceptor(tm))
		streamInterceptors = append(streamInterceptors, tenancy.NewGuardingStreamInterceptor(tm))
	}

	cfg.NetAddr.Transport = confignet.TransportTypeTCP
	var extensions map[component.ID]component.Component
	if telset.Host != nil {
		extensions = telset.Host.GetExtensions()
	}
	server, err := cfg.ToServer(
		ctx,
		extensions,
		telset.ToOtelComponent(),
		configgrpc.WithGrpcServerOption(grpc.ChainUnaryInterceptor(unaryInterceptors...)),
		configgrpc.WithGrpcServerOption(grpc.ChainStreamInterceptor(streamInterceptors...)),
	)
	if err != nil {
		return nil, fmt.Errorf("failed to create gRPC server: %w", err)
	}
	healthServer := health.NewServer()
	reflection.Register(server)

	v2Handler.Register(server, healthServer)
	grpc_health_v1.RegisterHealthServer(server, healthServer)

	return server, nil
}

// Start gRPC server concurrently
func (s *Server) Start(ctx context.Context) error {
	var err error
	s.grpcConn, err = s.grpcCfg.NetAddr.Listen(ctx)
	if err != nil {
		return fmt.Errorf("failed to listen on gRPC port: %w", err)
	}
	s.telset.Logger.Info("Starting GRPC server", zap.Stringer("addr", s.grpcConn.Addr()))

View on GitHub (pinned to 806f444784)

Solutions

  1. Verify that TLS cert/key file paths in the remote-storage gRPC server config point to existing, readable, valid PEM files, or remove the TLSSetting block to run without TLS
  2. Enable debug logging to see the underlying wrapped error from cfg.ToServer and address that specific cause
  3. If no TLS/auth is intended, ensure ServerConfig has NetAddr set and no partial transport-credential settings
  4. Validate the config with the otel config validation helpers used by the project before launching

Example fix

// before (config: TLS enabled but files missing)
// grpc:
//   tls:
//     cert_file: /etc/certs/server.crt
//     key_file: /etc/certs/server.key   <- file missing
// after
// grpc:
//   tls:
//     cert_file: /etc/certs/server.crt
//     key_file: /etc/certs/server.key   # both files exist and are valid PEM
//     # verify: openssl x509 -in /etc/certs/server.crt -noout
Defensive patterns

Strategy: validation

Validate before calling

// before constructing the server, validate config and TLS material
func validateGRPCServerCfg(cfg configgrpc.ServerConfig) error {
	if cfg.NetAddr.Endpoint == "" {
		return errors.New("grpc endpoint not set")
	}
	return cfg.Validate() // otel config validation; errors if TLS files are missing/invalid
}

Try / catch

server, err := createGRPCServer(ctx, cfg, tm, handler, telset)
if err != nil {
	log.Fatalf("invalid gRPC server config: %v", err) // err wraps the cfg.ToServer cause
}

Prevention

When it happens

Trigger: Calling NewServer (which invokes createGRPCServer) with a configgrpc.ServerConfig whose ToServer fails, e.g. TLS enabled (TLSSetting with CertFile/KeyFile) where the cert/key files do not exist, are unreadable, or are malformed; or an invalid combination of server options in the config.

Common situations: Mounting TLS secrets into a Kubernetes pod but with wrong paths in the remote-storage config; cert/key files present but expired or not valid PEM; supplying only a CA file without the server key pair; copy-pasting a client-side config into the server config.

Related errors


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