{"record":{"id":"e558f8603a0607bf","repo":"Fission-AI/OpenSpec","slug":"path-is-not-writable-targetpath-e558f8","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/zsh-installer.ts","lineNumber":273,"sourceCode":"            success: true,\n            installedPath: targetPath,\n            isOhMyZsh,\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 zsh',\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 .zshrc for standard Zsh only.\n      // Oh My Zsh loads custom/completions and runs compinit itself.\n      let zshrcConfigured = false;\n      if (!isOhMyZsh) {\n        zshrcConfigured = await this.configureZshrc(targetDir);\n      }","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/completions/installers/zsh-installer.ts#L255-L291","documentation":"Thrown by the zsh completion installer's install routine when the target install path (completion directory or file) is not writable by the current user. The install/update of the completion script cannot proceed; the at-fault input is targetPath, and the user typically needs to fix directory permissions or choose another install location.","triggerScenarios":"Thrown at src/core/completions/installers/zsh-installer.ts:273 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check permissions on the zsh completion directory (~/.zsh/completions or the Oh My Zsh custom dir)","Create the directory if missing and ensure it is user-writable","Retry installation after restoring write access"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}