{"record":{"id":"8de39bd5a6116123","repo":"jordansissel/fpm","slug":"missing-data-tar-in-deb-source-package-package","errorCode":null,"errorMessage":"Missing data.tar in deb source package #{package}","messagePattern":"Missing data\\.tar in deb source package #(.+?)","errorType":"validation","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/deb.rb","lineNumber":488,"sourceCode":"    compression = `#{ar_cmd[0]} t #{package}`.split(\"\\n\").grep(/data.tar/).first.split(\".\").last\n    case compression\n      when \"gz\"\n        datatar = \"data.tar.gz\"\n        compression = \"-z\"\n      when \"bzip2\",\"bz2\"\n        datatar = \"data.tar.bz2\"\n        compression = \"-j\"\n      when \"xz\"\n        datatar = \"data.tar.xz\"\n        compression = \"-J\"\n      when \"zst\"\n        datatar = \"data.tar.zst\"\n        compression = \"--use-compress-program 'zstd -d'\"\n      when 'tar'\n        datatar = \"data.tar\"\n        compression = \"\"\n      when nil\n        raise FPM::InvalidPackageConfiguration, \"Missing data.tar in deb source package #{package}\"\n      else\n        raise FPM::InvalidPackageConfiguration,\n          \"Unknown compression type '#{compression}' for data.tar in deb source package #{package}\"\n    end\n\n    # unpack the data.tar.{gz,bz2,xz} from the deb package into staging_path\n    safesystem(ar_cmd[0] + \" p #{package} #{datatar} | tar #{compression} -xf - -C #{staging_path}\")\n  end # def extract_files\n\n  def output(output_path)\n    self.provides = self.provides.collect { |p| fix_provides(p) }\n\n    self.provides.each do |provide|\n      if !valid_provides_field?(provide)\n        raise FPM::InvalidPackageConfiguration, \"Found invalid Provides field values (#{provide.inspect}). This is not valid in a Debian package.\"\n      end\n    end\n    output_check(output_path)","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/deb.rb#L470-L506","documentation":"When reading a .deb, fpm lists the ar members, takes the first entry matching data.tar to derive its compression, and maps gz/bzip2/xz/zst/tar. If it cannot determine any compression for the data member, it raises FPM::InvalidPackageConfiguration saying the data.tar is missing from the source package.","triggerScenarios":"Converting a deb whose ar archive contains no recognizable data.tar.* member: corrupt/truncated .deb, a file that is not really a deb, or an ar archive where the data member is absent. Sibling error of the control.tar variant raised from extract_info.","commonSituations":"Partial downloads or interrupted artifact uploads; debs produced by nonstandard packagers that omit data.tar; files misnamed .deb; conversion of debs that failed mid-write on a full disk.","solutions":["Confirm the member list: ar t package.deb (expect debian-binary, control.tar.*, data.tar.*)","Re-download or rebuild the deb and retry the conversion","Validate with dpkg-deb -c package.deb to see if dpkg can read the data member at all"],"exampleFix":"# before\nfpm -s deb -t rpm truncated.deb\n\n# after\napt-get download foo\nfpm -s deb -t rpm foo_1.0_amd64.deb","handlingStrategy":"validation","validationCode":"members = `ar t #{Shellwords.escape(path)}`.split(\"\\n\")\nabort \"no data.tar member in #{path}\" unless members.any? { |m| m.start_with?('data.tar') }\n# also sanity-check payload readability the way dpkg does:\nsystem('dpkg-deb', '-c', path) || abort('dpkg cannot read data member either')","typeGuard":"def deb_with_data_member?(path)\n  File.file?(path) && `ar t #{Shellwords.escape(path)} 2>/dev/null`.split(\"\\n\").any? { |m| m =~ /\\Adata\\.tar(\\.|\\z)/ }\nend","tryCatchPattern":"begin\n  pkg.input(deb_path)\nrescue FPM::InvalidPackageConfiguration => e\n  raise unless e.message =~ /Missing data.tar/\n  abort \"#{deb_path} is corrupt (no data.tar member) -- re-fetch the artifact\"\nend","preventionTips":["Verify artifact checksums after download/upload to catch truncation before fpm sees it","Gate conversion jobs on an 'ar t' member-list check (debian-binary + control.tar.* + data.tar.*)","Confirm debs open cleanly with dpkg-deb -c before batch conversion"],"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"}