{"record":{"id":"a8478cc6fc84db84","repo":"cli/cli","slug":"failed-write-manifest-file-w","errorCode":null,"errorMessage":"failed write manifest file: %w","messagePattern":"failed write manifest file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/extension/manager.go","lineNumber":407,"sourceCode":"\nfunc generateMissingBinaryIssueBody(currentPlatform string) string {\n\treturn fmt.Sprintf(\"This extension does not support the %[1]s architecture. I tried to install it on a %[1]s machine, and it failed due to the lack of an available binary. Would you be able to update the extension's build and release process to include the relevant binary? For more details, see <https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions>.\", currentPlatform)\n}\n\nfunc writeManifest(dir, name string, data []byte) (writeErr error) {\n\tpath := filepath.Join(dir, name)\n\tvar f *os.File\n\tif f, writeErr = os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600); writeErr != nil {\n\t\twriteErr = fmt.Errorf(\"failed to open manifest for writing: %w\", writeErr)\n\t\treturn\n\t}\n\tdefer func() {\n\t\tif err := f.Close(); writeErr == nil && err != nil {\n\t\t\twriteErr = err\n\t\t}\n\t}()\n\tif _, writeErr = f.Write(data); writeErr != nil {\n\t\twriteErr = fmt.Errorf(\"failed write manifest file: %w\", writeErr)\n\t}\n\treturn\n}\n\nfunc (m *Manager) installGit(repo ghrepo.Interface, target string) error {\n\tprotocol := m.config.GitProtocol(repo.RepoHost()).Value\n\tcloneURL := ghrepo.FormatRemoteURL(repo, protocol)\n\n\tvar commitSHA string\n\tif target != \"\" {\n\t\tvar err error\n\t\tcommitSHA, err = fetchCommitSHA(m.client, repo, target)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tname := strings.TrimSuffix(path.Base(cloneURL), \".git\")","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/extension/manager.go#L389-L425","documentation":"The manifest file opened successfully but f.Write(data) failed inside writeManifest. Because the open already succeeded, this points at I/O-level failures during the actual write: ENOSPC (disk full), EIO (failing/detached disk), or the file living on a filesystem that went away mid-write.","triggerScenarios":"installBin writing the serialized manifest when the disk fills up exactly between open and write, the device errors (failing SSD, forced-unmounted USB), or network home dirs dropping.","commonSituations":"Full home partition; laptop disk failing with EIO; NFS/automount home that timed out mid-write; container hitting its writable-layer size limit.","solutions":["Check and free disk space: df -h $HOME","If on NFS/automount, verify the mount is alive and retry","Inspect dmesg/console for I/O errors pointing at failing hardware","Retry the install after resolving storage health"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var stat syscall.Statfs_t\nif err := syscall.Statfs(dataDir, &stat); err == nil && stat.Bavail*uint64(stat.Bsize) < 1<<20 { /* < 1MB free, abort before install */ }","typeGuard":null,"tryCatchPattern":"if err := m.Install(repo, target); err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) && (perr.Err == syscall.ENOSPC || perr.Err == syscall.EIO) { /* free space / check disk health, then retry */ }\n}","preventionTips":["Check free disk space before batch-installing extensions","Avoid home directories on flaky network mounts for gh data"],"tags":["extensions","filesystem","disk-full","manifest"],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}