Tencent/WeKnora · error

concurrency must be at least 1

Error message

concurrency must be at least 1

What it means

Validation error from validateRegistryEntry for asynq concurrency keys (asynq.core_concurrency, asynq.postprocess_concurrency, etc.): the submitted value is less than 1. Validators are strict and user-facing — the message is returned verbatim as the 400 body.

Source

Thrown at internal/application/service/system_setting.go:1322

// is acceptable for persistence.
//
// Adding new validators:
//   - keep them strict (reject silently-broken input rather than fixing
//     it server-side — the user should see what they typed),
//   - keep them deterministic (no DNS lookups, no env reads),
//   - keep error messages user-facing (the handler surfaces them as the
//     400 body verbatim).
func validateRegistryEntry(key string, rawValue any) error {
	switch key {
	case "asynq.core_concurrency", "asynq.postprocess_concurrency",
		"asynq.enrichment_concurrency", "asynq.maintenance_concurrency",
		"asynq.shared_concurrency", "asynq.wiki_concurrency":
		n, err := coerceToPositiveInt64(rawValue)
		if err != nil {
			return err
		}
		if n < 1 {
			return errors.New("concurrency must be at least 1")
		}
	case "ssrf.whitelist":
		// Coerce into the same shape encodeForType produced. We don't
		// look at the encoded JSON because that's already canonicalised
		// — easier to validate the raw input the user typed.
		entries, err := coerceToStringSlice(rawValue)
		if err != nil {
			return err
		}
		return utils.ValidateSSRFWhitelistEntries(entries)
	}
	return nil
}

// coerceToPositiveInt64 accepts int / int64 / float64 from JSON decoding.
func coerceToPositiveInt64(rawValue any) (int64, error) {
	switch v := rawValue.(type) {
	case int:

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Set the concurrency setting to an integer of at least 1
  2. Fix client-side validation to enforce the minimum before submission
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/application/service/system_setting.go:1322 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/c84ba9bfb345ff86. Report an issue: GitHub.