{"record":{"id":"ea88c6cea062758d","repo":"jordansissel/fpm","slug":"missing-control-tar-in-deb-source-package-packag","errorCode":null,"errorMessage":"Missing control.tar in deb source package #{package}","messagePattern":"Missing control\\.tar in deb source package #(.+?)","errorType":"validation","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/deb.rb","lineNumber":363,"sourceCode":"    compression = `#{ar_cmd[0]} t #{package}`.split(\"\\n\").grep(/control.tar/).first.split(\".\").last\n    case compression\n      when \"gz\"\n        controltar = \"control.tar.gz\"\n        compression = \"-z\"\n      when \"bzip2\",\"bz2\"\n        controltar = \"control.tar.bz2\"\n        compression = \"-j\"\n      when \"xz\"\n        controltar = \"control.tar.xz\"\n        compression = \"-J\"\n      when \"zst\"\n        controltar = \"control.tar.zst\"\n        compression = \"--use-compress-program 'zstd -d'\"\n      when 'tar'\n        controltar = \"control.tar\"\n        compression = \"\"\n      when nil\n        raise FPM::InvalidPackageConfiguration, \"Missing control.tar in deb source package #{package}\"\n      else\n        raise FPM::InvalidPackageConfiguration,\n          \"Unknown compression type '#{compression}' for control.tar in deb source package #{package}\"\n    end\n\n    build_path(\"control\").tap do |path|\n      FileUtils.mkdir(path) if !File.directory?(path)\n      # unpack the control.tar.{,gz,bz2,xz,zst} from the deb package into staging_path\n      # Unpack the control tarball\n      safesystem(ar_cmd[0] + \" p #{package} #{controltar} | tar #{compression} -xf - -C #{path}\")\n\n      control = File.read(File.join(path, \"control\"))\n\n      parse = lambda do |field|\n        value = control[/^#{field.capitalize}: .*/]\n        if value.nil?\n          return nil\n        else","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/deb.rb#L345-L381","documentation":"When fpm reads a .deb (e.g. fpm -s deb -t rpm), it lists the ar members with 'ar t' and takes the first entry matching control.tar to derive the compression suffix. The case statement maps gz/bzip2/xz/zst/tar; the nil branch raises FPM::InvalidPackageConfiguration because fpm could not identify any control.tar.* member in a form it recognizes.","triggerScenarios":"Pointing -s deb at a file that is not a valid deb, or an ar archive whose control member is absent or named so that no compression suffix can be derived. Frequently the real cause is a corrupt/truncated download or an HTML error page saved with a .deb extension, so the ar listing has no control.tar member at all.","commonSituations":"Converting a partially downloaded .deb; a file renamed to .deb that is actually something else; artifacts produced by nonstandard tools that omit control.tar; disk-full truncation during artifact storage.","solutions":["Verify the file is a real deb: ar t package.deb should list debian-binary, control.tar.*, data.tar.*","Re-download or restore the deb from its original source (apt-get download, apt cache) and retry","Check the file with dpkg-deb -I package.deb to confirm dpkg itself can read it","If the producer is your own pipeline, fix it to emit a standards-compliant deb"],"exampleFix":"# before\nfpm -s deb -t rpm broken.deb   # corrupt file\n\n# after\n# re-fetch a good artifact first:\napt-get download foo\nfpm -s deb -t rpm foo_1.0_amd64.deb","handlingStrategy":"validation","validationCode":"def readable_deb?(path)\n  return false unless File.file?(path)\n  members = `ar t #{Shellwords.escape(path)}`.split(\"\\n\")\n  members.include?('debian-binary') && members.any? { |m| m.start_with?('control.tar') }\nend\n\nabort \"not a usable deb: #{path}\" unless readable_deb?(path)","typeGuard":"def deb_with_control_member?(path)\n  File.file?(path) && `ar t #{Shellwords.escape(path)} 2>/dev/null`.split(\"\\n\").any? { |m| m =~ /\\Acontrol\\.tar(\\.|\\z)/ }\nend","tryCatchPattern":"begin\n  pkg.input(deb_path)\nrescue FPM::InvalidPackageConfiguration => e\n  raise unless e.message =~ /Missing control.tar/\n  abort \"#{deb_path} is corrupt (no control.tar member) -- re-download the artifact\"\nend","preventionTips":["Checksum-verify downloaded debs before conversion pipelines","Reject files whose 'ar t' listing lacks debian-binary/control.tar/data.tar up front","Treat conversion of non-dpkg-produced files as suspect: validate with dpkg-deb -I first"],"tags":["fpm","deb","input","corrupt-file","ar-archive","packaging"],"backgroundTag":"malformed-package-archive","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}