{"record":{"id":"f556976b4a760f74","repo":"grafana/k6","slug":"can-t-list-services-w","errorCode":null,"errorMessage":"can't list services: %w","messagePattern":"can't list services: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/lib/netext/grpcext/reflect.go","lineNumber":26,"sourceCode":"\t\"github.com/jhump/protoreflect/grpcreflect\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// ReflectionClient wraps a grpc.ServerReflectionClient.\ntype reflectionClient struct {\n\tConn grpc.ClientConnInterface\n}\n\n// Reflect will use the grpc reflection api to make the file descriptors available to request.\n// It is called in the connect function the first time the Client.Connect function is called.\nfunc (rc *reflectionClient) Reflect(ctx context.Context) (*descriptorpb.FileDescriptorSet, error) {\n\tclient := grpcreflect.NewClientAuto(ctx, rc.Conn)\n\tclient.AllowMissingFileDescriptors()\n\n\tservices, err := client.ListServices()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"can't list services: %w\", err)\n\t}\n\n\tseen := make(map[fileDescriptorLookupKey]bool, len(services))\n\tfdset := &descriptorpb.FileDescriptorSet{\n\t\tFile: make([]*descriptorpb.FileDescriptorProto, 0, len(services)),\n\t}\n\n\tfor _, srv := range services {\n\t\tsrvDescriptor, err := client.ResolveService(srv)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"can't get method on service %q: %w\", srv, err)\n\t\t}\n\n\t\tstack := []*desc.FileDescriptor{srvDescriptor.GetFile()}\n\n\t\tfor len(stack) > 0 {\n\t\t\tfdp := stack[len(stack)-1]\n\t\t\tstack = stack[:len(stack)-1]","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/lib/netext/grpcext/reflect.go#L8-L44","documentation":"The gRPC reflection client could not list the services exposed by the server. Client.Connect runs reflection on first connect; ListServices fails when the server does not support the reflection API (standard, not grpc.ServerReflectionClient), is unreachable, or returns an error status. Without the service list no file descriptors can be fetched, so the whole connection setup fails.","triggerScenarios":"Thrown at internal/lib/netext/grpcext/reflect.go:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable gRPC reflection on the test server (e.g. reflection.Register(s) in Go servers)","Confirm the server address is correct and reachable from the load generator","If reflection cannot be enabled, load the proto definitions from a local bundle and construct the Client from them instead"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}