puppetlabs/puppet · error · ArgumentError
Unable to extract a non-empty literal string from Struct mem
Error message
Unable to extract a non-empty literal string from Struct member key type #{tc.string(key_type)} What it means
Error "Unable to extract a non-empty literal string from Struct member key type #{tc.string(key_type)}" thrown in puppetlabs/puppet.
Source
Thrown at lib/puppet/pops/types/type_factory.rb:204
key_type = optional(key_type) if tc.assignable?(value_type, PUndefType::DEFAULT)
else
# assert that the key type is one of String[1], NotUndef[String[1]] and Optional[String[1]]
case key_type
when PNotUndefType
# We can loose the NotUndef wrapper here since String[1] isn't optional anyway
key_type = key_type.type
s = key_type
when POptionalType
s = key_type.optional_type
when PStringType
s = key_type
when PEnumType
s = key_type.values.size == 1 ? PStringType.new(key_type.values[0]) : nil
else
raise ArgumentError, "Illegal Struct member key type. Expected NotUndef, Optional, String, or Enum. Got: #{key_type.class.name}"
end
unless s.is_a?(PStringType) && !s.value.nil?
raise ArgumentError, "Unable to extract a non-empty literal string from Struct member key type #{tc.string(key_type)}"
end
end
PStructElement.new(key_type, value_type)
end
PStructType.new(elements)
end
# Produces an `Object` type from the given _hash_ that represents the features of the object
#
# @param hash [{String=>Object}] the hash of feature groups
# @return [PObjectType] the created type
#
def self.object(hash = nil, loader = nil)
hash.nil? || hash.empty? ? PObjectType::DEFAULT : PObjectType.new(hash, loader)
end
def self.type_set(hash = nil)
hash.nil? || hash.empty? ? PTypeSetType::DEFAULT : PTypeSetType.new(hash)View on GitHub (pinned to e227c27540)
When it happens
Trigger: Thrown at lib/puppet/pops/types/type_factory.rb:204 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/895a7ccbec1496ee.
Report an issue: GitHub.