{"record":{"id":"ef22ad3fd0000f2a","repo":"docker/compose","slug":"archiving-q-w","errorCode":null,"errorMessage":"archiving %q: %w","messagePattern":"archiving %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sync/tar.go","lineNumber":167,"sourceCode":"\t// (that's more in-line with how syncs work) might ignore files in earlier\n\t// path mappings when we know they're going to be \"synced\" over.\n\t// There's a bunch of subtle product decisions about how overlapping path\n\t// mappings work that we're not sure about.\n\tvar entries []archiveEntry\n\tfor _, p := range paths {\n\t\tnewEntries, err := a.entriesForPath(p.HostPath, p.ContainerPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"inspecting %q: %w\", p.HostPath, err)\n\t\t}\n\n\t\tentries = append(entries, newEntries...)\n\t}\n\n\tentries = dedupeEntries(entries)\n\tfor _, entry := range entries {\n\t\terr := a.writeEntry(entry)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"archiving %q: %w\", entry.path, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (a *ArchiveBuilder) writeEntry(entry archiveEntry) error {\n\tpathInTar := entry.path\n\theader := entry.header\n\n\tif header.Typeflag != tar.TypeReg {\n\t\t// anything other than a regular file (e.g. dir, symlink) just needs the header\n\t\tif err := a.tw.WriteHeader(header); err != nil {\n\t\t\treturn fmt.Errorf(\"writing %q header: %w\", pathInTar, err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tfile, err := os.Open(pathInTar)","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/internal/sync/tar.go#L149-L185","documentation":"After de-duplicating entries (last-one-wins), ArchivePathsIfExist writes each entry into the tar stream via writeEntry. Any failure inside writeEntry (header write, open, copy, flush) surfaces as 'archiving %q' for the specific entry path. It is the generic wrapper over the per-file write pipeline.","triggerScenarios":"writeEntry failing for entry.path: tar.Writer already in an error state (a prior failed WriteHeader poisons the writer), the file was deleted after walking but is not IsNotExist-classified, or any of the copy/flush errors documented in errors 105-109 for this particular entry.","commonSituations":"Rapidly churning directories during watch where files vanish or change size between the walk and the copy step; a preceding entry already corrupted the writer so every following entry fails with the wrap.","solutions":["Identify the named entry and check whether it still exists and is readable on the host","Look at the wrapped %w cause to route to the specific sub-error (header vs copy vs finalize) and apply the fix for errors 105/106/107/108/109","Stabilize the source tree during sync (pause generators, use .dockerignore-style exclusions for volatile temp files)","Retry the sync; transient vanish-during-copy of adjacent files is the usual cause and a fresh walk resolves it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify entry set is archivable: all entries exist and are readable post-walk\nfor _, e := range entries {\n    if fi, err := os.Stat(e.path); err != nil || fi.Mode()&0400 == 0 { exclude(e) }\n}","typeGuard":null,"tryCatchPattern":"// on 'archiving %q', inspect the wrapped cause; pipe-related causes redirect to container-side diagnosis, local causes to file fixes; then retry the whole sync","preventionTips":["Avoid in-place rewrites of synced files during active watch","Treat single 'archiving' failures as transient churn and re-sync before deep debugging"],"tags":["tar","sync","filesystem","go"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}