grafana/k6 · error
can't list services: %w
Error message
can't list services: %w
What it means
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.
Source
Thrown at internal/lib/netext/grpcext/reflect.go:26
"github.com/jhump/protoreflect/grpcreflect"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/descriptorpb"
)
// ReflectionClient wraps a grpc.ServerReflectionClient.
type reflectionClient struct {
Conn grpc.ClientConnInterface
}
// Reflect will use the grpc reflection api to make the file descriptors available to request.
// It is called in the connect function the first time the Client.Connect function is called.
func (rc *reflectionClient) Reflect(ctx context.Context) (*descriptorpb.FileDescriptorSet, error) {
client := grpcreflect.NewClientAuto(ctx, rc.Conn)
client.AllowMissingFileDescriptors()
services, err := client.ListServices()
if err != nil {
return nil, fmt.Errorf("can't list services: %w", err)
}
seen := make(map[fileDescriptorLookupKey]bool, len(services))
fdset := &descriptorpb.FileDescriptorSet{
File: make([]*descriptorpb.FileDescriptorProto, 0, len(services)),
}
for _, srv := range services {
srvDescriptor, err := client.ResolveService(srv)
if err != nil {
return nil, fmt.Errorf("can't get method on service %q: %w", srv, err)
}
stack := []*desc.FileDescriptor{srvDescriptor.GetFile()}
for len(stack) > 0 {
fdp := stack[len(stack)-1]
stack = stack[:len(stack)-1]View on GitHub (pinned to 01ffac6f24)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at internal/lib/netext/grpcext/reflect.go:26 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/f556976b4a760f74.
Report an issue: GitHub.