Mintplex-Labs/anything-llm · error · Error

Failed to sync YouTube video transcript. ${reason}

Error message

Failed to sync YouTube video transcript. ${reason}

What it means

Thrown by resyncYouTube in collector/extensions/resync/index.js:40 when fetchVideoTranscriptContent({ url: link }) from collector/utils/extensions/YoutubeTranscript resolves with success:false. The interpolated `reason` carries the upstream cause (transcript unavailable, fetch error, invalid video). Handler catches and answers HTTP 200 with success:false, content:null.

Source

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

/**
 * Fetches the content of a YouTube link. Returns the content as a text string of the video in question.
 * We offer this as there may be some videos where a transcription could be manually edited after initial scraping
 * but in general - transcriptions often never change.
 * @param {object} data - metadata from document (eg: link)
 * @param {import("../../middleware/setDataSigner").ResponseWithSigner} response
 */
async function resyncYouTube({ link }, response) {
  if (!link) throw new Error("Invalid link provided");
  try {
    const {
      fetchVideoTranscriptContent,
    } = require("../../utils/extensions/YoutubeTranscript");
    const { success, reason, content } = await fetchVideoTranscriptContent({
      url: link,
    });
    if (!success)
      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");

View on GitHub (pinned to 526360e320)

Solutions

  1. Open the video URL in a browser from the collector host to confirm it is public and has captions.
  2. Check `reason` in the error for the upstream detail (e.g. "Video has no transcript").
  3. Retry after transient failures; for permanent caption removal, drop or re-add the document.
  4. Make sure the collector's outbound network/DNS to youtube.com works.
Defensive patterns

Strategy: fallback

Try / catch

try { await resyncYouTube({ link }, response); }
catch (e) {
  if (e.message.startsWith("Failed to sync YouTube video transcript.")) {
    const upstream = e.message.replace("Failed to sync YouTube video transcript. ", "");
    if (/no (captions|transcript)|unavailable|private/i.test(upstream)) {
      keepExistingContent();   // do not overwrite with null
    } else {
      scheduleRetry();         // transient
    }
  }
}

Prevention

When it happens

Trigger: Video has no captions/subtitles; video is private, age-restricted, members-only, region-blocked, or removed; YouTube changed its inner HTML; transient network/HTTP failure from the collector to youtube.com.

Common situations: Re-syncing auto-generated-only videos where the auto transcript was disabled; corporate egress blocked; YouTube layout change breaks the scraper; rate limiting.

Related errors


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