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

Install-SqlDscServer: Fails to install when missing ASSysAdminAccounts #1845

Closed
johlju opened this issue Feb 1, 2023 · 0 comments · Fixed by #1863
Closed

Install-SqlDscServer: Fails to install when missing ASSysAdminAccounts #1845

johlju opened this issue Feb 1, 2023 · 0 comments · Fixed by #1863
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub

Comments

@johlju
Copy link
Member

johlju commented Feb 1, 2023

Problem description

When installing the feature AS and not providing the non-mandatory parameter ASSysAdminAccounts results in failure.

Verbose logs

Microsoft (R) SQL Server 2022 16.00.1000.06
Copyright (c) 2022 Microsoft.  All rights reserved.

The following error occurred:
You must provision the system with at least one system administrator.

Error result: -2068578304
Result facility code: 1204
Result error code: 0

Please review the summary.txt log for further details
Invoke-SetupAction : Setup exited with code '-2068578304'. Please see the 'Summary.txt' log file in the 'Setup Bootstra
p\Log' folder.
At C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\16.1.0\SqlServerDsc.psm1:7399 char:5
+     Invoke-SetupAction @PSBoundParameters -ErrorAction 'Stop'
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (SQL2022:String) [Invoke-SetupAction], Exception
    + FullyQualifiedErrorId : ISA0001,Invoke-SetupAction

How to reproduce

Run the following command, not providing the parameter ASSysAdminAccounts.

Install-SqlDscServer -Install -AcceptLicensingTerms -MediaPath e:\ -InstanceName 'SQL2022' -Features 'AS' -SqlSysAdminAccounts 'sqladmin@dscadlab.com' -SuppressPrivacyStatementNotice  -Verbose

Expected behavior

Throw an exception saying mandatory parameter ASSysAdminAccounts is missing.

Current behavior

Starting the installation resulting in failure.

Suggested solution

Add logic to handle that when feature AS is installed that the parameter ASSysAdminAccounts must also be specified.

Operating system the target node is running

OsName               : Microsoft Windows Server 2022 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.20348.859
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.859
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module version used

Name         Version Path
----         ------- ----
SqlServerDsc 16.1.0  C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\16.1.0\SqlServerDsc.psd1
@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub labels Feb 1, 2023
@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Mar 4, 2023
johlju added a commit that referenced this issue Mar 4, 2023
…unts` (#1863)

- `Assert-SetupActionProperties`
  - Now throws an exception if the setup action is `Install` and the feature
    analysis services is specified without the parameter `ASSysAdminAccounts`
    (issue #1845).
  - Now throws an exception if the setup action is `Install` and the feature
    database engine is specified without the parameter `SqlSysAdminAccounts`.
- `Invoke-SetupAction`
  - The parameter `SqlSysAdminAccounts` is no longer mandatory to allow
    installation where the database engine is not installed.
- `Install-SqlDscServer`
  - The parameter `SqlSysAdminAccounts` is no longer mandatory to allow
    installation where the database engine is not installed.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant