grafana/k6 · error

invalid input, min length is %d

Error message

invalid input, min length is %d

What it means

A user-supplied interactive form string field (e.g. cloud login email/name prompt) was shorter than the field's configured minimum length after trimming whitespace. Clean enforces the Min bound of the StringField.

Source

Thrown at internal/ui/form_fields.go:71

		if err != nil {
			return string(result), err
		}

		if n != 1 {
			// Shouldn't happen, but just in case
			return string(result), errors.New("unexpected input when reading string field")
		} else if buf[0] == '\n' {
			return string(result), nil
		}
		result = append(result, buf[0])
	}
}

// Clean trims the spaces in the string and checks for min and max length
func (f StringField) Clean(s string) (string, error) {
	s = strings.TrimSpace(s)
	if f.Min != 0 && len(s) < f.Min {
		return "", fmt.Errorf("invalid input, min length is %d", f.Min)
	}
	if f.Max != 0 && len(s) > f.Max {
		return "", fmt.Errorf("invalid input, max length is %d", f.Max)
	}
	if s == "" {
		s = f.Default
	}
	return s, nil
}

// PasswordField masks password input
type PasswordField struct {
	Key   string
	Label string
	Min   int
}

// GetKey returns the field's key

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Enter a longer value meeting the minimum length shown in the error
  2. Re-run the command and provide valid input at the prompt
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/ui/form_fields.go:71 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/63e8eb5c27236b07. Report an issue: GitHub.