{"record":{"id":"6ffe1b71983eb7b9","repo":"Mintplex-Labs/anything-llm","slug":"qemu-directory-not-found-dir-ncontents-of-pa","errorCode":null,"errorMessage":"QEMU directory not found: ${dir}\\nContents of ${parent}: ${contents}\\nMake sure the QEMU archive is extracted so that the folder is named \"${variant}\" (not \"qemu-${variant}\" or a nested subfolder). You can also set OPEN_COMPUTER_QEMU_DIR to point to your QEMU installation.","messagePattern":"QEMU directory not found: (.+?)\\\\nContents of (.+?): (.+?)\\\\nMake sure the QEMU archive is extracted so that the folder is named \"(.+?)\" \\(not \"qemu-(.+?)\" or a nested subfolder\\)\\. You can also set OPEN_COMPUTER_QEMU_DIR to point to your QEMU installation\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-computer/cli/src/config.ts","lineNumber":35,"sourceCode":"// On Windows x64      the guest is x86_64  (WHPX + amd64 Debian).\n// On Windows arm64    the guest is aarch64 (WHPX + ARM64 Debian).\nexport const GUEST_ARCH: 'aarch64' | 'x86_64' = ARCH === 'x64' ? 'x86_64' : 'aarch64';\n\nexport const QEMU_BINARY =\n  GUEST_ARCH === 'aarch64' ? 'qemu-system-aarch64' : 'qemu-system-x86_64';\n\nfunction defaultQemuDir(): string {\n  if (PLATFORM === 'darwin') {\n    const darwinVariant = ARCH === 'x64' ? 'darwin-x64' : 'darwin-arm64';\n    return path.join(OPEN_COMPUTER_DIR, 'master', 'qemu', darwinVariant);\n  }\n  if (PLATFORM === 'win32') {\n    const variant = ARCH === 'x64' ? 'win-x64' : 'win-arm64';\n    const dir = path.join(OPEN_COMPUTER_DIR, 'master', 'qemu', variant);\n    if (!fs.existsSync(dir)) {\n      const parent = path.join(OPEN_COMPUTER_DIR, 'master', 'qemu');\n      const contents = fs.existsSync(parent) ? fs.readdirSync(parent).join(', ') : '(directory missing)';\n      throw new Error(\n        `QEMU directory not found: ${dir}\\n` +\n        `Contents of ${parent}: ${contents}\\n` +\n        `Make sure the QEMU archive is extracted so that the folder is named \"${variant}\" ` +\n        `(not \"qemu-${variant}\" or a nested subfolder). ` +\n        `You can also set OPEN_COMPUTER_QEMU_DIR to point to your QEMU installation.`\n      );\n    }\n    return dir;\n  }\n  // Linux: assume system QEMU\n  return '';\n}\n\nexport const QEMU_DIST = process.env.OPEN_COMPUTER_QEMU_DIR ?? defaultQemuDir();\n\n// Full path to the QEMU binary (with .exe on Windows)\nexport function resolveQemuBinary(): string {\n  const binaryName = PLATFORM === 'win32' ? `${QEMU_BINARY}.exe` : QEMU_BINARY;","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/open-computer/cli/src/config.ts#L17-L53","documentation":"Thrown by defaultQemuDir() in the open-computer CLI (config.ts) on Windows: the expected QEMU install directory <OPEN_COMPUTER_DIR>/master/qemu/win-x64|win-arm64 does not exist. The message is self-diagnosing — it prints the computed path, the parent directory's actual contents, and both supported remedies (name the extracted folder correctly, or point OPEN_COMPUTER_QEMU_DIR elsewhere). macOS builds a different path and Linux assumes system QEMU, so only Windows hits this.","triggerScenarios":"Running the CLI on Windows after downloading the QEMU archive but extracting it with its default top-level name (qemu-win-x64 instead of win-x64), leaving it nested one level deeper (win-x64/win-x64), or never extracting it at all — the fs.existsSync check fails and the error includes the parent listing showing what actually landed there.","commonSituations":"Archive extracted with the wrapper folder name intact; a second extraction nesting the folder; the master/qemu tree moved after a first successful run; ARM machine where win-arm64 was downloaded but a win-x64 folder was created manually.","solutions":["Rename/move the extracted folder so the path is exactly <OPEN_COMPUTER_DIR>/master/qemu/win-x64 (or win-arm64).","If extraction duplicated the folder, move the inner contents up one level so there is no nesting.","Alternatively set OPEN_COMPUTER_QEMU_DIR to wherever QEMU actually lives and retry.","Use the parent-directory listing printed in the message to see the exact name the folder got."],"exampleFix":"# before — archive extracted with its default name\nmaster/qemu/qemu-win-x64/qemu-system-x86_64.exe\n\n# after — rename so the variant is the folder name\nmv master/qemu/qemu-win-x64 master/qemu/win-x64\n# or: export OPEN_COMPUTER_QEMU_DIR=/c/tools/qemu-win-x64","handlingStrategy":"validation","validationCode":"// run before any code path that calls defaultQemuDir()\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nfunction resolveQemuDir(override?: string): string | null {\n  const variant = process.arch === 'x64' ? 'win-x64' : 'win-arm64';\n  const dir = override ?? path.join(OPEN_COMPUTER_DIR, 'master', 'qemu', variant);\n  return fs.existsSync(dir) ? dir : null;\n}\n\nconst qemuDir = resolveQemuDir(process.env.OPEN_COMPUTER_QEMU_DIR);\nif (!qemuDir) {\n  console.error('Set OPEN_COMPUTER_QEMU_DIR or extract QEMU to master/qemu/<variant>');\n  process.exit(1);\n}","typeGuard":"function isReadyQemuDir(dir: string | null | undefined): dir is string {\n  if (!dir) return false;\n  try {\n    return fs.statSync(dir).isDirectory();\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  const qemuDir = defaultQemuDir();\n} catch (e) {\n  // message already prints the expected path, the parent listing, and both fixes\n  console.error(e instanceof Error ? e.message : e);\n  process.exit(1);\n}","preventionTips":["Extract the QEMU archive so the variant name (win-x64 / win-arm64) is the immediate folder under master/qemu.","Prefer setting OPEN_COMPUTER_QEMU_DIR in scripts/CI over relying on a default extraction layout.","Check the directory exists in setup tooling so this fails at install time, not first run."],"tags":["qemu","windows","filesystem","configuration","open-computer"],"backgroundTag":"missing-required-directory","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}