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

SqlProtocolTcpIp: Throws exception when used with SQL Server 2022 #1805

Closed
johlju opened this issue Nov 26, 2022 · 1 comment
Closed

SqlProtocolTcpIp: Throws exception when used with SQL Server 2022 #1805

johlju opened this issue Nov 26, 2022 · 1 comment
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Nov 26, 2022

Problem description

When running the integration tests for SqlProtocolTcpIp, on the build worker that have installed the SQL Server 2022 of the Database Engine, it fails with an exception. It seems it fails when getting the current state.

To reproduce, enable the Pester tag 'Integration_SQL2022' on line 39 in the integration tests of SqlProtocolTcpIp and then run the pipeline (or the integration test).

This has probably something to do with the type Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer. Maybe we need to install a newer version of the SqlServer PowerShell module. But it is all a guess since I have not debugged the resource. 🤔

Verbose logs

##[error]    [-] Should compile and apply the MOF without throwing 2.22s (2.21s|8ms)
##[error]     Expected no exception to be thrown, but an exception "PowerShell DSC resource DSC_SqlProtocol  failed to execute Test-TargetResource functionality with error message: System.InvalidOperationException: Failed to obtain a SQL Server instance with name 'DSCSQLTEST' on server 'fv-az33-436'. Ensure the SQL Server instance exists on the server and that the 'SQLServer' module references a version of the 'Microsoft.SqlServer.Management.Smo.Wmi' library that supports the version of the SQL Server instance. (SQLCOMMON0070) " was thrown from D:\a\1\s\tests\Integration\DSC_SqlProtocolTcpIp.Integration.Tests.ps1:74 char:17
##[error]         + ...               Start-DscConfiguration @startDscConfigurationParameters
##[error]         +                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
##[error]     at } | Should -Not -Throw, D:\a\1\s\tests\Integration\DSC_SqlProtocolTcpIp.Integration.Tests.ps1:75

DSC configuration

See integration tests configuration.

Suggested solution

Unknown. But seems this need to be handled differently for SQL Server 2022.

SQL Server edition and version

SQL Server 2022 (GA)

SQL Server PowerShell modules

SqlServer 21.1.18256 (as installed by integratation tests)

Operating system

Windows Server 2019 and Windows Server 2022

PowerShell version

Unknown (the version build pipeline uses)

SqlServerDsc version

Code in main branch.
@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Nov 26, 2022
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 26, 2022
@johlju
Copy link
Member Author

johlju commented Jan 22, 2023

This was resolved with PR #1808. To use this resource on SQL Server 2022 the SqlServer module 22.0.49-preview is needed, and also the latest preview of SqlServerDsc (building and deploying as I write this).

@johlju johlju closed this as completed Jan 22, 2023
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Jan 22, 2023
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

No branches or pull requests

1 participant