-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DnsServerSetting: failed to execute Set-TargetResource
functionality with error message: Generic failure
#87
Comments
I have the same issue with setting DNS Server IP in Windows Server 2019. All other setting take no issue, IP, Subnet, Default Gateway. Only DNS errors every time. PowerShell DSC resource MSFT_DnsServerAddress failed to execute Set-TargetResource |
This is error is generated by the |
The following error is generated when none of the specified IP addresses exist on a network interface. The resource should check available IP addresses on the node and throw an exception saying that neither IP address is available on a network interface.
|
Set-TargetResource
functionality with error message: Generic failure
Set-TargetResource
functionality with error message: Generic failure Set-TargetResource
functionality with error message: Generic failure
I see this when setting ListenAddress to a valid IP thats on the interface, but the DNS server is currently configured to 'All Addresses' If I manually change the setting to the ip im trying to set it to, the DSC then updates correctly. I cant see anyway to pass 'All IP Addreses' to the DSC listenaddresses option? |
I can't reproduce this this. But in my lab it moves from AllIPAddresses setting to just using one (of two) IP addresses. But I did see that if having the GUI up, it needed a refresh to reflect the change.
It seems the read-only property here holds all the addresses |
Cheers, actually seeing some other strange things on a windows 2019 machine. dnsserver throws an error about not being able to write to the log when puppet runs, however, the log it references is 'c:\windows%systemroot%\system32\DNS\dns.log' hardcoding this to 'c:\windows\system32\dns\dns.log stops the error (not sure whats going on here) This machine has 2 forwarders configured, when passing in a comma seperated list of 6 it says it changed, but doesnt actually apply. Subsequent runs also show it doing corrective changes that again dont apply. This did work ok (at least showed no change) when run on a test machine with only 1 forwarder. If I pull the powershell code out of a debug log I see this when running the invoke-dscresource with a -debug flag... VERBOSE: [GNWSPRMGTADC02]: [[xDnsServerSetting]DirectResourceAccess] NOTMATCH: Value (type Shouldnt the desired count be 6? I also see some dsc changes mentioning that forwarders and logfilepath are moved to their own dsc options (not sure what version actually get used here) We're using puppetlabs-dsc 1.9.4 Just getting started with dsc so possibly missing something obvious. |
Please open separate issues for other issues you are seeing so we don’t add things to this issue that are not related to ListeningIPAddresa. |
Details of the scenario you tried and the problem that is occurring
I am trying to set the ListenAddresses property. If no change is required, it runs successfully. However, if ListenAddress needs to be changed, it errors out. I've changed the IP addresses from their actual addresses.
Verbose logs showing the problem
Successful run:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC1 with user sid
VERBOSE: [DC1]: LCM: [ Start Set ]
VERBOSE: [DC1]: LCM: [ Start Resource ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: LCM: [ Start Test ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Evaluating the DNS server settings.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Getting DNS Server Settings.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\MicrosoftDNS,'className' = MicrosoftDNS_Server'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Operation 'Enumerate CimInstances' complete.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = Get,'className' = PS_DnsServerDiagnostics,'namespaceName' = root/Mi
crosoft/Windows/DNS'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Operation 'Invoke CimMethod' complete.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type Boolean) for property 'NoRecursion' does match. Current state is 'False' and desired state is 'False'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Comparing values in property 'ListenAddresses'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value [0] (type String) for property 'ListenAddresses' does match. Current state is '1.1.1.1' and desired state is '1.1.1.1'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type String) for property 'LogFilePath' does match. Current state is 'C:\dns\dns.log' and desired state is 'C:\dns\dns.log'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type UInt32) for property 'LogLevel' does match. Current state is '24865' and desired state is '24865'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type String) for property 'Name' does match. Current state is 'DnsServerSetting' and desired state is 'DnsServerSetting'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type UInt32) for property 'AllowUpdate' does match. Current state is '1' and desired state is '1'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Comparing values in property 'Forwarders'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value [0] (type String) for property 'Forwarders' does match. Current state is '2.2.2.2' and desired state is '2.2.2.2'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value [1] (type String) for property 'Forwarders' does match. Current state is '3.3.3.3' and desired state is '3.3.3.3'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Result is 'True'
VERBOSE: [DC1]: LCM: [ End Test ] [[xDnsServerSetting]DnsServerProperties] in 0.7270 seconds.
VERBOSE: [DC1]: LCM: [ Skip Set ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: LCM: [ End Resource ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: LCM: [ End Set ]
VERBOSE: [DC1]: LCM: [ End Set ] in 1.0020 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 1.064 seconds
Failure:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC1 with user sid
VERBOSE: [DC1]: LCM: [ Start Set ]
VERBOSE: [DC1]: LCM: [ Start Resource ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: LCM: [ Start Test ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Evaluating the DNS server settings.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Getting DNS Server Settings.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\MicrosoftDNS,'className' = MicrosoftDNS_Server'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Operation 'Enumerate CimInstances' complete.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = Get,'className' = PS_DnsServerDiagnostics,'namespaceName' = root/Mi
crosoft/Windows/DNS'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Operation 'Invoke CimMethod' complete.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type Boolean) for property 'NoRecursion' does match. Current state is 'False' and desired state is 'False'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Comparing values in property 'ListenAddresses'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] NOTMATCH: Value (type String[]) for property 'ListenAddresses' does have a different count. Current state count is '2' and desired state count is '
1'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type String) for property 'LogFilePath' does match. Current state is 'C:\dns\dns.log' and desired state is 'C:\dns\dns.log'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type UInt32) for property 'LogLevel' does match. Current state is '24865' and desired state is '24865'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type String) for property 'Name' does match. Current state is 'DnsServerSetting' and desired state is 'DnsServerSetting'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value (type UInt32) for property 'AllowUpdate' does match. Current state is '1' and desired state is '1'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Comparing values in property 'Forwarders'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value [0] (type String) for property 'Forwarders' does match. Current state is '2.2.2.2' and desired state is '2.2.2.2'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] MATCH: Value [1] (type String) for property 'Forwarders' does match. Current state is '3.3.3.3' and desired state is '3.3.3.3'
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Result is 'False'
VERBOSE: [DC1]: LCM: [ End Test ] [[xDnsServerSetting]DnsServerProperties] in 0.7450 seconds.
VERBOSE: [DC1]: LCM: [ Start Set ] [[xDnsServerSetting]DnsServerProperties]
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' = root\MicrosoftDNS,'className' = MicrosoftDNS_Server'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Operation 'Enumerate CimInstances' complete.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Setting Dns setting 'LogLevel' to value '24865'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Setting Dns setting 'NoRecursion' to value 'False'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Setting Dns setting 'LogFilePath' to value 'C:\dns\dns.log'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Setting Dns setting 'Forwarders' to value 'System.String[]'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Setting Dns setting 'AllowUpdate' to value '1'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Setting Dns setting 'ListenAddresses' to value 'System.String[]'.
VERBOSE: [DC1]: [[xDnsServerSetting]DnsServerProperties] Perform operation 'Modify CimInstance' with following parameters, ''namespaceName' = root/MicrosoftDNS,'instance' = MicrosoftDNS_Server (Name = "dc
1")'.
VERBOSE: [DC1]: LCM: [ End Set ] [[xDnsServerSetting]DnsServerProperties] in 0.4790 seconds.
PowerShell DSC resource MSFT_xDnsServerSetting failed to execute Set-TargetResource functionality with error message: Generic failure
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
VERBOSE: [DC1]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : localhost
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 1.538 seconds
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The text was updated successfully, but these errors were encountered: