Mintplex-Labs/anything-llm · warning · Error

Invalid source property provided

Error message

Invalid source property provided

What it means

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.

Source

Thrown at collector/extensions/resync/index.js:58

      throw new Error(`Failed to sync YouTube video transcript. ${reason}`);
    response.status(200).json({ success, content });
  } catch (e) {
    console.error(e);
    response.status(200).json({
      success: false,
      content: null,
    });
  }
}

/**
 * Fetches the content of a specific confluence page via its chunkSource.
 * Returns the content as a text string of the page in question and only that page.
 * @param {object} data - metadata from document (eg: chunkSource)
 * @param {import("../../middleware/setDataSigner").ResponseWithSigner} response
 */
async function resyncConfluence({ chunkSource }, response) {
  if (!chunkSource) throw new Error("Invalid source property provided");
  try {
    // Confluence data is `payload` encrypted. So we need to expand its
    // encrypted payload back into query params so we can reFetch the page with same access token/params.
    const source = response.locals.encryptionWorker.expandPayload(chunkSource);
    const {
      fetchConfluencePage,
    } = require("../../utils/extensions/Confluence");
    const { success, reason, content } = await fetchConfluencePage({
      pageUrl: `https:${source.pathname}`, // need to add back the real protocol
      baseUrl: source.searchParams.get("baseUrl"),
      spaceKey: source.searchParams.get("spaceKey"),
      accessToken: source.searchParams.get("token"),
      username: source.searchParams.get("username"),
      cloud: source.searchParams.get("cloud") === "true",
      bypassSSL: source.searchParams.get("bypassSSL") === "true",
    });

    if (!success)

View on GitHub (pinned to 526360e320)

Solutions

  1. Pass options as { chunkSource: "<encrypted payload string>" } — the value originally written by the collector.
  2. If chunkSource is missing, re-scrape the Confluence space afresh rather than resyncing.
  3. Verify the document metadata row still contains chunkSource before calling resync.
Defensive patterns

Strategy: validation

Validate before calling

function requireChunkSource(options) {
  if (!options || typeof options.chunkSource !== "string" || options.chunkSource.length === 0) {
    throw new Error("Invalid source property provided");
  }
  return options.chunkSource;
}
const chunkSource = requireChunkSource(options);

Type guard

/** @param {{chunkSource?: unknown}} o */
function hasNonEmptyChunkSource(o) {
  return o != null && typeof o.chunkSource === "string" && o.chunkSource.length > 0;
}

Try / catch

const result = await resyncConfluence({ chunkSource }, response);
if (result && result.success === false) handleMissingContent(result);

Prevention

When it happens

Trigger: 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.

Common situations: Confluence document lost its chunkSource metadata (DB migration, manual edit); client passed the page URL instead of chunkSource; the document predates chunkSource-based resync.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/118c25afe05e8dbd. Report an issue: GitHub.