Tencent/WeKnora · error

sandbox: resolve config %q: per-tenant resolver unavailable

Error message

sandbox: resolve config %q: per-tenant resolver unavailable

What it means

resolveTenantSandboxForConfig fires when the per-tenant config resolver dependency is nil while a named configID must be resolved. It prevents a nil-dereference and stops execution instead of silently falling back to another sandbox backend.

Source

Thrown at internal/application/service/tenant_sandbox_resolve.go:102

				tenantID, err)
		} else if disabled {
			return sandbox.NewDisabledManager(), nil
		}
	}

	// ② No named workspace config means sandbox execution is disabled. There is
	// no deployment-level provider fallback anymore.
	if configID == "" || configID == types.SandboxConfigIDGlobalDefault {
		return sandbox.NewDisabledManager(), nil
	}

	// ③ Named config: must not silently fall back to another backend.
	if tenantID == 0 {
		return nil, fmt.Errorf(
			"sandbox: resolve config %q: missing workspace context", configID)
	}
	if resolver == nil {
		return nil, fmt.Errorf(
			"sandbox: resolve config %q: per-tenant resolver unavailable", configID)
	}
	mgr, err := resolver.Resolve(ctx, tenantID, configID)
	if err != nil {
		logger.Warnf(ctx,
			"[sandbox] failed to resolve config %q for workspace %d: %v",
			configID, tenantID, err)
		return nil, err
	}
	return mgr, nil
}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Inject the per-tenant resolver when constructing the service
  2. Verify service initialization order/wiring
  3. Treat as a deployment/configuration bug; fail the requesting operation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/application/service/tenant_sandbox_resolve.go:102 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/2d1486f7c3a8ab49. Report an issue: GitHub.