grafana/k6 · error

unknown connect param

Error message

unknown connect param: %q

What it means

Raised in newConnectParams when the grpc.connect params object contains a key outside the recognized set (plaintext, timeout, reflect, reflectMetadata, maxReceiveSize, maxSendSize, tls, authority). Serves as a typo guard for connect options.

Solutions

  1. Remove or fix the unrecognized key named in the message
  2. Check for misspelled options like 'timeouts' or 'maxrecievesize'
  3. Consult the k6 grpc.connect documentation for valid option names
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/js/modules/k6/grpc/params.go:213 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/c8dff9e6d58919d0. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/grpc/params.go:213

			result.MaxSendSize, ok = v.(int64)
			if !ok {
				return result, fmt.Errorf("invalid maxSendSize value: '%#v', it needs to be an integer", v)
			}
			if result.MaxSendSize < 0 {
				return result, fmt.Errorf("invalid maxSendSize value: '%#v, it needs to be a positive integer", v)
			}
		case "tls":
			if err := parseConnectTLSParam(result, v); err != nil {
				return result, err
			}
		case "authority":
			var ok bool
			result.Authority, ok = v.(string)
			if !ok {
				return result, fmt.Errorf("invalid authority value: '%#v', it needs to be a string", v)
			}
		default:
			return result, fmt.Errorf("unknown connect param: %q", k)
		}
	}

	return result, nil
}

func parseConnectTLSParam(params *connectParams, v any) error {
	var ok bool
	params.TLS, ok = v.(map[string]any)

	if !ok {
		return fmt.Errorf("invalid tls value: '%#v', expected (optional) keys: cert, key, password, and cacerts", v)
	}
	// optional map keys below
	if cert, certok := params.TLS["cert"]; certok {
		if _, ok = cert.(string); !ok {
			return fmt.Errorf("invalid tls cert value: '%#v', it needs to be a PEM formatted string", v)
		}

View on GitHub (pinned to 01ffac6f24)