{"record":{"id":"3c29af32d70c30a7","repo":"golang/go","slug":"not-completely-extracted","errorCode":null,"errorMessage":"not completely extracted","messagePattern":"not completely extracted","errorType":"exception","errorClass":"DownloadDirPartialError","httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/modfetch/cache.go","lineNumber":113,"sourceCode":"\n\t// Check whether the directory itself exists.\n\tdir := filepath.Join(cfg.GOMODCACHE, enc+\"@\"+encVer)\n\tif fi, err := os.Stat(dir); os.IsNotExist(err) {\n\t\treturn dir, err\n\t} else if err != nil {\n\t\treturn dir, &DownloadDirPartialError{dir, err}\n\t} else if !fi.IsDir() {\n\t\treturn dir, &DownloadDirPartialError{dir, errors.New(\"not a directory\")}\n\t}\n\n\t// Check if a .partial file exists. This is created at the beginning of\n\t// a download and removed after the zip is extracted.\n\tpartialPath, err := CachePath(ctx, m, \"partial\")\n\tif err != nil {\n\t\treturn dir, err\n\t}\n\tif _, err := os.Stat(partialPath); err == nil {\n\t\treturn dir, &DownloadDirPartialError{dir, errors.New(\"not completely extracted\")}\n\t} else if !os.IsNotExist(err) {\n\t\treturn dir, err\n\t}\n\n\t// Special case: ziphash is not required for the golang.org/fips140 module,\n\t// because it is unpacked from a file in GOROOT, not downloaded.\n\t// We've already checked that it's not a partial unpacking, so we're happy.\n\tif m.Path == \"golang.org/fips140\" {\n\t\treturn dir, nil\n\t}\n\n\t// Check if a .ziphash file exists. It should be created before the\n\t// zip is extracted, but if it was deleted (by another program?), we need\n\t// to re-calculate it. Note that checkMod will repopulate the ziphash\n\t// file if it doesn't exist, but if the module is excluded by checks\n\t// through GONOSUMDB or GOPRIVATE, that check and repopulation won't happen.\n\tziphashPath, err := CachePath(ctx, m, \"ziphash\")\n\tif err != nil {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/modfetch/cache.go#L95-L131","documentation":"A `.partial` marker file is created at the start of a module download and removed once the zip is fully extracted. Its presence next to the module directory means extraction was interrupted, so DownloadDir returns a DownloadDirPartialError rather than a half-extracted directory.","triggerScenarios":"DownloadDir finds a `.partial` file in the cache alongside the module's extracted directory, indicating the download/extract did not finish.","commonSituations":"go mod download killed (Ctrl-C, OOM) mid-extraction; disk full during extraction; a concurrent go process died holding the partial marker; system crash or power loss during download.","solutions":["Run `go mod download <module>` again; the go command will detect the partial state and retry extraction.","If retries fail, run `go clean -modcache` and re-download from scratch.","Free disk space if the original extraction failed due to ENOSPC, then retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Detect the partial marker:\n//   if _, err := os.Stat(filepath.Join(dir, \".partial\")); err == nil {\n//     // incomplete extraction; remove and re-download\n//   }","typeGuard":null,"tryCatchPattern":"// On *modfetch.DownloadDirPartialError due to .partial, delete the\n// module dir and its .partial file, then `go mod download` again.","preventionTips":["Let `go mod download` finish; avoid killing it mid-extraction.","Ensure adequate disk space before large downloads."],"tags":["go","modules","cache","corruption"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}