{"record":{"id":"f8e5f9959a42717b","repo":"Mintplex-Labs/anything-llm","slug":"namespace-required-f8e5f9","errorCode":null,"errorMessage":"namespace required","messagePattern":"namespace required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/utils/vectorDbProviders/lance/index.js","lineNumber":471,"sourceCode":"          similarityThreshold,\n          topN,\n          filterIdentifiers,\n        });\n\n    const { contextTexts, sourceDocuments } = result;\n    const sources = sourceDocuments.map((metadata, i) => {\n      return { metadata: { ...metadata, text: contextTexts[i] } };\n    });\n    return {\n      contextTexts,\n      sources: this.curateSources(sources),\n      message: false,\n    };\n  }\n\n  async \"namespace-stats\"(reqBody = {}) {\n    const { namespace = null } = reqBody;\n    if (!namespace) throw new Error(\"namespace required\");\n    const { client } = await this.connect();\n    if (!(await this.namespaceExists(client, namespace)))\n      throw new Error(\"Namespace by that name does not exist.\");\n    const stats = await this.namespace(client, namespace);\n    return stats\n      ? stats\n      : { message: \"No stats were able to be fetched from DB for namespace\" };\n  }\n\n  async \"delete-namespace\"(reqBody = {}) {\n    const { namespace = null } = reqBody;\n    const { client } = await this.connect();\n    if (!(await this.namespaceExists(client, namespace)))\n      throw new Error(\"Namespace by that name does not exist.\");\n\n    await this.deleteVectorsInNamespace(client, namespace);\n    return {\n      message: `Namespace ${namespace} was deleted.`,","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/utils/vectorDbProviders/lance/index.js#L453-L489","documentation":"LanceVectorDb's 'namespace-stats' command destructures reqBody.namespace and throws 'namespace required' when it is absent. The command is dispatched from the developer tools endpoints and expects { namespace: '<workspace-slug>' } so it can look up the corresponding LanceDB table.","triggerScenarios":"Calling VectorDb['namespace-stats']({}) or with an undefined/null namespace - incomplete request body from manual API calls or scripts iterating workspaces where a slug is missing.","commonSituations":"curl/Postman requests to the dev endpoint missing the namespace field; automation built against a different provider's payload shape; workspace records without slugs.","solutions":["Include the workspace slug: { \"namespace\": \"my-workspace\" }.","Look the slug up via the workspaces API or the workspace URL before calling.","Filter falsy namespaces out of batch scripts before invoking stats."],"exampleFix":"// before\nawait VectorDb['namespace-stats']({});\n\n// after\nawait VectorDb['namespace-stats']({ namespace: 'my-workspace' });","handlingStrategy":"validation","validationCode":"const ns = reqBody?.namespace?.trim();\nif (!ns) throw new Error(\"Body must include non-empty 'namespace' (workspace slug).\");\nawait VectorDb['namespace-stats']({ namespace: ns });","typeGuard":"function hasNamespace(body) {\n  return typeof body?.namespace === 'string' && body.namespace.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Validate the namespace field at the endpoint before dispatching VectorDb commands.","Drive tooling from workspace records (slug) instead of free-form input."],"tags":["lancedb","vector-db","namespace","argument-validation","developer-tools"],"backgroundTag":"missing-required-argument","analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}