{"record":{"id":"2b7aec89d939cfc4","repo":"github/github-mcp-server","slug":"error-writing-to-file-v","errorCode":null,"errorMessage":"error writing to file: %v","messagePattern":"error writing to file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/translations/translations.go","lineNumber":75,"sourceCode":"}\n\n// DumpTranslationKeyMap writes the translation map to a json file called github-mcp-server-config.json\nfunc DumpTranslationKeyMap(translationKeyMap map[string]string) error {\n\tfile, err := os.Create(\"github-mcp-server-config.json\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating file: %v\", err)\n\t}\n\tdefer func() { _ = file.Close() }()\n\n\t// marshal the map to json\n\tjsonData, err := json.MarshalIndent(translationKeyMap, \"\", \"  \")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error marshaling map to JSON: %v\", err)\n\t}\n\n\t// write the json data to the file\n\tif _, err := file.Write(jsonData); err != nil {\n\t\treturn fmt.Errorf(\"error writing to file: %v\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":57,"sourceCodeEnd":80,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/translations/translations.go#L57-L80","documentation":"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.","triggerScenarios":"Disk or volume quota exhausted at the moment the dump runs; transient IO errors on network-mounted working directories (NFS).","commonSituations":"Containers hitting emptyDir size limits; nodes with full disks; dumps running at process shutdown long after the disk filled.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var stat syscall.Statfs_t\nif err := syscall.Statfs(\".\", &stat); err == nil && stat.Bavail*uint64(stat.Bsize) < 1<<20 {\n\t// under 1 MiB free: skip the dump rather than risk ENOSPC\n}","typeGuard":null,"tryCatchPattern":"if err := translations.DumpTranslationKeyMap(m); err != nil {\n\tlog.Warn(\"translation dump failed (non-fatal for serving)\", \"err\", err)\n\t// never let an optional artifact abort startup or shutdown\n}","preventionTips":["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"],"tags":["go","filesystem","disk-full","translations"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}