{"record":{"id":"5dd7e309b2067b2b","repo":"puppetlabs/puppet","slug":"cannot-query-if-the-service-service-is-complete","errorCode":null,"errorMessage":"Cannot query if the %{service} service is complete: The concept of complete/incomplete services was introduced in Solaris 11.1. You are on a Solaris %{release} machine.","messagePattern":"Cannot query if the %(.+?) service is complete: The concept of complete/incomplete services was introduced in Solaris 11\\.1\\. You are on a Solaris %(.+?) machine\\.","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/service/smf.rb","lineNumber":113,"sourceCode":"    lines.select! { |line| line =~ /^fmri/ }\n    fmris = lines.map! { |line| line.split(' ')[-1].chomp }\n    unless fmris.length == 1\n      raise Puppet::Error, _(\"Failed to get the FMRI of the %{service} service: The pattern '%{service}' matches multiple FMRIs! These are the FMRIs it matches: %{all_fmris}\") % { service: @resource[:name], all_fmris: fmris.join(', ') }\n    end\n\n    @fmri = fmris.first\n  end\n\n  # Returns true if the provider supports incomplete services.\n  def supports_incomplete_services?\n    Puppet::Util::Package.versioncmp(Puppet.runtime[:facter].value('os.release.full'), '11.1') >= 0\n  end\n\n  # Returns true if the service is complete. A complete service is a service that\n  # has the general/complete property defined.\n  def complete_service?\n    unless supports_incomplete_services?\n      raise Puppet::Error, _(\"Cannot query if the %{service} service is complete: The concept of complete/incomplete services was introduced in Solaris 11.1. You are on a Solaris %{release} machine.\") % { service: @resource[:name], release: Puppet.runtime[:facter].value('os.release.full') }\n    end\n\n    return @complete_service if @complete_service\n\n    # We need to use the service's FMRI when querying its config. because\n    # general/complete is an instance-specific property.\n    fmri = service_fmri\n\n    # Check if the general/complete property is defined. If it is undefined,\n    # then svccfg will not print anything to the console.\n    property_defn = svccfg(\"-s\", fmri, \"listprop\", \"general/complete\").chomp\n    @complete_service = !property_defn.empty?\n  end\n\n  def enable\n    @properties_to_sync[:enable] = true\n  end\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/service/smf.rb#L95-L131","documentation":"The SMF provider's complete_service? checks whether a service has the general/complete property (introduced with incomplete-service support in Solaris 11.1). It first calls supports_incomplete_services?, which compares the os.release.full fact against 11.1 with versioncmp; on older Solaris it raises immediately rather than returning a meaningless answer.","triggerScenarios":"A catalog that reaches complete_service? — e.g. managing an SMF service whose manifest/state forces the completeness check during flush/enable logic — on Solaris 11.0, 10, or anything where os.release.full sorts below 11.1. versioncmp('11.0','11.1') < 0 trips it; note that lexical facts (e.g. '11.1_SRRA') can also mis-sort.","commonSituations":"Modules developed and tested on Solaris 11.2+ deployed onto Solaris 10/11.0 fleets; fact values from older Facter or zones reporting partial release strings; catalogs shared across a mixed-OS estate with one service profile.","solutions":["Gate SMF completeness-dependent declarations by OS release in the profile (versioncmp against '11.1')","Upgrade the node to Solaris 11.1 or later if incomplete-service management is required","Verify the fact: puppet facts | grep release.full — odd strings make versioncmp misbehave","Keep Solaris 10 nodes on a separate profile that avoids the completeness code path"],"exampleFix":"# before\nservice { 'svc:/application/myapp:default':\n  ensure   => running,\n  provider => 'smf',\n}\n\n# after\nif $facts['os']['family'] == 'Solaris' and versioncmp($facts['os']['release']['full'], '11.1') >= 0 {\n  service { 'svc:/application/myapp:default':\n    ensure   => running,\n    provider => 'smf',\n  }\n}","handlingStrategy":"validation","validationCode":"# gate SMF completeness paths at compile time\nif $facts['os']['family'] == 'Solaris' and versioncmp($facts['os']['release']['full'], '11.1') < 0 {\n  fail('SMF incomplete-service features need Solaris >= 11.1')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Split Solaris profiles by release (10 vs 11.1+) instead of sharing one service profile","Pin os.release.full fact expectations in specs so versioncmp behavior is covered by tests","Watch for odd fact strings (e.g. '11.1_SRRA') that can mis-sort in versioncmp"],"tags":["puppet","solaris","smf","os-version"],"backgroundTag":"unsupported-os-version","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}