{"record":{"id":"2d1486f7c3a8ab49","repo":"Tencent/WeKnora","slug":"sandbox-resolve-config-q-per-tenant-resolver-un","errorCode":null,"errorMessage":"sandbox: resolve config %q: per-tenant resolver unavailable","messagePattern":"sandbox: resolve config %q: per-tenant resolver unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/tenant_sandbox_resolve.go","lineNumber":102,"sourceCode":"\t\t\t\ttenantID, err)\n\t\t} else if disabled {\n\t\t\treturn sandbox.NewDisabledManager(), nil\n\t\t}\n\t}\n\n\t// ② No named workspace config means sandbox execution is disabled. There is\n\t// no deployment-level provider fallback anymore.\n\tif configID == \"\" || configID == types.SandboxConfigIDGlobalDefault {\n\t\treturn sandbox.NewDisabledManager(), nil\n\t}\n\n\t// ③ Named config: must not silently fall back to another backend.\n\tif tenantID == 0 {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"sandbox: resolve config %q: missing workspace context\", configID)\n\t}\n\tif resolver == nil {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"sandbox: resolve config %q: per-tenant resolver unavailable\", configID)\n\t}\n\tmgr, err := resolver.Resolve(ctx, tenantID, configID)\n\tif err != nil {\n\t\tlogger.Warnf(ctx,\n\t\t\t\"[sandbox] failed to resolve config %q for workspace %d: %v\",\n\t\t\tconfigID, tenantID, err)\n\t\treturn nil, err\n\t}\n\treturn mgr, nil\n}\n","sourceCodeStart":84,"sourceCodeEnd":114,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/tenant_sandbox_resolve.go#L84-L114","documentation":"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.","triggerScenarios":"Thrown at internal/application/service/tenant_sandbox_resolve.go:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inject the per-tenant resolver when constructing the service","Verify service initialization order/wiring","Treat as a deployment/configuration bug; fail the requesting operation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}