{"record":{"id":"be4f10f8471d7b3b","repo":"Mintplex-Labs/anything-llm","slug":"input-file-inputpath-does-not-exist","errorCode":null,"errorMessage":"Input file ${inputPath} does not exist.","messagePattern":"Input file (.+?) does not exist\\.","errorType":"exception","errorClass":"Error","httpStatus":200,"severity":"error","filePath":"collector/utils/WhisperProviders/ffmpeg/index.js","lineNumber":83,"sourceCode":"      execSync(`\"${pathToTest}\" -version`, { encoding: \"utf8\", stdio: \"pipe\" });\n      return true;\n    } catch {\n      return false;\n    }\n  }\n\n  /**\n   * Converts audio file to WAV format with required parameters for Whisper.\n   * Output: 16k hz, mono, 32bit float.\n   *\n   * @param {string} inputPath - Input path for audio file (any format supported by ffmpeg)\n   * @param {string} outputPath - Output path for converted file\n   * @returns {Promise<boolean>}\n   * @throws {Error} If ffmpeg binary cannot be found or conversion fails\n   */\n  async convertAudioToWav(inputPath, outputPath) {\n    if (!fs.existsSync(inputPath))\n      throw new Error(`Input file ${inputPath} does not exist.`);\n    const outputDir = path.dirname(outputPath);\n    if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });\n\n    this.log(`Converting ${path.basename(inputPath)} to WAV format...`);\n    // Convert to 16k hz mono 32f\n    const result = spawnSync(\n      await this.ffmpegPath(),\n      [\n        \"-i\",\n        inputPath,\n        \"-ar\",\n        \"16000\",\n        \"-ac\",\n        \"1\",\n        \"-acodec\",\n        \"pcm_f32le\",\n        \"-y\",\n        outputPath,","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/collector/utils/WhisperProviders/ffmpeg/index.js#L65-L101","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check whether the collection actually exists: curl $QDRANT_ENDPOINT/collections/<namespace> — 404 means creation failed, 200 means the client response shape was the problem.","Look at Qdrant logs for collection creation errors; if OOM, give the container more memory/swap or reduce on_disk/optimizers settings.","Align versions: use an @qdrant/js-client-rest version matching your Qdrant server series (client 1.x with server 1.x).","Retry the embed once after fixing the cause — creation failures from transient memory pressure usually clear."],"exampleFix":"# before - creation fails silently under memory pressure, code sees falsy collection\n# (addDocumentToNamespace throws 'Failed to create new QDrant collection!')\n\n# after - confirm and create manually, then re-embed\ncurl $QDRANT_ENDPOINT/collections/workspace-slug\n# if 404, check qdrant logs for OOM; raise memory limit, then:\ncurl -X PUT $QDRANT_ENDPOINT/collections/workspace-slug \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"vectors\":{\"size\":1536,\"distance\":\"Cosine\"}}'\n# re-embed the workspace","handlingStrategy":"try-catch","validationCode":"// pre-create the collection so getOrCreateCollection takes the exists-branch\nconst exists = await client.getCollection(namespace).then(() => true).catch(() => false);\nif (!exists) {\n  const dim = chunks[0][0]?.vector?.length;\n  await client.createCollection(namespace, { vectors: { size: dim, distance: 'Cosine' } });\n}","typeGuard":"async function collectionReady(client, namespace) {\n  const c = await client.getCollection(namespace).catch(() => null);\n  return c != null && typeof c === 'object';\n}","tryCatchPattern":"try {\n  await qdrant.addDocumentToNamespace(namespace, payload);\n} catch (e) {\n  if (/Failed to create new QDrant collection/.test(e.message)) {\n    // verify manually, fix root cause (usually RAM/version), then re-embed this document once\n    const info = await client.getCollection(namespace).catch(() => null);\n    if (!info) throw new Error('Collection creation rejected by Qdrant — check server logs (memory) and client/server versions');\n    return retryEmbed(doc);\n  }\n  throw e;\n}","preventionTips":["Give Qdrant containers enough memory — collection creation is the most memory-hungry operation.","Pin @qdrant/js-client-rest to a version matching the Qdrant server series.","Pre-create collections during provisioning instead of lazily at first embed.","Serialize first-embed jobs per workspace to avoid create/delete races."],"tags":["qdrant","collection-creation","memory-limits","version-compatibility","data-ingestion"],"backgroundTag":"collection-creation-failed","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}