{"record":{"id":"f431f6c4292e72c4","repo":"Tencent/WeKnora","slug":"sandbox-provider-q-returned-no-standard-template","errorCode":null,"errorMessage":"sandbox: provider %q returned no standard template","messagePattern":"sandbox: provider %q returned no standard template","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/tenant_sandbox_config.go","lineNumber":654,"sourceCode":"\twantStandard := in.ReplaceStandard || (in.EnsureStandard && usable == nil)\n\tif wantStandard {\n\t\top := \"ensure\"\n\t\tif in.ReplaceStandard {\n\t\t\top = \"replace\"\n\t\t}\n\t\tkey := op + \":\" + ensureTemplateKey(tenantID, sandbox.IdentityOf(merged))\n\t\tensured, ensureErr, _ := s.ensureTemplate.Do(key, func() (any, error) {\n\t\t\tif in.ReplaceStandard {\n\t\t\t\treturn catalog.ReplaceStandardTemplate(ctx)\n\t\t\t}\n\t\t\treturn catalog.EnsureStandardTemplate(ctx)\n\t\t})\n\t\tif ensureErr != nil {\n\t\t\treturn nil, ensureErr\n\t\t}\n\t\tstandard, ok := ensured.(*sandbox.RemoteTemplate)\n\t\tif !ok || standard == nil {\n\t\t\treturn nil, fmt.Errorf(\"sandbox: provider %q returned no standard template\", effective.Type)\n\t\t}\n\t\tresult.Templates = deduplicateSandboxTemplates(append(result.Templates, *standard))\n\t\tif sandbox.IsTemplateReady(standard.Status) {\n\t\t\tresult.Provisioned = true\n\t\t\tif in.ReplaceStandard {\n\t\t\t\tpersistErr := s.persistSpawnTemplateID(ctx, tenantID, merged, standard.ID, oldStandardIDs)\n\t\t\t\tif persistErr != nil {\n\t\t\t\t\tlogger.Warnf(ctx, \"[sandbox] persist rebuilt template id: %v; keeping previous templates\",\n\t\t\t\t\t\tpersistErr)\n\t\t\t\t} else {\n\t\t\t\t\tresult.StandardTemplateID = standard.ID\n\t\t\t\t\tresult.Templates = hideSupersededStandardTemplates(result.Templates, standard.ID)\n\t\t\t\t\ts.deleteSupersededStandardTemplates(ctx, catalog, standard.ID)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult.StandardTemplateID = standard.ID\n\t\t\t}\n\t\t} else if !sandbox.IsTemplateBuildFailed(standard.Status) {","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/tenant_sandbox_config.go#L636-L672","documentation":"Result guard in QueryTemplates: the ensure/replace call on the provider's template catalog returned a value that is nil or not a *sandbox.RemoteTemplate, i.e. the provider failed to produce a standard template without returning a Go error. A malformed provider response, keyed by the sandbox provider identity.","triggerScenarios":"Thrown at internal/application/service/tenant_sandbox_config.go:654 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the template ensure/replace operation (singleflight-keyed, transient provider flakiness)","Check the sandbox provider's health and template API response shape","File a provider bug if it persistently returns empty standard templates"],"exampleFix":null,"handlingStrategy":"type-guard","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"}