puppetlabs/puppet · error · ArgumentError
( ) is not a valid face name
Error message
%{name} (%{class_name}) is not a valid face name What it means
FaceCollection.underscorize rejects face names that do not match ^[-_a-z][-_a-z0-9]*$; the face being registered has an invalid name such as one starting with a digit or containing punctuation.
Solutions
- Rename the face to use only letters, digits, dashes and underscores, starting with a letter or dash
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/puppet/interface/face_collection.rb:135 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/83954c03f0668e93.
Report an issue: GitHub.
Appendix: source
Thrown at lib/puppet/interface/face_collection.rb:135
# ...guess we didn't find the file; return a much better problem.
nil
rescue SyntaxError => e
raise unless e.message =~ /#{path}\.rb:\d+: /
Puppet.err _("Failed to load face %{name}:\n%{detail}") % { name: name, detail: e }
# ...but we just carry on after complaining.
nil
end
def self.register(face)
@faces[underscorize(face.name)][face.version] = face
end
def self.underscorize(name)
unless name.to_s =~ /^[-_a-z][-_a-z0-9]*$/i then
# TRANSLATORS 'face' refers to a programming API in Puppet
raise ArgumentError, _("%{name} (%{class_name}) is not a valid face name") %
{ name: name.inspect, class_name: name.class }
end
name.to_s.downcase.split(/[-_]/).join('_').to_sym
end
end
View on GitHub (pinned to e227c27540)