-
Notifications
You must be signed in to change notification settings - Fork 141
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
WaitADDomain: fails if DC not ready #530
Comments
Hi @Crusad, looking at the
|
Yes I agree, it looks like another error makes the resource not wait the 900 seconds (the timeout value) as it should 🤔 |
Yes, I see @Crusad is using Server 2019, so I'm suspicious that the exception name may have changed that the function is catching on. |
I will definitely test what @X-Guardian suggested, just testing this is a bit time-consuming for me and I was too busy past two days to get into it. I will get back to you with results. And yep, I am using 2019 (1809). |
@X-Guardian So I've come across this issue myself when I'm attempting to create a new lab environment. This involves a server waiting for a domain controller to come online and results in the following entry being added to the "Desired State Configuration - Operational" event log:
Reviewing the
I've also made the update to the exception handler as requested above and the following information is returned:
This is re-thrown from the following line where it is never handled from ActiveDirectoryDsc/source/Modules/ActiveDirectoryDsc.Common/ActiveDirectoryDsc.Common.psm1 Line 2073 in 5ea5a13
Please let me know if you require any further information to help recreate this issue. |
Hi @xpn. Thanks for the extra info. With your code snippet I can reproduce the error and see the problem. The exception thrown is of type Should be a simple case of adding a check to the I'm happy to review a PR if you want to submit one? |
OK I've done some more testing on this, and I think we still have an issue with a different exception. Expanding @xpn's code snippet with a
For me, both on a 2012 R2 server running PowerShell 4 and a 2019 server running PowerShell 5.1, the above code hits the We must therefore be hitting a different exception. @xpn, if you are able to recreate this consistently within a DSC run, can you add the following code just before both
This will hopefully give us the information we need to fix this. |
Hmm, yeah I can recreate this with the code example above, similar if you remove the catch for the I'll spin up the lab and test with your requested code and get back to you. |
@X-Guardian I added verbose logging on both
|
Cheers @jcuzzi, you are right, having the
For me, the exception is now caught by the |
WaitADDomain: fails if DC not ready
Verbose logs showing the problem
Suggested solution to the issue
Wait until the DC is ready
The DSC configuration that is used to reproduce the issue (as detailed as possible)
I create new server and wait for DC to become ready to join the domain. If the DC is ready, server joins the domain without problem, but if WaitForADDomain runs when DC is being configured, the resource fails. During the next consistency check the server joins the domain as the DC is ready by that time (also proving the configuration is hopefully correct).
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
4.2.0.0
The text was updated successfully, but these errors were encountered: