{"record":{"id":"3244d81c58293ebf","repo":"Fission-AI/OpenSpec","slug":"path-is-not-writable-targetpath-3244d8","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/fish-installer.ts","lineNumber":96,"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              'Fish automatically loads completions - they should be available immediately.',\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      // Determine appropriate message\n      let message: string;\n      if (isUpdate) {\n        message = backupPath\n          ? 'Completion script updated successfully (previous version backed up)'\n          : 'Completion script updated successfully';","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/completions/installers/fish-installer.ts#L78-L114","documentation":"Error \"Path is not writable: ${targetPath}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/completions/installers/fish-installer.ts:96 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"}