github/github-mcp-server · error
error writing to file: %v
Error message
error writing to file: %v
What it means
The translation key map dump got past file creation but file.Write failed. For a freshly created local file this is almost always ENOSPC (disk full) or a quota/IO error on the volume backing the working directory. Like 506 it flows through log.Fatalf in the TranslationHelper cleanup path.
Source
Thrown at pkg/translations/translations.go:75
}
// DumpTranslationKeyMap writes the translation map to a json file called github-mcp-server-config.json
func DumpTranslationKeyMap(translationKeyMap map[string]string) error {
file, err := os.Create("github-mcp-server-config.json")
if err != nil {
return fmt.Errorf("error creating file: %v", err)
}
defer func() { _ = file.Close() }()
// marshal the map to json
jsonData, err := json.MarshalIndent(translationKeyMap, "", " ")
if err != nil {
return fmt.Errorf("error marshaling map to JSON: %v", err)
}
// write the json data to the file
if _, err := file.Write(jsonData); err != nil {
return fmt.Errorf("error writing to file: %v", err)
}
return nil
}
View on GitHub (pinned to 0ea1f775a7)
Solutions
- Check free space on the working directory's volume (df -h) and free space
- Raise volume/quota limits or point workingDir at a larger volume
- Keep the dump out of the production path so shutdown never depends on disk state
Defensive patterns
Strategy: try-catch
Validate before calling
var stat syscall.Statfs_t
if err := syscall.Statfs(".", &stat); err == nil && stat.Bavail*uint64(stat.Bsize) < 1<<20 {
// under 1 MiB free: skip the dump rather than risk ENOSPC
} Try / catch
if err := translations.DumpTranslationKeyMap(m); err != nil {
log.Warn("translation dump failed (non-fatal for serving)", "err", err)
// never let an optional artifact abort startup or shutdown
} Prevention
- Monitor free space on the working volume
- Treat the config dump as an optional artifact - keep it out of the production path
- Run from a volume with headroom when generating dumps
When it happens
Trigger: Disk or volume quota exhausted at the moment the dump runs; transient IO errors on network-mounted working directories (NFS).
Common situations: Containers hitting emptyDir size limits; nodes with full disks; dumps running at process shutdown long after the disk filled.
Related errors
- error creating file: %v
- GitHub App authentication and GITHUB_PERSONAL_ACCESS_TOKEN a
- GitHub App authentication and OAuth login (--oauth-client-id
- GitHub App authentication requires a private key: set GITHUB
- GitHub App ID or client ID is required (GITHUB_APP_ID)
AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15).
Data as JSON: /api/errors/2b7aec89d939cfc4.
Report an issue: GitHub.