puppetlabs/puppet · error · Puppet::Error
Error loading ssl custom OIDs mapping file from
Error message
Error loading ssl custom OIDs mapping file from '%{custom_oid_file}': %{err} What it means
Raised by Puppet::SSL::Oids.parse_custom_oid_file when the custom OID YAML file exists and is readable, but Puppet::Util::Yaml.safe_load_file fails to parse it (malformed YAML, disallowed constructs, or I/O read error). The original parser error is wrapped into a Puppet::Error, preserving the backtrace.
Solutions
- Fix the YAML syntax errors in the custom OID mapping file reported in %{err} (indentation, tabs, duplicate keys).
- Ensure the file contains only YAML data types safe for loading (plain mappings of strings).
- Verify the file path in %{custom_oid_file} points to the intended custom OID file.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at lib/puppet/ssl/oids.rb:115 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- SSL/TLS and certificate errors — how TLS handshakes and certificate validation fail.
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/6b06b0bfdce41719.
Report an issue: GitHub.
Appendix: source
Thrown at lib/puppet/ssl/oids.rb:115
# @param custom_oid_file [String] File to obtain custom OIDs mapping from
# @param map_key [String] Hash key in which custom OIDs mapping is stored
#
# @example Custom OID mapping file
# ---
# oid_mapping:
# '1.3.6.1.4.1.34380.1.2.1.1':
# shortname : 'myshortname'
# longname : 'Long name'
# '1.3.6.1.4.1.34380.1.2.1.2':
# shortname: 'myothershortname'
# longname: 'Other Long name'
def self.parse_custom_oid_file(custom_oid_file, map_key = 'oid_mapping')
if File.exist?(custom_oid_file) && File.readable?(custom_oid_file)
mapping = nil
begin
mapping = Puppet::Util::Yaml.safe_load_file(custom_oid_file, [Symbol])
rescue => err
raise Puppet::Error, _("Error loading ssl custom OIDs mapping file from '%{custom_oid_file}': %{err}") % { custom_oid_file: custom_oid_file, err: err }, err.backtrace
end
unless mapping.has_key?(map_key)
raise Puppet::Error, _("Error loading ssl custom OIDs mapping file from '%{custom_oid_file}': no such index '%{map_key}'") % { custom_oid_file: custom_oid_file, map_key: map_key }
end
unless mapping[map_key].is_a?(Hash)
raise Puppet::Error, _("Error loading ssl custom OIDs mapping file from '%{custom_oid_file}': data under index '%{map_key}' must be a Hash") % { custom_oid_file: custom_oid_file, map_key: map_key }
end
oid_defns = []
mapping[map_key].keys.each do |oid|
shortname, longname = mapping[map_key][oid].values_at("shortname", "longname")
if shortname.nil? || longname.nil?
raise Puppet::Error, _("Error loading ssl custom OIDs mapping file from '%{custom_oid_file}': incomplete definition of oid '%{oid}'") % { custom_oid_file: custom_oid_file, oid: oid }
end
oid_defns << [oid, shortname, longname]View on GitHub (pinned to e227c27540)