{"record":{"id":"531d68a46625c4d0","repo":"paperclipai/paperclip","slug":"plugin-database-namespace-is-not-active","errorCode":null,"errorMessage":"Plugin database namespace is not active","messagePattern":"Plugin database namespace is not active","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-database.ts","lineNumber":416,"sourceCode":"  }\n\n  async function ensureNamespace(pluginId: string, manifest: PaperclipPluginManifestV1) {\n    return ensureNamespaceWithClient(db, pluginId, manifest);\n  }\n\n  async function getNamespace(pluginId: string) {\n    const rows = await db\n      .select()\n      .from(pluginDatabaseNamespaces)\n      .where(eq(pluginDatabaseNamespaces.pluginId, pluginId))\n      .limit(1);\n    return rows[0] ?? null;\n  }\n\n  async function getRuntimeNamespace(pluginId: string) {\n    const namespace = await getNamespace(pluginId);\n    if (!namespace || namespace.status !== \"active\") {\n      throw new Error(\"Plugin database namespace is not active\");\n    }\n    return namespace.namespaceName;\n  }\n\n  async function recordMigrationFailure(client: PluginDatabaseClient, input: {\n    pluginId: string;\n    pluginKey: string;\n    namespaceName: string;\n    migrationKey: string;\n    checksum: string;\n    pluginVersion: string;\n    error: unknown;\n  }): Promise<void> {\n    const message = input.error instanceof Error ? input.error.message : String(input.error);\n    await client\n      .insert(pluginMigrations)\n      .values({\n        pluginId: input.pluginId,","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-database.ts#L398-L434","documentation":"Runtime readiness guard in getRuntimeNamespace: the plugin's database namespace row is missing or its status is not active (e.g. plugin disabled, install rolled back, namespace never provisioned). Runtime SQL must not run until the namespace is active; the plugin's namespace lifecycle state is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-database.ts:416 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Activate the plugin database namespace (run plugin migrations/setup) before using ctx.db."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}