{"record":{"id":"819fc6eecda55c94","repo":"bmad-code-org/BMAD-METHOD","slug":"label-is-not-readable-filepath","errorCode":null,"errorMessage":"${label} is not readable: ${filePath}","messagePattern":"(.+?) is not readable: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"tools/installer/core/install-paths.js","lineNumber":103,"sourceCode":"  try {\n    await fs.access(dirPath, fs.constants.R_OK);\n  } catch {\n    throw new Error(`${label} is not readable: ${dirPath}`);\n  }\n}\n\nasync function assertReadableFile(filePath, label) {\n  const stat = await fs.stat(filePath).catch(() => null);\n  if (!stat) {\n    throw new Error(`${label} does not exist: ${filePath}`);\n  }\n  if (!stat.isFile()) {\n    throw new Error(`${label} is not a file: ${filePath}`);\n  }\n  try {\n    await fs.access(filePath, fs.constants.R_OK);\n  } catch {\n    throw new Error(`${label} is not readable: ${filePath}`);\n  }\n}\n\nasync function ensureWritableDir(dirPath, label) {\n  const stat = await fs.stat(dirPath).catch(() => null);\n  if (stat && !stat.isDirectory()) {\n    throw new Error(`${label} exists but is not a directory: ${dirPath}`);\n  }\n\n  try {\n    await fs.ensureDir(dirPath);\n  } catch (error) {\n    if (error.code === 'EACCES') {\n      throw new Error(`${label}: permission denied creating directory: ${dirPath}`);\n    }\n    if (error.code === 'ENOSPC') {\n      throw new Error(`${label}: no space left on device: ${dirPath}`);\n    }","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/bmad-code-org/BMAD-METHOD/blob/b70486b9bdcb0a404d329e2a763b57964e7f1360/tools/installer/core/install-paths.js#L85-L121","documentation":"Thrown by assertReadableFile when the file exists and is a regular file but fs.access with R_OK fails — the process cannot read it. Isolates a pure permission problem on a file.","triggerScenarios":"assertReadableFile runs against package.json (or another required file) and the OS denies read access to the current user.","commonSituations":"File owned by another user with no world-read bit, restrictive umask, or a sandboxed environment that masks the file.","solutions":["Make the file readable: `chmod +r <filePath>`.","Run the installer as the file owner.","Adjust container/sandbox mount options to permit reads."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"await fs.access(filePath, fs.constants.R_OK);","typeGuard":null,"tryCatchPattern":"try {\n  await assertReadableFile(filePath, label);\n} catch (error) {\n  if (error.message.includes('is not readable')) { /* fix perms */ }\n  throw error;\n}","preventionTips":["Ensure required files are world-readable in packaged builds.","Run install as a user with read access to the source tree."],"tags":["filesystem","permissions","precondition","installer"],"backgroundTag":null,"analyzedSha":"b70486b9bdcb0a404d329e2a763b57964e7f1360","analyzedAt":"2026-08-13T01:21:12.247Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}