{"record":{"id":"118c25afe05e8dbd","repo":"Mintplex-Labs/anything-llm","slug":"invalid-source-property-provided","errorCode":null,"errorMessage":"Invalid source property provided","messagePattern":"Invalid source property provided","errorType":"validation","errorClass":"Error","httpStatus":200,"severity":"error","filePath":"collector/extensions/resync/index.js","lineNumber":72,"sourceCode":"      throw new Error(`Failed to sync YouTube video transcript. ${reason}`);\n    response.status(200).json({ success, content });\n  } catch (e) {\n    console.error(e);\n    response.status(200).json({\n      success: false,\n      content: null,\n    });\n  }\n}\n\n/**\n * Fetches the content of a specific confluence page via its chunkSource.\n * Returns the content as a text string of the page in question and only that page.\n * @param {object} data - metadata from document (eg: chunkSource)\n * @param {import(\"../../middleware/setDataSigner\").ResponseWithSigner} response\n */\nasync function resyncConfluence({ chunkSource }, response) {\n  if (!chunkSource) throw new Error(\"Invalid source property provided\");\n  try {\n    // Confluence data is `payload` encrypted. So we need to expand its\n    // encrypted payload back into query params so we can reFetch the page with same access token/params.\n    const source = response.locals.encryptionWorker.expandPayload(chunkSource);\n    const {\n      fetchConfluencePage,\n    } = require(\"../../utils/extensions/Confluence\");\n    const baseUrl = source.searchParams.get(\"baseUrl\");\n    const { success, reason, content } = await fetchConfluencePage({\n      // The stored pathname carries no scheme. Use the one from baseUrl so the\n      // page url matches the one the loader builds from the same baseUrl.\n      pageUrl: `${protocolOf(baseUrl)}${source.pathname}`,\n      baseUrl,\n      spaceKey: source.searchParams.get(\"spaceKey\"),\n      accessToken: source.searchParams.get(\"token\"),\n      username: source.searchParams.get(\"username\"),\n      personalAccessToken: source.searchParams.get(\"personalAccessToken\"),\n      cloud: source.searchParams.get(\"cloud\") === \"true\",","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/f92433b4ea0598492a1e6645ea22addbb4dd1287/collector/extensions/resync/index.js#L54-L90","documentation":"After the required-namespace check passes, the pinecone 'namespace-stats' handler verifies the namespace exists in the index (describeIndexStats shows no such namespace) before fetching stats. The throw means the name parsed fine as a request but Pinecone has no vectors under it — the workspace was never embedded, or its embeddings were cleared.","triggerScenarios":"Requesting stats for a workspace where no documents have been embedded yet; after embeddings were reset or the Pinecone index was wiped/recreated; querying a slug that exists as a workspace but was never populated; embed jobs that all failed earlier (e.g., empty-document errors) so nothing was ever upserted.","commonSituations":"Fresh install where the user checks stats before uploading/embedding anything; pointing PINECONE_INDEX at a new empty index after recreating it; failed ingestion runs that silently left the namespace empty; slug typo that matches no populated namespace.","solutions":["Embed at least one document into the workspace (upload via UI or data connector) so the namespace is created in Pinecone, then retry stats.","List what actually exists: GET /api/ext/vectors/namespaces, or check the Pinecone console's namespace list for the index.","If you recently recreated or switched indexes (PINECONE_INDEX), re-embed the workspaces — namespaces do not carry over.","Verify the slug character-for-character, including dashes from spaces and lowercase conversion."],"exampleFix":"# before - stats for a never-embedded workspace\ncurl -X POST .../api/ext/vectors/namespace-stats -d '{\"namespace\": \"empty-ws\"}'\n# -> Namespace by that name does not exist.\n\n# after - list real namespaces, then query one\n# 1) embed a document into the workspace via UI/collector\n# 2) curl -H \"Authorization: Bearer $KEY\" .../api/ext/vectors/namespaces\n# 3) curl -X POST .../namespace-stats -d '{\"namespace\": \"populated-ws\"}'","handlingStrategy":"validation","validationCode":"const namespaces = await client.get('/api/ext/vectors/namespaces'); // slugs that actually exist\nconst slugs = namespaces.map((n) => n.name);\nif (!slugs.includes(targetNamespace)) {\n  return { error: `Namespace '${targetNamespace}' has no embeddings — embed the workspace first` };\n}\nconst stats = await client.post('/api/ext/vectors/namespace-stats', { namespace: targetNamespace });","typeGuard":"async function namespaceIsPopulated(vectorDB, namespace) {\n  if (!namespace) return false;\n  try {\n    return await vectorDB.hasNamespace(namespace);\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  const stats = await vectorDB['namespace-stats']({ namespace });\n} catch (e) {\n  if (/does not exist/i.test(e.message)) {\n    // nothing to report on — surface 'workspace not embedded yet' to the caller\n    return { message: `Workspace '${namespace}' has no embedded documents yet.` };\n  }\n  throw e;\n}","preventionTips":["Check hasNamespace (or list namespaces) before stats/delete calls.","Embed documents immediately after workspace creation so namespaces exist early.","After recreating a vector index or resetting embeddings, re-embed all workspaces before querying stats.","Compare slugs exactly — copy them from the namespace list rather than retyping."],"tags":["pinecone","namespace","resource-not-found","api-contract","developer-api"],"backgroundTag":"resource-not-found","analyzedSha":"f92433b4ea0598492a1e6645ea22addbb4dd1287","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}