dsccommunity / dsccommunity/SqlServerDsc
SqlSetup: Exit codes from setup process are not trustworthy
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 385
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you tried and the problem that is occurring:
Currently there is no check for what exit code the setup process exits with.
In PR #578 it adds (when merged) reporting of exit code to the verbose logs when setup process exits. Also added so it catches exit code 3010 (see issue #565) so it writes a warning that reboot is required (partly fixes #565).
Thus I expected exit code 0 to be 'Successful'. And maybe it is. I have not been able to verify that.
And if exit code is anything but 0 and 3010 it will throw an error saying that setup failed, and check the summary,txt log file.
Well, it seems it wasn't quit that simple. I'm getting strange exit codes. Sometimes I get exit code is that sometime the exit code -2061893627 when the summary.txt file says exit code 3010. But most of the time I get the correct exit code 3010 from the process (which is correct).
I can't find any documentation around exit codes from SQL Server setup.exe.
The DSC configuration that is using the resource (as detailed as possible):
xSQLServerSetup 'InstallSQL2016'
{
InstanceName = $Node."$($currentSqlInstance)InstanceName"
Features = $Node."$($currentSqlInstance)InstallFeatures"
BrowserSvcStartupType = 'Automatic'
SQLCollation = 'Finnish_Swedish_CI_AS'
SQLSvcAccount = $SqlServiceCredential
AgtSvcAccount = $SqlAgentServiceCredential
ASSvcAccount = $SqlServiceCredential
SQLSysAdminAccounts = 'COMPANY\SQL Admins', $SqlAdministratorCredential.UserName
SourcePath = $Node."SourcePath$($currentSqlInstance)"
UpdateEnabled = 'False'
SuppressReboot = $false
ForceReboot = $false
SourceCredential = $SqlInstallCredential
PsDscRunAsCredential = $SqlInstallCredential
DependsOn = '[WindowsFeature]NetFramework35','[WindowsFeature]NetFramework45'
}
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2012, SQL Server 2016, WMF 5.0
What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
n/a
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SqlSetup setup-process exit-code handling and compare the process result with the SQL Server summary.txt exit code, including 3010 and -2061893627. Done should mean the resource reliably interprets the setup result and reports success, reboot-required, or failure consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100