{"record":{"id":"51da92c0de65face","repo":"jordansissel/fpm","slug":"unsupported-version-string-parse-call-version","errorCode":null,"errorMessage":"Unsupported version string '#{parse.call(\"Version\")}'","messagePattern":"Unsupported version string '#(.+?)'","errorType":"validation","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/deb.rb","lineNumber":391,"sourceCode":"      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\n          logger.info(\"deb field\", field => value.split(\": \", 2).last)\n          return value.split(\": \",2).last\n        end\n      end\n\n      # Parse 'epoch:version-iteration' in the version string\n      version_re = /^(?:([0-9]+):)?(.+?)(?:-(.*))?$/\n      m = version_re.match(parse.call(\"Version\"))\n      if !m\n        raise FPM::InvalidPackageConfiguration, \"Unsupported version string '#{parse.call(\"Version\")}'\"\n      end\n      self.epoch, self.version, self.iteration = m.captures\n\n      self.architecture = parse.call(\"Architecture\")\n      self.category = parse.call(\"Section\")\n      self.license = parse.call(\"License\") || self.license\n      self.maintainer = parse.call(\"Maintainer\")\n      self.name = parse.call(\"Package\")\n      self.url = parse.call(\"Homepage\")\n      self.vendor = parse.call(\"Vendor\") || self.vendor\n      parse.call(\"Provides\").tap do |provides_str|\n        next if provides_str.nil?\n        self.provides = provides_str.split(/\\s*,\\s*/)\n      end\n\n      # The description field is a special flower, parse it that way.\n      # The description is the first line as a normal Description field, but also continues\n      # on future lines indented by one space, until the end of the file. Blank","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/deb.rb#L373-L409","documentation":"After extracting control.tar from a deb, fpm parses the Version field with the regex /^(?:([0-9]+):)?(.+?)(?:-(.*))?$/ and assigns epoch/version/iteration from the captures. If the match fails (m is nil), it raises FPM::InvalidPackageConfiguration with the parsed Version value. Since this regex matches almost any non-empty string, the realistic failures are a missing Version field (parse returns nil) or an empty one.","triggerScenarios":"Reading a deb whose control file has no Version: line at all, or a Version: line with an empty value -- typically hand-crafted or corrupted control.tar contents rather than anything dpkg would produce.","commonSituations":"Converting debs generated by custom in-house packagers that skip required fields; artifacts corrupted in storage; debs whose control member was edited/truncated (partial write) before conversion.","solutions":["Inspect the control file: dpkg-deb -f package.deb Version (or ar p package.deb control.tar.gz | tar -xzO ./control) to see what Version actually contains","Rebuild or re-fetch the deb from a source that emits a proper Version field","If you own the producer, make it write a valid Version per Debian policy ([epoch:]upstream[-revision])"],"exampleFix":"# before\nfpm -s deb -t rpm handmade.deb   # control has no Version field\n\n# after\n# fix the producer, or patch the field before converting:\ndpkg-deb -R handmade.deb /tmp/x\necho 'Version: 1.0-1' >> /tmp/x/DEBIAN/control\ndpkg-deb -b /tmp/x /tmp/handmade-fixed.deb\nfpm -s deb -t rpm /tmp/handmade-fixed.deb","handlingStrategy":"validation","validationCode":"version = `dpkg-deb -f #{Shellwords.escape(path)} Version 2>/dev/null`.to_s.strip\nabort 'deb has no Version field' if version.empty?\nm = /\\A(?:([0-9]+):)?(.+?)(?:-(.*))?\\z/.match(version)\nabort \"unparseable Version field: #{version.inspect}\" if m.nil?","typeGuard":"def deb_version_parseable?(version_str)\n  !version_str.nil? && !version_str.empty? &&\n    !(/\\A(?:([0-9]+):)?(.+?)(?:-(.*))?\\z/.match(version_str)).nil?\nend","tryCatchPattern":"begin\n  pkg.input(path)\nrescue FPM::InvalidPackageConfiguration => e\n  raise unless e.message =~ /Unsupported version string/\n  abort \"#{path} control lacks a valid Version field; fix or rebuild the artifact\"\nend","preventionTips":["Validate debs with dpkg-deb -f <deb> Version (and dpkg-deb --info generally) before conversion","When generating debs in-house, always emit a Version field per Debian policy","In pipelines, treat a missing/empty required control field as a producer bug, not a converter bug"],"tags":["fpm","deb","version","input","missing-field","packaging"],"backgroundTag":"missing-required-metadata-field","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}