{"record":{"id":"76822bfdee74ed81","repo":"puppetlabs/puppet","slug":"could-not-find-name-provider-of-provider","errorCode":null,"errorMessage":"Could not find %{name} provider of %{provider}","messagePattern":"Could not find %(.+?) provider of %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/type.rb","lineNumber":1960,"sourceCode":"  # @overload provider=(name)\n  #   Sets the provider to the result of resolving the name to an instance of Provider.\n  #   @param name [String] the name of the provider\n  # @overload provider=(provider)\n  #   Sets the provider to the given instances of Provider.\n  #   @param provider [Puppet::Provider] the provider to set\n  # @return [Puppet::Provider] the provider set\n  # @raise [ArgumentError] if the provider could not be found/resolved.\n  #\n  def provider=(name)\n    if name.is_a?(Puppet::Provider)\n      @provider = name\n      @provider.resource = self\n    else\n      klass = self.class.provider(name)\n      if klass\n        @provider = klass.new(self)\n      else\n        raise ArgumentError, _(\"Could not find %{name} provider of %{provider}\") % { name: name, provider: self.class.name }\n      end\n    end\n  end\n\n  ###############################\n  # All of the relationship code.\n\n  # Adds a block producing a single name (or list of names) of the given\n  # resource type name to autorelate.\n  #\n  # The four relationship types require, before, notify, and subscribe are all\n  # supported.\n  #\n  # Be *careful* with notify and subscribe as they may have unintended\n  # consequences.\n  #\n  # Resources in the catalog that have the named type and a title that is\n  # included in the result will be linked to the calling resource as a","sourceCodeStart":1942,"sourceCodeEnd":1978,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/type.rb#L1942-L1978","documentation":"Puppet::Type#provider= is the setter behind the provider parameter and provider retrieval. Given a name (not a Puppet::Provider instance), it looks up self.class.provider(name); when the type has no such suitable provider registered, ArgumentError 'Could not find <name> provider of <type>' is raised. This is the same root cause as the provider-parameter validation error, but raised from the setter path used by Ruby code and by the munge that assigns @resource.provider.","triggerScenarios":"Ruby-side resource.provider = :missing; type/provider code resolving a provider name from data (e.g., a fact-driven provider choice) where the name has no suitable match on this node; custom types calling provider= during prefetch with a stale name; string names work since provider(name) handles strings, but the provider must exist and be suitable.","commonSituations":"Programmatic resource assembly (Bolt tasks, orchestrators) that sets provider from an inventory variable; provider suites where one provider's gem dependency is missing on a subset of nodes; renamed providers between module versions (e.g., pip3 vs pip).","solutions":["Check suitability before assigning: return unless self.class.provider(name) (Ruby) — the same guard the setter lacks","Prefer omitting provider and letting the type choose its defaultprovider","On the affected node, verify why the provider is filtered out: missing binary/gem/fact confine, then install or fix facts","Update the name to the provider's current spelling in the installed module version"],"exampleFix":"# before\nresource.provider = provider_name # raises ArgumentError when unsuitable\n\n# after\nif klass = resource.class.provider(provider_name)\n  resource.provider = klass\nelse\n  Puppet.warning \"provider #{provider_name} unavailable; using default\"\n  resource.provider = resource.class.defaultprovider\nend","handlingStrategy":"validation","validationCode":"if klass = self.class.provider(name)\n  self.provider = klass\nelse\n  self.provider = self.class.defaultprovider\nend","typeGuard":null,"tryCatchPattern":"begin\n  resource.provider = name\nrescue ArgumentError => e\n  raise unless e.message =~ /Could not find .* provider/\n  resource.provider = resource.class.defaultprovider\nend","preventionTips":["Resolve via self.class.provider(name) before assigning; nil means unsuitable here","Derive provider names from facts you verify, not from inventory strings","After module upgrades, re-check renamed providers (pip/pip3) on all platforms"],"tags":["puppet","provider","provider-setter","suitability"],"backgroundTag":"provider-not-found","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}