xPSDesiredStateConfiguration icon indicating copy to clipboard operation
xPSDesiredStateConfiguration copied to clipboard

In dsc_xservice while specifying the runsAsAccount thorough dsc_credentials getting warning about dsc_builtinaccount.

Open ShubhamKumar977 opened this issue 2 years ago • 7 comments

Problem description

When I pass invoke a dsc_xservice resource using below puppet code

**dsc_xservice { $service_item:
  dsc_name            => $service_setting[dsc_name],
  dsc_desktopinteract => $service_setting[dsc_desktopinteract],
  dsc_state           => $service_setting[dsc_state],
  dsc_startuptype     => $service_setting[dsc_startuptype],
  dsc_credential => {
    'user'     => "${root_domain}\\${service_setting[dsc_credential][user]}",
    'password' => Sensitive($service_user_pw),
  },
}**

I get an warning like below **Provider returned data that does not match the Type Schema for dsc_xservice[SetSqlServerAgentServiceUser]

Value type mismatch:

  • dsc_builtinaccount: smartplantcloud\KMT03-DBS-001-SQLAGT (expects an undef value or a match for Enum['LocalService', 'LocalSystem', 'NetworkService', 'localservice', 'localsystem', 'networkservice'], got 'smartplantcloud\KMT03-DBS-001-SQLAGT')** And the resource is always showing up as a corrective change from running to ignored, this was working with the module puppetlabs-dsc

Verbose logs

N/A

DSC configuration

dsc_xservice { $service_item:
      dsc_name            => $service_setting[dsc_name],
      dsc_desktopinteract => $service_setting[dsc_desktopinteract],
      dsc_state           => $service_setting[dsc_state],
      dsc_startuptype     => $service_setting[dsc_startuptype],
      dsc_credential => {
        'user'     => "${root_domain}\\${service_setting[dsc_credential][user]}",
        'password' => Sensitive($service_user_pw),
      },
    }

Suggested solution

N/A

Operating system the target node is running

N/A

PowerShell version and build the target node is running

N/A

xPSDesiredStateConfiguration version

9.1.0-0-4

ShubhamKumar977 avatar Jun 01 '23 04:06 ShubhamKumar977

@johlju, @Indhukrishna, @KarolKaczmarek after mentioning validation_mode as 'resource' we are able to prevent the resource from registering as a corrective change but still not able to resolve the warning issue. Could I get some help here.

ShubhamKumar977 avatar Jun 14 '23 05:06 ShubhamKumar977

Not sure there is an issue with the resource, are you sure the error is coming from the resource? Suggest you debug the resource to see where in the code the error is thrown.

johlju avatar Jun 14 '23 16:06 johlju

I'm experiencing same issue with 9.1.0-0-8, where I have a custom domain account running the service and get dsc_builtinaccount: [email protected] (expects an undef value or a match for Enum['LocalService', 'LocalSystem', 'NetworkService', 'localservice', 'localsystem', 'networkservice'], got '[email protected]') I'm not specifying dsc_credential, but have the custom domain account setup as the run-as manually.

BarnumD avatar May 22 '24 14:05 BarnumD

This must be an issue in Puppet - it seems to return an error for the parameter BuiltInAccount in both cases above, and I'm guessing neither of you have added that parameter? So guessing the problem is in the Puppet's translation of "Puppet configuration" to the code running the resource.

I think this is an external issue that we can't resolve in this repo. Please comment if you find an actual issue with the resource's code.

johlju avatar May 22 '24 17:05 johlju