{"record":{"id":"58f85e8ce23fec55","repo":"stablyai/orca","slug":"windows-inner-executable-path-is-not-a-file-exe","errorCode":null,"errorMessage":"Windows inner executable path is not a file: ${executablePath}","messagePattern":"Windows inner executable path is not a file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scripts/verify-windows-inner-signature.mjs","lineNumber":128,"sourceCode":"    `Subject: ${normalizeSignerSubject(signature.signerSubject) || '<missing>'}`,\n    `Issuer: ${signature.signerIssuer ?? '<missing>'}`,\n    `Thumbprint: ${normalizeThumbprint(signature.signerThumbprint) || '<missing>'}`,\n    `NotBefore: ${signature.notBefore ?? '<missing>'}`,\n    `NotAfter: ${signature.notAfter ?? '<missing>'}`\n  ].join('\\n')\n}\n\nexport function validateExecutablePath(executablePath) {\n  if (typeof executablePath !== 'string' || executablePath.trim() === '') {\n    throw new Error('Usage: node config/scripts/verify-windows-inner-signature.mjs <Orca.exe>')\n  }\n\n  if (!existsSync(executablePath)) {\n    throw new Error(`Windows inner executable does not exist: ${executablePath}`)\n  }\n\n  if (!statSync(executablePath).isFile()) {\n    throw new Error(`Windows inner executable path is not a file: ${executablePath}`)\n  }\n}\n\nexport function getPowerShellSignatureJson(executablePath, spawnSyncImpl = spawnSync) {\n  // Why: pwsh -Command does not reliably expose trailing process args to string commands.\n  const result = spawnSyncImpl(\n    'pwsh',\n    [\n      '-NoLogo',\n      '-NoProfile',\n      '-NonInteractive',\n      '-ExecutionPolicy',\n      'Bypass',\n      '-Command',\n      POWERSHELL_SIGNATURE_SCRIPT\n    ],\n    {\n      encoding: 'utf8',","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/verify-windows-inner-signature.mjs#L110-L146","documentation":"Thrown by validateExecutablePath() when the path exists but statSync().isFile() returns false — the path resolves to a directory, socket, device, or other non-regular-file. This guards against passing a directory path (e.g. the containing folder) instead of the .exe file.","triggerScenarios":"validateExecutablePath(executablePath) where existsSync is true but statSync(executablePath).isFile() is false. Caused by: passing a directory path instead of the .exe; passing a path to /dev/null or a named pipe; a symlink pointing to a directory.","commonSituations":"Passing the win-unpacked directory instead of Orca.exe inside it; passing a Squirrel app folder; a path glob that resolved to a directory; accidentally passing the build output directory rather than the executable within it.","solutions":["Point to the actual .exe file, not its parent directory.","If using a glob or variable, append the filename explicitly.","Verify with ls -la <path> that the entry is a regular file."],"exampleFix":"// before: directory path passed\nnode verify-windows-inner-signature.mjs ./Release/win-unpacked/\n\n// after: the exe file inside the directory\nnode verify-windows-inner-signature.mjs ./Release/win-unpacked/Orca.exe","handlingStrategy":"validation","validationCode":"function assertExecutableIsFile(path) {\n  const stat = statSync(path)\n  if (!stat.isFile()) {\n    throw new Error(`Path is not a regular file: ${path}`)\n  }\n}","typeGuard":"function isRegularFile(path) {\n  try { return statSync(path).isFile() } catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Always append the executable filename to directory paths in CI variables.","Validate path type before spawning PowerShell to fail fast with a clear message.","Use glob patterns that resolve to a single file, not a directory."],"tags":["windows","filesystem","path-validation","signature"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}