{"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":"warning","filePath":"collector/extensions/resync/index.js","lineNumber":58,"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 { success, reason, content } = await fetchConfluencePage({\n      pageUrl: `https:${source.pathname}`, // need to add back the real protocol\n      baseUrl: source.searchParams.get(\"baseUrl\"),\n      spaceKey: source.searchParams.get(\"spaceKey\"),\n      accessToken: source.searchParams.get(\"token\"),\n      username: source.searchParams.get(\"username\"),\n      cloud: source.searchParams.get(\"cloud\") === \"true\",\n      bypassSSL: source.searchParams.get(\"bypassSSL\") === \"true\",\n    });\n\n    if (!success)","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/collector/extensions/resync/index.js#L40-L76","documentation":"Thrown by resyncConfluence in collector/extensions/resync/index.js:58 when the destructured `chunkSource` field from the document metadata is falsy. The handler catches it and returns HTTP 200 with success:false, content:null.","triggerScenarios":"POST /ext/resync-source-document with { type: \"confluence\", options: {} } or options.chunkSource that is empty/null/undefined. The chunkSource is the encrypted payload the collector stored at original-scrape time so it can re-fetch the page later.","commonSituations":"Confluence document lost its chunkSource metadata (DB migration, manual edit); client passed the page URL instead of chunkSource; the document predates chunkSource-based resync.","solutions":["Pass options as { chunkSource: \"<encrypted payload string>\" } — the value originally written by the collector.","If chunkSource is missing, re-scrape the Confluence space afresh rather than resyncing.","Verify the document metadata row still contains chunkSource before calling resync."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function requireChunkSource(options) {\n  if (!options || typeof options.chunkSource !== \"string\" || options.chunkSource.length === 0) {\n    throw new Error(\"Invalid source property provided\");\n  }\n  return options.chunkSource;\n}\nconst chunkSource = requireChunkSource(options);","typeGuard":"/** @param {{chunkSource?: unknown}} o */\nfunction hasNonEmptyChunkSource(o) {\n  return o != null && typeof o.chunkSource === \"string\" && o.chunkSource.length > 0;\n}","tryCatchPattern":"const result = await resyncConfluence({ chunkSource }, response);\nif (result && result.success === false) handleMissingContent(result);","preventionTips":["Never overwrite document metadata chunkSource with null — resync depends on it.","If chunkSource is missing, re-scrape the Confluence space rather than calling resync.","Keep the encrypted payload opaque on the client; never re-encrypt by hand."],"tags":["validation","resync","confluence","request-payload"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}