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

SqlServerNetwork: Fails when with non specific error message when Database Engine is not installed #581

Closed
johlju opened this issue May 27, 2017 · 3 comments · Fixed by #1172
Assignees
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented May 27, 2017

Details of the scenario you tried and the problem that is occurring:
When using xSQLServerNetwork resource on a configuration without SQLENGINE the resource fails with the following error message.

Cannot find path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Setup' because it does not exist.
    + CategoryInfo          : ObjectNotFound: (HKLM:\SOFTWARE\...QL Server\Setup:) [], CimException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand
    + PSComputerName        : sqltest.company.local

Cannot validate argument on parameter 'ApplicationDomain'. The argument is null. Provide a valid value for the argument, and then try running the command again.
    + CategoryInfo          : InvalidData: (:) [], CimException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Unregister-SqlAssemblies
    + PSComputerName        : sqltest.company.local

It could write out a warning, or throw, that SQLENGINE is not installed so it can't do anything. I don't know whats better, throwing or write a warning. There might be a scenario where throwing would be better so it is logged that the configuration was not correct.

The DSC configuration that is using the resource (as detailed as possible):
Install any feature except SQLENGINE and run this configuration.

xSQLServerNetwork 'InstanceNetworkConfiguration'
{
    SQLServer = $Node.NodeName
    InstanceName = $Node.InstanceName
    ProtocolName = 'Tcp'
    IsEnabled = $true
    TcpDynamicPorts = '0'
    RestartService = $true

    PsDscRunAsCredential = $SqlInstallCredential
}

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2012 R2, SQL Server 2014, 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

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels May 27, 2017
@nabrond
Copy link
Contributor

nabrond commented Oct 15, 2017

@johlju I think this issue was resolved by #538.

@johlju
Copy link
Member Author

johlju commented Oct 15, 2017

Hmm... I'm not certain. #538 was merged on May 21:st, I submitted this on May 27:th.

I see my error reporting is lacking. I think the problem was that it do write out those errors but don't actually throw an error so execution is stopped. I think I come across that accidentally when I had this resource in the configuration when I tested configuring a Reporting Services.

I think we keep it open until we can validate if it is a problem or not. 😄

@nabrond
Copy link
Contributor

nabrond commented Oct 17, 2017

My thinking was that the error message stated that a registry path was missing. This would absolutely be the case if SQL Server was not installed. It appears this path was used to build a unique name for the AppDomain used to load the libraries used by WMI. When you refactored the code in #538, the dependency on the registry path was removed.

@johlju johlju changed the title xSQLServerNetwork: Fails when with non specific error message when Database Engine is not installed SqlServerNetwork: Fails when with non specific error message when Database Engine is not installed Dec 24, 2017
@johlju johlju self-assigned this Jul 4, 2018
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Jul 6, 2018
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants