{"record":{"id":"e6a3997f97771c83","repo":"grpc/grpc-go","slug":"lrsclient-failed-to-create-transport-for-server-i","errorCode":null,"errorMessage":"lrsclient: failed to create transport for server identifier %s: %v","messagePattern":"lrsclient: failed to create transport for server identifier (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/clients/lrsclient/lrsclient.go","lineNumber":120,"sourceCode":"\n\t// Use an existing stream, if one exists for this server identifier.\n\tif s, ok := c.lrsStreams[serverIdentifier]; ok {\n\t\tif c.logger.V(2) {\n\t\t\tc.logger.Infof(\"Reusing an existing lrs stream for server identifier %q\", serverIdentifier)\n\t\t}\n\t\tc.lrsRefs[serverIdentifier]++\n\t\treturn s, nil\n\t}\n\n\tif c.logger.V(2) {\n\t\tc.logger.Infof(\"Creating a new lrs stream for server identifier %q\", serverIdentifier)\n\t}\n\n\t// Create a new transport and create a new lrs stream, and add it to the\n\t// map of lrs streams.\n\ttr, err := c.transportBuilder.Build(serverIdentifier)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"lrsclient: failed to create transport for server identifier %s: %v\", serverIdentifier, err)\n\t}\n\n\tnodeProto := clientsinternal.NodeProto(c.node)\n\tnodeProto.ClientFeatures = []string{clientFeatureNoOverprovisioning, clientFeatureResourceWrapper}\n\tlrs := newStreamImpl(streamOpts{\n\t\ttransport: tr,\n\t\tbackoff:   c.backoff,\n\t\tnodeProto: nodeProto,\n\t\tlogPrefix: clientPrefix(c),\n\t})\n\n\t// Register a stop function that decrements the reference count, stops\n\t// the LRS stream when the last reference is removed and closes the\n\t// transport and removes the lrs stream and its references from the\n\t// respective maps. Before closing the stream, it waits for the provided\n\t// context to be done (timeout or cancellation).\n\tstop := func(ctx context.Context) {\n\t\tc.mu.Lock()","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/clients/lrsclient/lrsclient.go#L102-L138","documentation":"Returned by LRSClient.ReportLoad when transportBuilder.Build fails for the given ServerIdentifier (lrsclient.go:120). This wraps the underlying Build error (any of the grpctransport Build errors, or a custom transport builder error) with the offending server identifier for context.","triggerScenarios":"Calling lrsClient.ReportLoad(si) where the configured TransportBuilder returns an error from Build(si). The LRS client does not retry Build; it surfaces the error to the caller.","commonSituations":"The ServerIdentifier passed to ReportLoad was not constructed correctly (empty URI, missing Extension, unknown ConfigName, nil credentials) - see errors 404-408; the transport is unreachable at construction time; credentials bundle construction failed.","solutions":["Read the wrapped error - it is one of the grpctransport errors (404-409) and names the exact cause.","Validate the ServerIdentifier before calling ReportLoad using the same checks Build performs.","Ensure the TransportBuilder was configured with a Config map whose keys match the ServerIdentifierExtension.ConfigName."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"func validateSI(si clients.ServerIdentifier) error {\n    if si.ServerURI == \"\" { return errors.New(\"ServerURI empty\") }\n    if si.Extensions == nil { return errors.New(\"Extensions nil\") }\n    if _, ok := si.Extensions.(grpctransport.ServerIdentifierExtension); !ok {\n        return errors.New(\"Extensions wrong type\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"ls, err := lrsClient.ReportLoad(si)\nif err != nil && strings.Contains(err.Error(), \"failed to create transport for server identifier\") {\n    // unwrap to find the underlying Build error and fix the SI/config\n}","preventionTips":["Validate the ServerIdentifier before calling ReportLoad.","Share a single helper that builds ServerIdentifiers across LRS and xDS clients.","Log the wrapped error verbatim - it identifies the exact Build failure."],"tags":["lrs","xds","grpctransport","configuration"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}