{"record":{"id":"cf203b9d9dab2b43","repo":"Fission-AI/OpenSpec","slug":"path-is-not-writable-targetpath","errorCode":null,"errorMessage":"Path is not writable: ${targetPath}","messagePattern":"Path is not writable: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/completions/installers/bash-installer.ts","lineNumber":259,"sourceCode":"          return {\n            success: true,\n            installedPath: targetPath,\n            message: 'Completion script is already installed (up to date)',\n            instructions: [\n              'The completion script is already installed and up to date.',\n              'If completions are not working, try: exec bash',\n            ],\n          };\n        }\n        // File exists but content is different - this is an update\n        isUpdate = true;\n      } catch (error: any) {\n        // File doesn't exist or can't be read, proceed with installation\n        console.debug(`Unable to read existing completion file at ${targetPath}: ${error.message}`);\n      }\n\n      if (!(await FileSystemUtils.canWriteFile(targetPath))) {\n        throw new Error(`Path is not writable: ${targetPath}`);\n      }\n\n      // Ensure the directory exists\n      const targetDir = path.dirname(targetPath);\n      await fs.mkdir(targetDir, { recursive: true });\n\n      // Backup existing file if updating\n      const backupPath = isUpdate ? await this.backupExistingFile(targetPath) : undefined;\n\n      // Write the completion script\n      await fs.writeFile(targetPath, completionScript, 'utf-8');\n\n      // Auto-configure .bashrc\n      const bashrcConfigured = await this.configureBashrc(targetDir);\n\n      // Generate instructions if .bashrc wasn't auto-configured\n      const instructions = bashrcConfigured ? undefined : this.generateInstructions(targetPath);\n","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/completions/installers/bash-installer.ts#L241-L277","documentation":"Error \"Path is not writable: ${targetPath}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/completions/installers/bash-installer.ts:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}