vxcontrol/pentagi · error

invalid strings value: expected a JSON array of strings, e.g

Error message

invalid strings value: expected a JSON array of strings, e.g. ["question 1","question 2"], got: %s

What it means

Error "invalid strings value: expected a JSON array of strings, e.g. ["question 1","question 2"], got: %s" thrown in vxcontrol/pentagi.

Source

Thrown at backend/pkg/tools/args.go:539

	// Recovery path: the array was sent as a JSON string. Try to decode its
	// content as a JSON array of strings first (the double-encoding case seen
	// in production), then fall back to treating the whole string as a single
	// element so one plain question doesn't fail either.
	var encoded string
	if err := json.Unmarshal(data, &encoded); err == nil {
		var nested []string
		if err := json.Unmarshal([]byte(encoded), &nested); err == nil {
			*s = nested
			return nil
		}
		if trimmed := strings.TrimSpace(encoded); trimmed != "" {
			*s = []string{trimmed}
			return nil
		}
	}

	return fmt.Errorf(
		"invalid strings value: expected a JSON array of strings, e.g. [\"question 1\",\"question 2\"], got: %s",
		strings.TrimSpace(string(data)),
	)
}

func (s *Strings) MarshalJSON() ([]byte, error) {
	if s == nil || *s == nil {
		return []byte("[]"), nil
	}
	return json.Marshal([]string(*s))
}

View on GitHub (pinned to ea665308ba)

When it happens

Trigger: Thrown at backend/pkg/tools/args.go:539 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01). Data as JSON: /api/errors/b2603259341e6d60. Report an issue: GitHub.