puppetlabs/puppet · error · Puppet::Error

Invalid entry at %{error_location}: %{file_text}

Error message

Invalid entry at %{error_location}: %{file_text}

What it means

Error "Invalid entry at %{error_location}: %{file_text}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/util/network_device/config.rb:72

            name = ::Regexp.last_match(1)
            name.chomp!
            if devices.include?(name)
              file_error_location = Puppet::Util::Errors.error_location(nil, file_line_count)
              device_error_location = Puppet::Util::Errors.error_location(nil, device.line)
              raise Puppet::Error, _("Duplicate device found at %{file_error_location}, already found at %{device_error_location}") %
                                   { file_error_location: file_error_location, device_error_location: device_error_location }
            end
            device = OpenStruct.new
            device.name = name
            device.line = file_line_count
            device.options = { :debug => false }
            Puppet.debug "found device: #{device.name} at #{device.line}"
            devices[name] = device
          when /^\s*(type|url|debug)(\s+(.+)\s*)*$/
            parse_directive(device, ::Regexp.last_match(1), ::Regexp.last_match(3), file_line_count)
          else
            error_location_str = Puppet::Util::Errors.error_location(nil, file_line_count)
            raise Puppet::Error, _("Invalid entry at %{error_location}: %{file_text}") %
                                 { error_location: error_location_str, file_text: line }
          end
        end
      end
    rescue Errno::EACCES
      Puppet.err _("Configuration error: Cannot read %{file}; cannot serve") % { file: @file }
      # raise Puppet::Error, "Cannot read #{@config}"
    rescue Errno::ENOENT
      Puppet.err _("Configuration error: '%{file}' does not exit; cannot serve") % { file: @file }
    end

    @devices = devices
  end

  def parse_directive(device, var, value, count)
    case var
    when "type"
      device.provider = value

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/util/network_device/config.rb:72 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/186ac00459ed96b0. Report an issue: GitHub.