{"record":{"id":"27bb9ac7bae857a5","repo":"jordansissel/fpm","slug":"program","errorCode":null,"errorMessage":"#{program}","messagePattern":"#\\{program\\}","errorType":"exception","errorClass":"FPM::Util::ExecutableNotFound","httpStatus":null,"severity":"error","filePath":"lib/fpm/util.rb","lineNumber":136,"sourceCode":"      raise ArgumentError.new(\"missing argument: cmd\")\n    end\n\n    if i < args.size\n      if args[i].kind_of?(Hash)\n        opts = Hash[args[i].map {|k,v| [k.to_sym, v]} ]\n        i += 1\n      end\n    else\n      opts = Hash[]\n    end\n\n    opts[:process] = false unless opts.include?(:process)\n    opts[:stdin]   = true  unless opts.include?(:stdin)\n    opts[:stdout]  = true  unless opts.include?(:stdout)\n    opts[:stderr]  = true  unless opts.include?(:stderr)\n\n    if !program.include?(\"/\") and !program_in_path?(program)\n      raise ExecutableNotFound.new(program)\n    end\n\n    logger.info(\"Running command\", :args => args2)\n\n    stdout_r, stdout_w = IO.pipe\n    stderr_r, stderr_w = IO.pipe\n    stdin_r, stdin_w = IO.pipe\n\n    pid = Process.spawn(env, *args2, :out => stdout_w, :err => stderr_w, :in => stdin_r)\n\n    stdout_w.close; stderr_w.close\n    logger.debug(\"Process is running\", :pid => pid)\n    if block_given?\n      args3 = []\n      args3.push(process)           if opts[:process]\n      args3.push(stdin_w)           if opts[:stdin]\n      args3.push(stdout_r)          if opts[:stdout]\n      args3.push(stderr_r)          if opts[:stderr]","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/util.rb#L118-L154","documentation":"This is the generic guard inside FPM::Util#execmd (reached via safesystem): any program whose name contains no '/' must be found on PATH, otherwise ExecutableNotFound is raised with the bare program name as the message. Every external tool fpm drives (rpmbuild, dpkg-deb, gem, ar, tar, python, ...) passes through this check.","triggerScenarios":"Building RPMs without rpm-build installed (rpmbuild missing); deb targets without dpkg-deb; -t gem without the gem CLI; -s python without a python binary; any API call safesystem('tool', ...) with tool not installed.","commonSituations":"Build images missing the target format's toolchain; terse one-word errors ('rpmbuild') confusing CI logs; environments where fpm runs under cron/systemd with a stripped PATH.","solutions":["Install the tool named in the error message (e.g. apt-get install rpm for rpmbuild) — fpm's README lists per-target dependencies","Confirm 'which <program>' succeeds under the exact environment fpm runs in (CI container, cron PATH)","For API use, preflight with FPM::Util.program_in_path?(program) and fail with an actionable message"],"exampleFix":"# before\nfpm -s dir -t rpm ./app   # => ExecutableNotFound: rpmbuild\n\n# after\napt-get install -y rpm && fpm -s dir -t rpm ./app","handlingStrategy":"validation","validationCode":"require 'fpm/util'\n\nrequired = { 'rpm' => %w[rpmbuild rpm], 'deb' => %w[dpkg-deb ar] }\nrequired.fetch(ENV.fetch('FPM_TARGET', 'rpm')).each do |prog|\n  abort \"#{prog} not installed\" unless FPM::Util.program_in_path?(prog)\nend","typeGuard":null,"tryCatchPattern":"begin\n  safesystem('rpmbuild', '-bb', 'app.spec')\nrescue FPM::Util::ExecutableNotFound => e\n  abort \"missing tool '#{e.message}'; install the build dependencies for this target type\"\nend","preventionTips":["Install the documented per-target build dependencies in your build image","Preflight every external tool with program_in_path? when using the fpm API, failing with an actionable message","Run fpm inside the same container/PATH it will be used from in production, not from a richer host shell"],"tags":["fpm","subprocess","path","executable","build-dependencies"],"backgroundTag":"command-not-found","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}