cli/cli · error
failed write manifest file: %w
Error message
failed write manifest file: %w
What it means
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.
Source
Thrown at pkg/cmd/extension/manager.go:407
func generateMissingBinaryIssueBody(currentPlatform string) string {
return 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)
}
func writeManifest(dir, name string, data []byte) (writeErr error) {
path := filepath.Join(dir, name)
var f *os.File
if f, writeErr = os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600); writeErr != nil {
writeErr = fmt.Errorf("failed to open manifest for writing: %w", writeErr)
return
}
defer func() {
if err := f.Close(); writeErr == nil && err != nil {
writeErr = err
}
}()
if _, writeErr = f.Write(data); writeErr != nil {
writeErr = fmt.Errorf("failed write manifest file: %w", writeErr)
}
return
}
func (m *Manager) installGit(repo ghrepo.Interface, target string) error {
protocol := m.config.GitProtocol(repo.RepoHost()).Value
cloneURL := ghrepo.FormatRemoteURL(repo, protocol)
var commitSHA string
if target != "" {
var err error
commitSHA, err = fetchCommitSHA(m.client, repo, target)
if err != nil {
return err
}
}
name := strings.TrimSuffix(path.Base(cloneURL), ".git")View on GitHub (pinned to 0eeec0b92e)
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
Defensive patterns
Strategy: try-catch
Validate before calling
var stat syscall.Statfs_t
if err := syscall.Statfs(dataDir, &stat); err == nil && stat.Bavail*uint64(stat.Bsize) < 1<<20 { /* < 1MB free, abort before install */ } Try / catch
if err := m.Install(repo, target); err != nil {
var perr *fs.PathError
if errors.As(err, &perr) && (perr.Err == syscall.ENOSPC || perr.Err == syscall.EIO) { /* free space / check disk health, then retry */ }
} Prevention
- Check free disk space before batch-installing extensions
- Avoid home directories on flaky network mounts for gh data
When it happens
Trigger: 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.
Common situations: Full home partition; laptop disk failing with EIO; NFS/automount home that timed out mid-write; container hitting its writable-layer size limit.
Related errors
- failed to open manifest for writing: %w
- failed to write config after migration: %s
- failed to close file while handling write error: %v
- failed to write attestations: %v
- failed to close file: %w
AI-assisted analysis of cli/cli@0eeec0b92e (2026-08-15).
Data as JSON: /api/errors/a8478cc6fc84db84.
Report an issue: GitHub.