multica-ai/multica · error
write temp config file: %w
Error message
write temp config file: %w
What it means
After creating the temp file, the write of the marshaled JSON failed. The temp file is closed and removed, so no partial file lingers. Typical causes are ENOSPC (disk filled during the write) or EIO on failing storage.
Source
Thrown at server/internal/cli/config.go:362
return fmt.Errorf("task-local CLI config directory %q escapes root %q", dir, root)
}
}
}
data, err := json.MarshalIndent(cfg, "", " ")
if err != nil {
return fmt.Errorf("encode CLI config: %w", err)
}
// Write to a temp file in the same directory, then rename for atomicity.
tmp, err := os.CreateTemp(dir, ".config-*.json.tmp")
if err != nil {
return fmt.Errorf("create temp config file: %w", err)
}
tmpPath := tmp.Name()
if _, err := tmp.Write(append(data, '\n')); err != nil {
tmp.Close()
os.Remove(tmpPath)
return fmt.Errorf("write temp config file: %w", err)
}
if err := tmp.Close(); err != nil {
os.Remove(tmpPath)
return fmt.Errorf("close temp config file: %w", err)
}
if err := os.Chmod(tmpPath, 0o600); err != nil {
os.Remove(tmpPath)
return fmt.Errorf("chmod temp config file: %w", err)
}
if err := os.Rename(tmpPath, path); err != nil {
os.Remove(tmpPath)
return fmt.Errorf("rename config file: %w", err)
}
return nil
}
View on GitHub (pinned to 2c0912b6ec)
Solutions
- Free disk space or raise the user quota on the affected filesystem
- If on NFS/network storage, remount or reconnect and retry the save
- Check dmesg/I/O errors for failing hardware
- Retry the command once space is available — the atomic rename means the old config (if any) is still intact
Defensive patterns
Strategy: retry
Try / catch
err := cli.SaveCLIConfig(cfg)
for attempt := 0; errors.Is(err, syscall.ENOSPC) && attempt < 2; attempt++ {
time.Sleep(time.Second)
err = cli.SaveCLIConfig(cfg)
} Prevention
- Treat ENOSPC/EIO on config writes as transient storage conditions: alert and retry
- Keep the config small and on reliable storage
- The temp-file cleanup means no partial file is left behind
When it happens
Trigger: SaveCLIConfig with the disk filling up between file creation and the (small) write, or a hardware/NFS write error surfacing at write() time.
Common situations: Home partition at 100% capacity; a flaky network mount dropping mid-write; disk quota exceeded for the user.
Related errors
- read --%s-file: %w
- create temp config file: %w
- close temp config file: %w
- Invalid desktop runtime config: expected a JSON object
- Unsupported desktop runtime config schemaVersion: expected 1
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/46b45ca94f6b3384.
Report an issue: GitHub.