grafana/k6 · error
invalid grpc.connect() parameters
Error message
invalid grpc.connect() parameters: %w
What it means
Raised in Client.Connect when newConnectParams fails to interpret the params object passed to grpc.connect — an invalid value for one of the connect options (plaintext, timeout, tls, authority, etc.; the wrapped error names which).
Solutions
- Read the wrapped error to identify the offending connect option
- Use correct types: booleans for plaintext/reflect, duration strings or ms integers for timeout, string for authority
- Remove unrecognized keys from the params object
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/js/modules/k6/grpc/client.go:227 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@8d06114777 (2026-08-18).
Data as JSON: /api/errors/4401b399b2cd9c84.
Report an issue: GitHub.
Appendix: source
Thrown at internal/js/modules/k6/grpc/client.go:257
// fetcher through lib.State.
func buildTLSConfigForConnect(parent *tls.Config, tlsMap map[string]any, state *lib.State) (*tls.Config, error) {
var aiaFetcher *netext.AIAFetcher
if state.Options.TLSAIAFetch.Bool {
aiaFetcher = netext.NewAIAFetcher(state.Dialer.DialContext)
}
return buildTLSConfigFromMap(parent, tlsMap, aiaFetcher, state.Options.InsecureSkipTLSVerify.Bool, state.Logger)
}
// Connect is a block dial to the gRPC server at the given address (host:port)
func (c *Client) Connect(addr string, params sobek.Value) (bool, error) {
state := c.vu.State()
if state == nil {
return false, common.NewInitContextError("connecting to a gRPC server in the init context is not supported")
}
p, err := newConnectParams(c.vu, params)
if err != nil {
return false, fmt.Errorf("invalid grpc.connect() parameters: %w", err)
}
opts := grpcext.DefaultOptions(c.vu.State)
var tcred credentials.TransportCredentials
if !p.IsPlaintext {
tlsCfg := state.TLSConfig.Clone()
if len(p.TLS) > 0 {
tlsCfg, err = buildTLSConfigForConnect(tlsCfg, p.TLS, state)
if err != nil {
return false, err
}
}
tlsCfg.NextProtos = []string{"h2"}
tcred = credentials.NewTLS(tlsCfg)
} else {
tcred = insecure.NewCredentials()View on GitHub (pinned to 8d06114777)