{"record":{"id":"25bed405d230f664","repo":"puppetlabs/puppet","slug":"invalid-entry-at-error-location-file-text","errorCode":null,"errorMessage":"Invalid entry at %{error_location}: '%{file_text}'","messagePattern":"Invalid entry at %(.+?): '%(.+?)'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/file_serving/configuration/parser.rb","lineNumber":51,"sourceCode":"          raise(ArgumentError, _(\"Fileserver configuration file does not use '=' as a separator\")) if value =~ /^=/\n\n          case var\n          when \"path\"\n            path(mount, value)\n          when \"allow\", \"deny\"\n            # ignore `allow *`, otherwise report error\n            if var != 'allow' || value != '*'\n              error_location_str = Puppet::Util::Errors.error_location(@file.filename, @count)\n              Puppet.err(\"Entry '#{line.chomp}' is unsupported and will be ignored at #{error_location_str}\")\n            end\n          else\n            error_location_str = Puppet::Util::Errors.error_location(@file.filename, @count)\n            raise ArgumentError, _(\"Invalid argument '%{var}' at %{error_location}\") %\n                                 { var: var, error_location: error_location_str }\n          end\n        else\n          error_location_str = Puppet::Util::Errors.error_location(@file.filename, @count)\n          raise ArgumentError, _(\"Invalid entry at %{error_location}: '%{file_text}'\") %\n                               { file_text: line.chomp, error_location: error_location_str }\n        end\n      end\n    end\n\n    validate\n\n    @mounts\n  end\n\n  def initialize(filename)\n    @file = Puppet::Util::WatchedFile.new(filename)\n  end\n\n  def changed?\n    @file.changed?\n  end\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/configuration/parser.rb#L33-L69","documentation":"Raised by Puppet::FileServing::Configuration::Parser#parse while reading fileserver.conf when a line matches none of the accepted forms: a `[mount_name]` header, a `path <dir>` setting, or an `allow`/`deny` ACL line. The message echoes the offending text plus the exact file:line location (@count tracks the current line number). The exception aborts loading of the whole file-server configuration, so no mounts get served.","triggerScenarios":"A fileserver.conf line like `mount modules /etc/puppet/modules` (missing brackets), `path=/srv/data` (the parser explicitly rejects '=' as a separator), a stray character line that is not a comment/blank, or an ACL/value line whose shape fails the `\\s*(\\w+)\\s+(.+?)` match (e.g. a single word with no value).","commonSituations":"Hand-editing fileserver.conf and introducing typos; pasting examples from very old documentation that used different syntax; using '=' between key and value; a path line appearing with trailing junk that breaks the regex.","solutions":["Open fileserver.conf at the file:line shown in the error and fix or delete the offending line","Use only the supported grammar: `[mount_name]` headers, `path /absolute/dir` lines (space-separated, no '='), and `allow`/`deny` ACL lines","Re-run `puppet agent --test` (or restart puppetserver) to confirm the config now parses cleanly","Keep fileserver.conf in version control and lint it in CI so bad lines never reach the server"],"exampleFix":"# before (fileserver.conf)\nmount data /srv/data\nallow *.example.com\n\n# after\n[data]\n  path /srv/data\n  allow *.example.com","handlingStrategy":"validation","validationCode":"# Lint fileserver.conf before the server loads it\ndef fileserver_conf_errors(path)\n  errors = []\n  File.readlines(path).each_with_index do |line, i|\n    s = line.strip\n    next if s.empty? || s.start_with?('#')\n    next if s.match?(/\\A\\[[A-Za-z0-9_-]+\\]\\z/)          # mount header\n    next if s.match?(/\\A(path|allow|deny)\\s+\\S(?!\\s*=)/) # key value (no '=')\n    errors << \"line #{i + 1}: #{s}\"\n  end\n  errors\nend","typeGuard":null,"tryCatchPattern":"begin\n  mounts = Puppet::FileServing::Configuration::Parser.new(conf).parse\nrescue ArgumentError => e\n  raise unless e.message.start_with?(\"Invalid entry\")\n  log \"bad fileserver.conf line: #{e.message}\" # e.message contains file:line and text\nend","preventionTips":["Manage fileserver.conf in version control and lint it in CI","Use a template that only emits [name], path, allow, deny lines","After manual edits, re-run the agent/master once on a canary host before rolling out"],"tags":["puppet","fileserver","config-parser","argumenterror","ruby"],"backgroundTag":"config-parse-error","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}