{"record":{"id":"52602c37da241eff","repo":"kopia/kopia","slug":"lz4-compressor-is-not-supported-in-recent-versions","errorCode":null,"errorMessage":"LZ4 compressor is not supported in recent versions of kopia, version v0.22.3 or older is needed to read legacy repositories that use the LZ4 compressor","messagePattern":"LZ4 compressor is not supported in recent versions of kopia, version v0\\.22\\.3 or older is needed to read legacy repositories that use the LZ4 compressor","errorType":"exception","errorClass":"errLZ4NotSupported","httpStatus":null,"severity":"error","filePath":"repo/compression/compressor_lz4.go","lineNumber":12,"sourceCode":"package compression\n\nimport (\n\t\"errors\"\n\t\"io\"\n)\n\nfunc init() {\n\tregisterUnsupportedCompressor(\"lz4\", lz4Compressor{})\n}\n\nvar errLZ4NotSupported = errors.New(\"LZ4 compressor is not supported in recent versions of kopia, version v0.22.3 or older is needed to read legacy repositories that use the LZ4 compressor\")\n\ntype lz4Compressor struct{}\n\nfunc (c lz4Compressor) HeaderID() HeaderID {\n\treturn headerLZ4Removed\n}\n\nfunc (c lz4Compressor) Compress(_ io.Writer, _ io.Reader) error {\n\treturn errLZ4NotSupported\n}\n\nfunc (c lz4Compressor) Decompress(_ io.Writer, _ io.Reader, _ bool) error {\n\treturn errLZ4NotSupported\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/repo/compression/compressor_lz4.go#L1-L27","documentation":"errLZ4NotSupported indicates the LZ4 compressor was removed from Kopia. The stub lz4Compressor returns it from both Compress and Decompress; reading legacy LZ4 repositories requires Kopia v0.22.3 or older.","triggerScenarios":"Reading a repository whose format lists the 'lz4' compression algorithm (headerLZ4Removed) with a modern Kopia version; decompressing LZ4-compressed content.","commonSituations":"Upgrading an old Kopia repository that used lz4 compression and then trying to read old compressed content with the new binary.","solutions":["Re-compress the repository contents with a supported algorithm using Kopia v0.22.3 or older before upgrading","Use Kopia v0.22.3 or older to access legacy LZ4 data","Change compression settings for new data to a supported algorithm (e.g. zstd)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if comp.HeaderID() == compression.HeaderIDForAlgorithm(\"lz4\") {\n    return errors.New(\"lz4 compression is not supported by this kopia version\")\n}","typeGuard":null,"tryCatchPattern":"if err := compressor.Compress(w, r); err != nil {\n    if strings.Contains(err.Error(), \"LZ4 compressor is not supported\") {\n        return migrateLegacyRepository() // use kopia <= v0.22.3\n    }\n    return err\n}","preventionTips":["Avoid lz4 compression in repository settings; use zstd/gzip","Before upgrading, re-compress legacy contents using kopia v0.22.3 or older","Keep an old kopia binary available for legacy repository migration"],"tags":["go","compression","lz4","removed-feature","version-compatibility"],"backgroundTag":"deprecated-api-usage","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}