{"record":{"id":"e797fd3b5f197df8","repo":"jordansissel/fpm","slug":"options-file-given-to-fpm-options-file-is-seems","errorCode":null,"errorMessage":"Options file given to --fpm-options-file is seems too large. For safety, fpm is refusing to load this. Path: #{path} - Size: #{stat.size}, maximum allowed size #{max}.","messagePattern":"Options file given to --fpm-options-file is seems too large\\. For safety, fpm is refusing to load this\\. Path: #(.+?) - Size: #(.+?), maximum allowed size #(.+?)\\.","errorType":"validation","errorClass":"FPM::Package::InvalidArgument","httpStatus":null,"severity":"error","filePath":"lib/fpm/command.rb","lineNumber":630,"sourceCode":"\n    if !File.exist?(path)\n      logger.fatal(\"Cannot load options from file because the file doesn't exist.\", :path => path)\n    end\n\n    if !File.readable?(path)\n      logger.fatal(\"Cannot load options from file because the file isn't readable.\", :path => path)\n    end\n\n    @loaded_files << path\n\n    logger.info(\"Loading flags from file\", :path => path)\n\n    # Safety check, abort if the file is huge. Arbitrarily chosen limit is 100kb\n    stat = File.stat(path)\n    max = 100 * 1024\n    if stat.size > max\n      logger.fatal(\"Refusing to load options from file because the file seems pretty large.\", :path => path, :size => stat.size)\n      raise FPM::Package::InvalidArgument, \"Options file given to --fpm-options-file is seems too large. For safety, fpm is refusing to load this. Path: #{path} - Size: #{stat.size}, maximum allowed size #{max}.\"\n    end\n\n    File.read(path).split($/).each do |line|\n      logger.info(\"Processing flags from file\", :path => path, :line => line)\n      # With apologies for this hack to mdub (Mike Williams, author of Clamp)...\n      # The following code will read a file and parse the file\n      # as flags as if they were in same argument position as the given --fpm-options-file option.\n\n      args = Shellwords.split(line)\n      while args.any?\n        arg = args.shift\n\n        # Lookup the Clamp option by its --flag-name or short  name like -f\n        if arg =~ /^-/\n          # Single-letter options like -a or -z\n          if single_letter = arg.match(/^(-[A-Za-z0-9])(.*)$/)\n            option = self.class.find_option(single_letter.match(1))\n            arg, remainder = single_letter.match(1), single_letter.match(2)","sourceCodeStart":612,"sourceCodeEnd":648,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/command.rb#L612-L648","documentation":"As a safety valve, load_options refuses options files larger than 100 KiB (100 * 1024 bytes, checked via File.stat). Larger files raise FPM::Package::InvalidArgument with the observed size and the limit — usually a sign the wrong file was referenced or the flags file is machine-generated and bloated.","triggerScenarios":"A generated options file with thousands of --exclude/--depends lines exceeding 100 KiB; accidentally pointing --fpm-options-file at a large unrelated file or binary.","commonSituations":"Auto-generated exclusion lists from find/grep; monorepos accumulating per-package flags in one shared file; a wrong path hitting a big artifact.","solutions":["Split the options file into several smaller files (each under 100 KiB) and reference them individually","Deduplicate and trim flag lines (repeated --exclude patterns often collapse with wildcards)","Verify the path actually points at an fpm flags file, not an arbitrary large file"],"exampleFix":"# before: single generated excludes.txt at 300kb\nfpm --fpm-options-file excludes.conf ...\n\n# after: split by concern\ncsplit -k excludes.conf 50000   # then keep each part under 100kb\nfpm --fpm-options-file excludes-a.conf --fpm-options-file excludes-b.conf ...","handlingStrategy":"validation","validationCode":"path = 'fpm.conf'\nabort 'options file exceeds fpm 100kb safety limit' if File.size(path) > 100 * 1024\nsystem('fpm', '--fpm-options-file', path, '-s', 'dir', '-t', 'deb', './app')","typeGuard":null,"tryCatchPattern":"begin\n  FPM::Command.run(argv)\nrescue FPM::Package::InvalidArgument => e\n  abort \"options file rejected: #{e.message}\"\nend","preventionTips":["Assert File.size(path) <= 100 * 1024 in the build script","Keep generated flag lists deduplicated and wildcarded so they stay small","Confirm --fpm-options-file references a flags file, never an arbitrary large artifact"],"tags":["fpm","cli","config-file","size-limit","argument-validation"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}