Mintplex-Labs/anything-llm · error · Error

Input file does not exist.

Error message

Input file ${inputPath} does not exist.

What it means

In the cached-vectors branch of addDocumentToNamespace, the code calls getOrCreateCollection and throws if the returned collection is falsy. getOrCreateCollection either returns getCollection(...) for an existing collection or creates then fetches it — a QdrantClient 404 would reject rather than resolve falsy, so this throw means the client resolved with an empty/unexpected payload: creation silently failed, or a client/server version mismatch changed the response shape.

Solutions

  1. Check whether the collection actually exists: curl $QDRANT_ENDPOINT/collections/<namespace> — 404 means creation failed, 200 means the client response shape was the problem.
  2. Look at Qdrant logs for collection creation errors; if OOM, give the container more memory/swap or reduce on_disk/optimizers settings.
  3. Align versions: use an @qdrant/js-client-rest version matching your Qdrant server series (client 1.x with server 1.x).
  4. Retry the embed once after fixing the cause — creation failures from transient memory pressure usually clear.

Example fix

# before - creation fails silently under memory pressure, code sees falsy collection
# (addDocumentToNamespace throws 'Failed to create new QDrant collection!')

# after - confirm and create manually, then re-embed
curl $QDRANT_ENDPOINT/collections/workspace-slug
# if 404, check qdrant logs for OOM; raise memory limit, then:
curl -X PUT $QDRANT_ENDPOINT/collections/workspace-slug \
  -H 'Content-Type: application/json' \
  -d '{"vectors":{"size":1536,"distance":"Cosine"}}'
# re-embed the workspace
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-create the collection so getOrCreateCollection takes the exists-branch
const exists = await client.getCollection(namespace).then(() => true).catch(() => false);
if (!exists) {
  const dim = chunks[0][0]?.vector?.length;
  await client.createCollection(namespace, { vectors: { size: dim, distance: 'Cosine' } });
}

Type guard

async function collectionReady(client, namespace) {
  const c = await client.getCollection(namespace).catch(() => null);
  return c != null && typeof c === 'object';
}

Try / catch

try {
  await qdrant.addDocumentToNamespace(namespace, payload);
} catch (e) {
  if (/Failed to create new QDrant collection/.test(e.message)) {
    // verify manually, fix root cause (usually RAM/version), then re-embed this document once
    const info = await client.getCollection(namespace).catch(() => null);
    if (!info) throw new Error('Collection creation rejected by Qdrant — check server logs (memory) and client/server versions');
    return retryEmbed(doc);
  }
  throw e;
}

Prevention

When it happens

Trigger: Qdrant returns an error-shaped object the code reads as falsy; collection creation rejected server-side (most often out-of-memory — Qdrant needs several GB of free RAM to create a collection); a race where the collection is deleted between the exists-check and getCollection; @qdrant/js-client-rest version returning a response shape the code does not expect.

Common situations: Small VPS/container Qdrant deployments hitting memory limits on first collection creation; mixing old client library with much newer Qdrant server (or vice versa); parallel embed jobs racing to create the same collection; collection manually deleted mid-ingest.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/be4f10f8471d7b3b. Report an issue: GitHub.

Appendix: source

Thrown at collector/utils/WhisperProviders/ffmpeg/index.js:83

      execSync(`"${pathToTest}" -version`, { encoding: "utf8", stdio: "pipe" });
      return true;
    } catch {
      return false;
    }
  }

  /**
   * Converts audio file to WAV format with required parameters for Whisper.
   * Output: 16k hz, mono, 32bit float.
   *
   * @param {string} inputPath - Input path for audio file (any format supported by ffmpeg)
   * @param {string} outputPath - Output path for converted file
   * @returns {Promise<boolean>}
   * @throws {Error} If ffmpeg binary cannot be found or conversion fails
   */
  async convertAudioToWav(inputPath, outputPath) {
    if (!fs.existsSync(inputPath))
      throw new Error(`Input file ${inputPath} does not exist.`);
    const outputDir = path.dirname(outputPath);
    if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });

    this.log(`Converting ${path.basename(inputPath)} to WAV format...`);
    // Convert to 16k hz mono 32f
    const result = spawnSync(
      await this.ffmpegPath(),
      [
        "-i",
        inputPath,
        "-ar",
        "16000",
        "-ac",
        "1",
        "-acodec",
        "pcm_f32le",
        "-y",
        outputPath,

View on GitHub (pinned to 3aec848f28)