{"record":{"id":"8c461c86f2a710e2","repo":"puppetlabs/puppet","slug":"unknown-start-type-start-type","errorCode":null,"errorMessage":"Unknown start type: %{start_type}","messagePattern":"Unknown start type: %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/service/windows.rb","lineNumber":59,"sourceCode":"    raise Puppet::Error.new(_(\"Cannot enable %{resource_name} for delayed start, error was: %{detail}\") % { resource_name: @resource[:name], detail: detail }, detail)\n  end\n\n  def enabled?\n    return :false unless Puppet::Util::Windows::Service.exists?(@resource[:name])\n\n    start_type = Puppet::Util::Windows::Service.service_start_type(@resource[:name])\n    debug(\"Service #{@resource[:name]} start type is #{start_type}\")\n    case start_type\n    when :SERVICE_AUTO_START, :SERVICE_BOOT_START, :SERVICE_SYSTEM_START\n      :true\n    when :SERVICE_DEMAND_START\n      :manual\n    when :SERVICE_DELAYED_AUTO_START\n      :delayed\n    when :SERVICE_DISABLED\n      :false\n    else\n      raise Puppet::Error, _(\"Unknown start type: %{start_type}\") % { start_type: start_type }\n    end\n  rescue => detail\n    raise Puppet::Error.new(_(\"Cannot get start type %{resource_name}, error was: %{detail}\") % { resource_name: @resource[:name], detail: detail }, detail)\n  end\n\n  def start\n    if status == :paused\n      Puppet::Util::Windows::Service.resume(@resource[:name], timeout: @resource[:timeout])\n      return\n    end\n\n    # status == :stopped here\n\n    if enabled? == :false\n      # If disabled and not managing enable, respect disabled and fail.\n      if @resource[:enable].nil?\n        raise Puppet::Error, _(\"Will not start disabled service %{resource_name} without managing enable. Specify 'enable => false' to override.\") % { resource_name: @resource[:name] }\n      # Otherwise start. If enable => false, we will later sync enable and","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/service/windows.rb#L41-L77","documentation":"Raised by Puppet's Windows service provider when the SCM reports a service start type the provider does not map. `enabled?` queries `Puppet::Util::Windows::Service.service_start_type` and translates known values (AUTO/BOOT/SYSTEM -> true, DEMAND -> manual, DELAYED_AUTO -> delayed, DISABLED -> false); anything else hits the else branch. Note the surrounding rescue immediately re-wraps this into 'Cannot get start type <name>, error was: ...', so the user-visible message is the wrapped one.","triggerScenarios":"Enumerating or syncing a Windows service whose QUERY_SERVICE_CONFIG dwStartType resolves to a symbol outside the mapped set — e.g., a newly introduced start type not covered by the installed Puppet version's Windows::Service helper, or a corrupt/unusual SCM entry. It is an internal invariant violation more than a user configuration error.","commonSituations":"Running an old Puppet agent on a newer Windows release that exposes an unmapped start type; services registered by third-party installers with non-standard configurations; mock/stubbed service queries in tests returning unexpected symbols.","solutions":["Identify the actual start type on the node: `Get-Service <name> | Select StartType` or `sc.exe qc <name>`.","Upgrade the Puppet agent to a version whose Puppet::Util::Windows::Service maps the reported start type.","Set the start type explicitly (e.g., `sc.exe config <name> start= demand`) to a well-known value, then re-run Puppet.","If developing against the API, extend the case statement in the provider/helper to map the new symbol."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"start_type = Puppet::Util::Windows::Service.service_start_type('myapp')\nvalid = %i[SERVICE_AUTO_START SERVICE_BOOT_START SERVICE_SYSTEM_START SERVICE_DEMAND_START SERVICE_DELAYED_AUTO_START SERVICE_DISABLED]\nraise ArgumentError, \"unmapped start type #{start_type}\" unless valid.include?(start_type)","typeGuard":"KNOWN_START_TYPES = %i[SERVICE_AUTO_START SERVICE_BOOT_START SERVICE_SYSTEM_START SERVICE_DEMAND_START SERVICE_DELAYED_AUTO_START SERVICE_DISABLED].freeze\n\ndef known_start_type?(sym)\n  KNOWN_START_TYPES.include?(sym)\nend","tryCatchPattern":null,"preventionTips":["Keep the Puppet agent current relative to the Windows versions you manage.","Normalize unusual services with `sc.exe config <name> start= demand` before managing them.","In specs, stub service_start_type only with values from the mapped set."],"tags":["windows","service-management","puppet","scm"],"backgroundTag":"unknown-service-start-type","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}