Skip to content
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

ADDomain: ARM template deployment fails due to ActiveDirectoryDsc resource ADDomain throwing an error on first reboot after a DC Promo #2 #574

Closed
mitch-meade opened this issue Feb 18, 2020 · 9 comments · Fixed by #577
Assignees
Labels
bug The issue is a bug.

Comments

@mitch-meade
Copy link

mitch-meade commented Feb 18, 2020

Details of the scenario you tried and the problem that is occurring

ARM template deployment fails due to ActiveDirectoryDsc resource ADDomain throwing an error on first reboot after a DC Promo. The DC promo completes but the error breaks the ARM template in progress.

Verbose logs showing the problem

{"time": "2020-02-14T16:52:50.425-8:00", "type": "verbose", "message": "[cwmgr1]: LCM:  [ Start  Resource ]  [[ADDomain]newDomain]  "},
{"time": "2020-02-14T16:52:50.425-8:00", "type": "verbose", "message": "[cwmgr1]: LCM:  [ Start  Test     ]  [[ADDomain]newDomain]  "},
{"time": "2020-02-14T16:52:50.519-8:00", "type": "verbose", "message": "[cwmgr1]:                            [[ADDomain]newDomain] Querying for domain 'cjPSTest5.local.nc'. (ADD0001)"},
{"time": "2020-02-14T16:52:52.316-8:00", "type": "verbose", "message": "[cwmgr1]: LCM:  [ End    Test     ]  [[ADDomain]newDomain]  in 1.8910 seconds."},
{"time": "2020-02-14T16:52:52.316-8:00", "type": "error", "message": "PowerShell DSC resource MSFT_ADDomain  failed to execute Test-TargetResource functionality with error message: System.InvalidOperationException: Error getting AD domain 'cjPSTest5.local.nc'. (ADD0013) ---> System.ArgumentException: Server instance not found on the given port. ---> System.ServiceModel.FaultException: The operation failed because of a bad parameter.\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForFaultDetail(FaultDetail faultDetail, FaultException faultException)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowException(AdwsFault adwsFault, FaultException faultException)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.SearchAnObject(ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.Search(ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.ADWebServiceStoreAccess.Microsoft.ActiveDirectory.Management.IADSyncOperations.Search(ADSessionHandle handle, ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.ADObjectSearcher.GetRootDSE()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetRootDSE()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetConnectedStore()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetCmdletSessionInfo()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()\r\n   at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()\r\n   --- End of inner exception stack trace --- "},
{"time": "2020-02-14T16:52:52.425-8:00", "type": "verbose", "message": "[cwmgr1]:                            [] Consistency check completed."}

The DSC configuration that is used to reproduce the issue (as detailed as possible)

ADDomain newDomain
{
DomainName                    = $DomainName
Credential                    = $LocalAdmin			
SafeModeAdministratorPassword = $safemodeAdminCred
ForestMode                    = 'WinThreshold'
DependsOn                     = @('[WindowsFeature]AD-Domain-Services','[WindowsFeature]DNS')
}

The operating system the target node is running

Windows Server 2016 running in Azure

Version and build of PowerShell the target node is running

PSVersion                      5.1.14393.3383                                                                                                                                                                                                                    
PSEdition                      Desktop                                                                                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                           
BuildVersion                   10.0.14393.3383                                                                                                                                                                                                                   
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                   
WSManStackVersion              3.0                                                                                                                                                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                               
SerializationVersion           1.1.0.1     

Version of the DSC module that was used

6.0.0-preview0001.

@X-Guardian
Copy link
Contributor

Hi @mitch-meade, can you edit the issue comment and add your Dsc config, O/S details and PowerShell version as requested in the issue template. I've removed the references to the other incidents as this is a different error.

@X-Guardian
Copy link
Contributor

It looks like you are hitting an unexpected exception when the server first reboots and the Dsc is re-evaluated and the Get-ADDomain cmdlet is run.

Can you add the following code at line 111 of the MSFT_ADDomain\MSFT_ADDomain.psm1 file in your copy of the module and run the build again on a new machine so that we can get details of the exception in the verbose logs:

Write-Verbose -Message "Exception Name: $($_.Exception.GetType().FullName)" -Verbose
Write-Verbose -Message "Inner Exception Name: $($_.Exception.InnerException.GetType().FullName)" -Verbose
```:

@mitch-meade
Copy link
Author

mitch-meade commented Feb 18, 2020

Below are the verbose logs requested...

{"time": "2020-02-18T23:39:27.547+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Start  Resource ]  [[ADDomain]newDomain]  "},
{"time": "2020-02-18T23:39:27.547+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Start  Test     ]  [[ADDomain]newDomain]  "},
{"time": "2020-02-18T23:39:27.765+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Querying for domain 'cjPATest5.local.nc'. (ADD0001)"},
{"time": "2020-02-18T23:39:28.484+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Exception Name: System.Security.Authentication.AuthenticationException"},
{"time": "2020-02-18T23:39:28.547+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Inner Exception Name: System.ServiceModel.Security.SecurityNegotiationException"},
{"time": "2020-02-18T23:39:29.265+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ End    Test     ]  [[ADDomain]newDomain]  in 1.7180 seconds."},
{"time": "2020-02-18T23:39:29.265+00:00", "type": "error", "message": "PowerShell DSC resource MSFT_ADDomain  failed to execute Test-TargetResource functionality with error message: System.InvalidOperationException: Error getting AD domain 'cjPATest5.local.nc'. (ADD0013) ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The system cannot contact a domain controller to service the authentication request. Please try again later\r\n   --- End of inner exception stack trace ---\r\n   at System.Net.Security.NegoState.StartSendAuthResetSignal(LazyAsyncResult lazyResult, Byte[] message, Exception exception)\r\n   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)\r\n   at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)\r\n   at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)\r\n   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)\r\n   --- End of inner exception stack trace ---\r\n\r\nServer stack trace: \r\n   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)\r\n   at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)\r\n   at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)\r\n   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)\r\n   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)\r\n   at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)\r\n   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)\r\n   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)\r\n   at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n   at Microsoft.ActiveDirectory.WebServices.Proxy.Resource.Get(Message request)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.SearchAnObject(ADSearchRequest request)\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowAuthenticationRelatedExceptionIfAny(CommunicationException exception)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.SearchAnObject(ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.Search(ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.ADWebServiceStoreAccess.Microsoft.ActiveDirectory.Management.IADSyncOperations.Search(ADSessionHandle handle, ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.ADObjectSearcher.GetRootDSE()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetRootDSE()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetConnectedStore()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetCmdletSessionInfo()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()\r\n   at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()\r\n   --- End of inner exception stack trace --- "},
{"time": "2020-02-18T23:39:29.281+00:00", "type": "verbose", "message": "[DC1]:                            [] Consistency check completed."}

@X-Guardian
Copy link
Contributor

Thanks @mitch-meade. This one is an AuthenticationException rather than the 'Server instance not found on the given port' error of the first logs you posted. These may all be transient errors that occur when the Dsc resource runs Get-ADDomain when the domain controller isn't full ready.

Can you modify line 103 of the MSFT_ADDomain\MSFT_ADDomain.psm1 file and add the AuthenticationException to the catch statement, so that this exception will trigger the retry mechanism, i.e.:

catch [Microsoft.ActiveDirectory.Management.ADServerDownException], [System.Security.Authentication.AuthenticationException]

Please leave the previous Write-Verbose lines in place too, and run the build again on a new machine.

@mitch-meade
Copy link
Author

mitch-meade commented Feb 19, 2020

The logs requested...

{"time": "2020-02-19T17:04:01.717+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Start  Resource ]  [[ADDomain]newDomain]  "},
{"time": "2020-02-19T17:04:01.717+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Start  Test     ]  [[ADDomain]newDomain]  "},
{"time": "2020-02-19T17:04:02.014+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Querying for domain 'cjPATest5.local.nc'. (ADD0001)"},
{"time": "2020-02-19T17:04:12.264+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Exception Name: System.ArgumentException"},
{"time": "2020-02-19T17:04:12.264+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Inner Exception Name: System.ServiceModel.FaultException"},
{"time": "2020-02-19T17:04:13.170+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ End    Test     ]  [[ADDomain]newDomain]  in 11.4530 seconds."},
{"time": "2020-02-19T17:04:13.170+00:00", "type": "error", "message": "PowerShell DSC resource MSFT_ADDomain  failed to execute Test-TargetResource functionality with error message: System.InvalidOperationException: Error getting AD domain 'cjPATest5.local.nc'. (ADD0013) ---> System.ArgumentException: Server instance not found on the given port. ---> System.ServiceModel.FaultException: The operation failed because of a bad parameter.\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForFaultDetail(FaultDetail faultDetail, FaultException faultException)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowException(AdwsFault adwsFault, FaultException faultException)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.SearchAnObject(ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.AdwsConnection.Search(ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.ADWebServiceStoreAccess.Microsoft.ActiveDirectory.Management.IADSyncOperations.Search(ADSessionHandle handle, ADSearchRequest request)\r\n   at Microsoft.ActiveDirectory.Management.ADObjectSearcher.GetRootDSE()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetRootDSE()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetConnectedStore()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetCmdletSessionInfo()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()\r\n   at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()\r\n   at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()\r\n   --- End of inner exception stack trace --- "},
{"time": "2020-02-19T17:04:13.170+00:00", "type": "verbose", "message": "[DC1]:                            [] Consistency check completed."}
]

@X-Guardian
Copy link
Contributor

Thanks @mitch-meade. It's a very generic exception, so can we capture some further details of the error record and exception to test against.

Please add the following code before line 109 (the second catch block) to catch this exception and give us some more details about it.

catch [System.ArgumentException]
{
    Write-Verbose -Message "ErrorRecord Details: $($_|fl -Force|Out-String)" -Verbose
    Write-Verbose -Message "Exception Details: $($_.Exception|fl -Force|Out-String)" -Verbose
    Write-Verbose -Message "Inner Exception Details: $($_.Exception.InnerException|fl -Force|Out-String)" -Verbose
    $domainFound = $false
}

@johlju johlju added the needs more information The issue needs more information from the author or the community. label Feb 19, 2020
@mitch-meade
Copy link
Author

mitch-meade commented Feb 19, 2020

@X-Guardian below are the additional details requested:

  {"time": "2020-02-19T21:33:57.379+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Start  Resource ]  [[ADDomain]newDomain]  "},
  {"time": "2020-02-19T21:33:57.379+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Start  Test     ]  [[ADDomain]newDomain]  "},
  {"time": "2020-02-19T21:33:57.629+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Querying for domain 'cjPATest5.local.nc'. (ADD0001)"},
  {"time": "2020-02-19T21:33:58.176+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] The AD Server for domain 'cjPATest5.local.nc' is currently down. (ADD0002)"},
  {"time": "2020-02-19T21:33:58.176+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Attempt 1 of 15 to call Get-ADDomain failed, retrying in 30 seconds. (ADD0010)"},
  {"time": "2020-02-19T21:34:28.491+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] ErrorRecord Details: 
  Exception             : System.ArgumentException: Server instance not found on the given port. --->
                           System.ServiceModel.FaultException: The operation failed because of a bad parameter.
                           --- End of inner exception stack trace ---
                           at 
                        Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForFaultDetail(FaultDetail 
                        faultDetail, FaultException faultException)
                           at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowException(AdwsFault adwsFault, 
                        FaultException faultException)
                           at Microsoft.ActiveDirectory.Management.AdwsConnection.SearchAnObject(ADSearchRequest 
                        request)
                           at Microsoft.ActiveDirectory.Management.AdwsConnection.Search(ADSearchRequest request)
                           at Microsoft.ActiveDirectory.Management.ADWebServiceStoreAccess.Microsoft.ActiveDirectory.Man
                        agement.IADSyncOperations.Search(ADSessionHandle handle, ADSearchRequest request)
                           at Microsoft.ActiveDirectory.Management.ADObjectSearcher.GetRootDSE()
                           at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetRootDSE()
                           at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetConnectedStore()
                           at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetCmdletSessionInfo()
                           at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRo
                        utine()
                           at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()
                           at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()
TargetObject          : cjPATest5.local.nc
CategoryInfo          : InvalidArgument: (cjPATest5.local.nc:ADDomain) [Get-ADDomain], ArgumentException
FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentException,Microsoft.ActiveDirectory.Management.Commands.Get
                        ADDomain
ErrorDetails          : 
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at Get-TargetResource, C:\\Program Files\\WindowsPowerShell\\Modules\\ActiveDirectoryDsc\\DscResource
                        s\\MSFT_ADDomain\\MSFT_ADDomain.psm1: line 101
                        at Test-TargetResource, C:\\Program Files\\WindowsPowerShell\\Modules\\ActiveDirectoryDsc\\DscResourc
                        es\\MSFT_ADDomain\\MSFT_ADDomain.psm1: line 327
PipelineIterationInfo : {}
PSMessageDetails      : "},
  {"time": "2020-02-19T21:34:28.491+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Exception Details: 
  Message        : Server instance not found on the given port.
  ParamName      : 
  Data           : {}
  InnerException : System.ServiceModel.FaultException: The operation failed because of a bad parameter.
  TargetSite     : Void ThrowExceptionForFaultDetail(Microsoft.ActiveDirectory.WebServices.Proxy.FaultDetail, 
                   System.ServiceModel.FaultException)
StackTrace     :    at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowExceptionForFaultDetail(FaultDetail 
                 faultDetail, FaultException faultException)
                    at Microsoft.ActiveDirectory.Management.AdwsConnection.ThrowException(AdwsFault adwsFault, 
                 FaultException faultException)
                    at Microsoft.ActiveDirectory.Management.AdwsConnection.SearchAnObject(ADSearchRequest request)
                    at Microsoft.ActiveDirectory.Management.AdwsConnection.Search(ADSearchRequest request)
                    at Microsoft.ActiveDirectory.Management.ADWebServiceStoreAccess.Microsoft.ActiveDirectory.Management
                 .IADSyncOperations.Search(ADSessionHandle handle, ADSearchRequest request)
                    at Microsoft.ActiveDirectory.Management.ADObjectSearcher.GetRootDSE()
                    at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetRootDSE()
                    at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetConnectedStore()
                    at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.GetCmdletSessionInfo()
                    at Microsoft.ActiveDirectory.Management.Commands.ADGetCmdletBase`3.ADGetCmdletBaseProcessCSRoutine()
                    at Microsoft.ActiveDirectory.Management.CmdletSubroutinePipeline.Invoke()
                    at Microsoft.ActiveDirectory.Management.Commands.ADCmdletBase`1.ProcessRecord()
HelpLink       : 
Source         : Microsoft.ActiveDirectory.Management
HResult        : -2147024809"},
  {"time": "2020-02-19T21:34:28.507+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Inner Exception Details: 
  Action         : 
  Code           : System.ServiceModel.FaultCode
  Message        : The operation failed because of a bad parameter.
  Reason         : The operation failed because of a bad parameter.
  Data           : {}
  InnerException : 
  TargetSite     : 
  StackTrace     : 
  HelpLink       : 
  Source         : 
  HResult        : -2146233087"},
  {"time": "2020-02-19T21:34:28.507+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Attempt 2 of 15 to call Get-ADDomain failed, retrying in 30 seconds. (ADD0010)"},
  {"time": "2020-02-19T21:34:59.104+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] Active Directory domain 'cjPATest5.local.nc' found. (ADD0003)"},
  {"time": "2020-02-19T21:34:59.213+00:00", "type": "verbose", "message": "[DC1]:                            [[ADDomain]newDomain] The domain 'cjPATest5.local.nc' is in the desired state. (ADD0008)"},
  {"time": "2020-02-19T21:34:59.213+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ End    Test     ]  [[ADDomain]newDomain]  in 61.8340 seconds."},
  {"time": "2020-02-19T21:34:59.213+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ Skip   Set      ]  [[ADDomain]newDomain]  "},
  {"time": "2020-02-19T21:34:59.213+00:00", "type": "verbose", "message": "[DC1]: LCM:  [ End    Resource ]  [[ADDomain]newDomain]  "},

@X-Guardian
Copy link
Contributor

Cheers @mitch-meade, I'll raise a new PR to add checks for these exceptions into the resource.

@mitch-meade
Copy link
Author

mitch-meade commented Feb 19, 2020

Thanks for your fast response… In the mean time, while 6.0.0 is making its way to production, I've created a custom version of 5.0.0 with the check discovered earlier and it appears to be working. I'll use this resource until 6.0.0 has been tested and available.

@X-Guardian X-Guardian added bug The issue is a bug. in progress The issue is being actively worked on by someone. and removed needs more information The issue needs more information from the author or the community. labels Mar 1, 2020
@X-Guardian X-Guardian self-assigned this Mar 1, 2020
johlju pushed a commit that referenced this issue Mar 9, 2020
- ADDomain
  - Added additional Get-ADDomain retry exceptions (issue #574).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants