jordansissel/fpm · error · FPM::Util::ProcessFailed
#{program} failed (exit code #{exit_code}). Full command was
Error message
#{program} failed (exit code #{exit_code}). Full command was:#{args.inspect} What it means
FPM::Util.safesystem runs a child process and raises FPM::Util::ProcessFailed when the exit code is non-zero; the message includes the exit code and the full Ruby args array. The real cause was already printed by the failing tool on stderr — this exception is fpm's way of propagating that failure.
Source
Thrown at lib/fpm/util.rb:194
# Run a command safely in a way that gets reports useful errors.
def safesystem(*args)
# ChildProcess isn't smart enough to run a $SHELL if there's
# spaces in the first arg and there's only 1 arg.
if args.size == 1
args = [ default_shell, "-c", args[0] ]
end
if args[0].kind_of?(Hash)
env = args.shift()
exit_code = execmd(env, args)
else
exit_code = execmd(args)
end
program = args[0]
success = (exit_code == 0)
if !success
raise ProcessFailed.new("#{program} failed (exit code #{exit_code})" \
". Full command was:#{args.inspect}")
end
return success
end # def safesystem
# Run a command safely in a way that captures output and status.
def safesystemout(*args)
if args.size == 1
args = [ ENV["SHELL"], "-c", args[0] ]
end
program = args[0]
if !program.include?("/") and !program_in_path?(program)
raise ExecutableNotFound.new(program)
end
stdout_r_str = nil
exit_code = execmd(args, :stdin=>false, :stderr=>false) do |stdout|View on GitHub (pinned to b6d77ba72a)
Solutions
- Re-run with --log debug (or --verbose) to see the exact command, then run that command by hand to read the tool's real error
- Fix the metadata the tool complains about (classic: RPM-illegal characters in version/iteration)
- Install or upgrade the build tool for the target format in the build image
- Check disk space and permissions on the output and TMP directories
Example fix
# before: '-' is illegal in an RPM version, rpmbuild exits non-zero fpm -s dir -t rpm -v 1.0-beta2 -n app ./app # after fpm -s dir -t rpm -v 1.0.beta2 -n app ./app
Defensive patterns
Strategy: try-catch
Try / catch
begin pkg.output(path) rescue FPM::Util::ProcessFailed => e warn e.message # contains exit code and full args; run that command manually for the real error raise end
Prevention
- Re-run with --log debug to capture the exact failing command plus the tool's stderr
- Sanitize metadata for the target tool (e.g. no dashes in RPM versions)
- Pin modern rpmbuild/dpkg-deb versions in build images to avoid flag and format incompatibilities
When it happens
Trigger: rpmbuild rejecting invalid metadata (e.g. a version containing '-'); dpkg-deb failing on unreadable control files; gem build rejecting a malformed gemspec; ar/tar flag incompatibilities on old platforms; the child being killed by a signal.
Common situations: Missing or too-old build tools for the target type; --version/--iteration/--depends values that the target tool validates more strictly than fpm; filenames with spaces tripping downstream tools; disk exhaustion during package compression.
Related errors
- '#{editor}' failed (exit code #{$?.exitstatus}) Full command
- #{program}
- #{self.class.name} does not yet support reading #{self.type}
- #{self.class.name} does not yet support creating #{self.type
- Parent directory does not exist: #{File.dirname(output_path)
AI-assisted analysis of jordansissel/fpm@b6d77ba72a (2026-08-21).
Data as JSON: /api/errors/76a35e01d91e2fd7.
Report an issue: GitHub.