grafana/k6 · error

insecure must be true or false, not %s

Error message

insecure must be true or false, not %s

What it means

Query-parameter validation in the InfluxDB output's ParseURL: while walking the URL's query string, the insecure parameter was found with a value that is not the empty string, "true", or "false". InfluxDB output configuration is encoded as URL query parameters, and this guard rejects any other truthiness spelling (e.g., 1, yes, TRUE) to avoid ambiguity about TLS certificate verification behavior.

Source

Thrown at internal/output/influxdb/config.go:157

	} else if db := strings.TrimPrefix(u.Path, "/"); db != "" {
		c.DB = null.StringFrom(db)
	}
	if u.User != nil {
		c.Username = null.StringFrom(u.User.Username())
		pass, _ := u.User.Password()
		c.Password = null.StringFrom(pass)
	}
	for k, vs := range u.Query() {
		switch k {
		case "insecure":
			switch vs[0] {
			case "":
			case "false":
				c.Insecure = null.BoolFrom(false)
			case "true":
				c.Insecure = null.BoolFrom(true)
			default:
				return c, fmt.Errorf("insecure must be true or false, not %s", vs[0])
			}
		case "payload_size":
			var size int
			size, err = strconv.Atoi(vs[0])
			if err != nil {
				return c, err
			}
			c.PayloadSize = null.IntFrom(int64(size))
		case "precision":
			c.Precision = null.StringFrom(vs[0])
		case "retention":
			c.Retention = null.StringFrom(vs[0])
		case "consistency":
			c.Consistency = null.StringFrom(vs[0])

		case "pushInterval":
			err = c.PushInterval.UnmarshalText([]byte(vs[0]))
			if err != nil {

View on GitHub (pinned to 165bb3c1a4)

Solutions

  1. Write the parameter as K6_INFLUXDB_ADDR-based URL with insecure=true or insecure=false exactly
  2. Remove the parameter entirely to keep the default (secure) behavior
  3. Set the value via environment variable or config file as a proper boolean instead of the URL
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/output/influxdb/config.go:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@165bb3c1a4 (2026-08-18). Data as JSON: /api/errors/a03e08c3b1124c3e. Report an issue: GitHub.