{"record":{"id":"d52ee480c6aabeb1","repo":"puppetlabs/puppet","slug":"unable-to-create-an-instance-of-obj-parent-name","errorCode":null,"errorMessage":"Unable to create an instance of #{obj.parent.name}. No mapping exists to runtime object","messagePattern":"Unable to create an instance of #(.+?)\\. No mapping exists to runtime object","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/types/ruby_generator.rb","lineNumber":188,"sourceCode":"  def class_definition(obj, namespace_segments, bld, class_name, *impl_subst)\n    module_segments = remove_common_namespace(namespace_segments, class_name)\n    leaf_name = module_segments.pop\n    module_segments.each { |segment| bld << 'module ' << segment << \"\\n\" }\n    scoped_class_definition(obj, leaf_name, bld, class_name, *impl_subst)\n    module_segments.size.times { bld << \"end\\n\" }\n    module_segments << leaf_name\n    module_segments.join(TypeFormatter::NAME_SEGMENT_SEPARATOR)\n  end\n\n  def scoped_class_definition(obj, leaf_name, bld, class_name, *impl_subst)\n    bld << 'class ' << leaf_name\n    segments = class_name.split(TypeFormatter::NAME_SEGMENT_SEPARATOR)\n\n    unless obj.parent.nil?\n      if impl_subst.empty?\n        ir = Loaders.implementation_registry\n        parent_name = ir.module_name_for_type(obj.parent)\n        raise Puppet::Error, \"Unable to create an instance of #{obj.parent.name}. No mapping exists to runtime object\" if parent_name.nil?\n      else\n        parent_name = obj.parent.name.gsub(*impl_subst)\n      end\n      bld << ' < ' << namespace_relative(segments, parent_name)\n    end\n\n    bld << \"\\n\"\n    bld << \"  def self._pcore_type\\n\"\n    bld << '    @_pcore_type ||= ' << namespace_relative(segments, obj.class.name) << \".new('\" << obj.name << \"', \"\n    bld << TypeFormatter.singleton.ruby('ref').indented(2).string(obj._pcore_init_hash(false)) << \")\\n\"\n    bld << \"  end\\n\"\n\n    class_body(obj, segments, bld)\n\n    bld << \"end\\n\"\n  end\n\n  def class_body(obj, segments, bld)","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/ruby_generator.rb#L170-L206","documentation":"Error \"Unable to create an instance of #{obj.parent.name}. No mapping exists to runtime object\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/types/ruby_generator.rb:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}