{"record":{"id":"696e6d8cf6b15670","repo":"theforeman/foreman","slug":"unable-to-find-template-s","errorCode":null,"errorMessage":"Unable to find template %s","messagePattern":"Unable to find template (.+?)","errorType":"exception","errorClass":"Foreman::Exception","httpStatus":null,"severity":"error","filePath":"app/models/compute_resources/foreman/model/libvirt.rb","lineNumber":131,"sourceCode":"      end\n      bridge_names = bridges.map(&:name)\n      interfaces.select { |fog_interface| fog_interface.active? && bridge_names.include?(fog_interface.name) }\n    rescue => e\n      Foreman::Logging.exception('No bridge interface could be found in libvirt', e)\n      []\n    end\n\n    def interfaces\n      client.interfaces rescue []\n    end\n\n    def networks\n      client.networks rescue []\n    end\n\n    def template(id)\n      template = client.volumes.get(id)\n      raise Foreman::Exception.new(N_(\"Unable to find template %s\"), id) unless template&.persisted?\n      template\n    end\n\n    def set_boot_order(attr = {})\n      order = %w[hd]\n      order.unshift 'network' unless attr[:image_id]\n      order\n    end\n\n    def new_vm(attr = { })\n      test_connection\n      libvirt_connection_error unless errors.empty?\n      opts = vm_instance_defaults.merge(attr.to_h).deep_symbolize_keys\n\n      # convert rails nested_attributes into a plain hash\n      [:nics, :volumes].each do |collection|\n        nested_attrs = opts.delete(\"#{collection}_attributes\".to_sym)\n        opts[collection] = nested_attributes_for(collection, nested_attrs) if nested_attrs","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/models/compute_resources/foreman/model/libvirt.rb#L113-L149","documentation":"Error \"Unable to find template %s\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/models/compute_resources/foreman/model/libvirt.rb:131 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":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}