Mintplex-Labs/anything-llm · error · Error

Deepgram transcription failed - ${error.message}

Error message

Deepgram transcription failed - ${error.message}

What it means

The outer .catch wrapper around the entire Deepgram transcribe promise chain. It logs the failure and re-throws a generic 'Deepgram transcription failed - <message>' error. Because the inner !response.ok branch (error 367) throws and then this catch re-wraps it, a failed HTTP request surfaces here as a nested message. It also catches network/JSON-parse errors that never produced a response.

Source

Thrown at server/utils/SpeechToText/deepgram/index.js:74

      body: audioBuffer,
    })
      .then(async (response) => {
        if (!response.ok) {
          const errBody = await response.text().catch(() => "");
          throw new Error(
            `Deepgram transcription failed (${response.status}) - ${errBody}`
          );
        }
        return response.json();
      })
      .then((result) => {
        return (
          result?.results?.channels?.[0]?.alternatives?.[0]?.transcript ?? ""
        );
      })
      .catch((error) => {
        this.#log(`Deepgram transcription failed - ${error.message}`);
        throw new Error(`Deepgram transcription failed - ${error.message}`);
      });
  }
}

module.exports = { DeepgramSTT };

View on GitHub (pinned to 526360e320)

Solutions

  1. If the inner message contains an HTTP status, follow the fix for error 367.
  2. If the message is a network error (fetch failed / ECONNREFUSED / ENOTFOUND), check container egress, DNS, and proxy settings.
  3. Add retry with exponential backoff for transient failures before surfacing to the user.
  4. Verify outbound connectivity: curl -I https://api.deepgram.com from the host/container.
Defensive patterns

Strategy: try-catch

Validate before calling

// Network reachability check before transcription.
const ok = await fetch("https://api.deepgram.com", { method: "HEAD" })
  .then(() => true)
  .catch(() => false);
if (!ok) throw new Error("Cannot reach api.deepgram.com from this host.");

Try / catch

try {
  return await deepgram.transcribe(audioBuffer, filename);
} catch (e) {
  logger.error("Deepgram STT failed:", e.message);
  // optionally fall back to another STT provider here
  throw e;
}

Prevention

When it happens

Trigger: Any unhandled rejection inside transcribe: a network/DNS failure reaching api.deepgram.com, a malformed JSON response, or the re-thrown HTTP error from the inner check. The caller sees this flattened message.

Common situations: Container has no outbound internet; corporate proxy/firewall blocking api.deepgram.com; transient network blip; response.ok was true but body was not JSON.

Related errors


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