{"record":{"id":"fbf078114270770c","repo":"jordansissel/fpm","slug":"deb-compression-value-of-value-is-invalid-mu","errorCode":null,"errorMessage":"deb compression value of '#{value}' is invalid. Must be one of #{COMPRESSION_TYPES.join(\", \")}","messagePattern":"deb compression value of '#(.+?)' is invalid\\. Must be one of #(.+?)","errorType":"validation","errorClass":"FPM::Package::InvalidArgument","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/deb.rb","lineNumber":76,"sourceCode":"            \"version. Default is to be specific. This option allows the same \" \\\n            \"version of a package but any iteration is permitted\"\n\n  option \"--build-depends\", \"DEPENDENCY\",\n    \"Add DEPENDENCY as a Build-Depends\" do |dep|\n    @build_depends ||= []\n    @build_depends << dep\n  end\n\n  option \"--pre-depends\", \"DEPENDENCY\",\n    \"Add DEPENDENCY as a Pre-Depends\" do |dep|\n    @pre_depends ||= []\n    @pre_depends << dep\n  end\n\n  option \"--compression\", \"COMPRESSION\", \"The compression type to use, must \" \\\n    \"be one of #{COMPRESSION_TYPES.join(\", \")}.\", :default => \"gz\" do |value|\n    if !COMPRESSION_TYPES.include?(value)\n      raise FPM::Package::InvalidArgument, \"deb compression value of '#{value}' is invalid. \" \\\n        \"Must be one of #{COMPRESSION_TYPES.join(\", \")}\"\n    end\n    value\n  end\n\n  option \"--compression-level\", \"[0-9]\", \"Select a compression level. 0 is none or minimal. 9 is max compression.\",\n    # Specify which compression level to use on the compressor backend, when building a package\n    :default => nil do |value|\n    valint = value.to_i\n    # if self.attributes[:deb_compression].nil?\n    #   raise \"Can't specify a compression level with compression disabled\"\n    # end\n    unless value =~ /^\\d$/ && valint >= 0 && valint <= 9\n      raise \"Invalid compression level '#{value}'. Valid values are integers between 0 and 9 inclusive.\"\n    end\n    valint\n  end\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/deb.rb#L58-L94","documentation":"The --deb-compression option accepts only the values in FPM::Package::Deb::COMPRESSION_TYPES: gz, bzip2, xz, zst, none. The option block validates the value at parse time and raises FPM::Package::InvalidArgument with this message for anything else, before any packaging work starts.","triggerScenarios":"Passing an unsupported compression name on the CLI or via the deb_compression attribute: --deb-compression zstd (dpkg's name), gzip, bz2, lzma, lz4, or misspellings like 'none ' with whitespace. Note the exact spellings: 'bzip2' not 'bz2', 'zst' not 'zstd'.","commonSituations":"Copy-pasting dpkg-deb or tar flag names into fpm; scripts written for other fpm target types (pacman uses 'zstd'); CI configs parameterizing compression from a variable that drifts from the allowed set.","solutions":["Use one of the allowed values: gz, bzip2, xz, zst, none","Check for typos and surrounding whitespace/shell quoting in the value","If you need a different compressor, build with 'none' and compress the data.tar member yourself afterwards"],"exampleFix":"# before\nfpm -s dir -t deb -n foo --deb-compression zstd .\n\n# after\nfpm -s dir -t deb -n foo --deb-compression zst .","handlingStrategy":"validation","validationCode":"ALLOWED = FPM::Package::Deb::COMPRESSION_TYPES   # ['gz','bzip2','xz','zst','none']\nabort \"bad --deb-compression '#{value}'; use one of #{ALLOWED.join(', ')}\" unless ALLOWED.include?(value)","typeGuard":"def valid_deb_compression?(value)\n  FPM::Package::Deb::COMPRESSION_TYPES.include?(value)\nend","tryCatchPattern":"begin\n  pkg.output(out)\nrescue FPM::Package::InvalidArgument => e\n  abort \"compression rejected: #{e.message}\"   # fix the flag/attribute value and rerun\nend","preventionTips":["Whitelist compression values in CI templates against COMPRESSION_TYPES instead of passing raw variables","Remember the deb spellings: bzip2 (not bz2), zst (not zstd)","Fail fast in wrappers before invoking fpm when templating compression from external config"],"tags":["fpm","deb","compression","option-validation","packaging"],"backgroundTag":"invalid-option-value","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}