-
Notifications
You must be signed in to change notification settings - Fork 225
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: SQL2019 not supported via 'SqlServer' module (and old 'Microsoft.SqlServer.SqlWmiManagement' libary/version?) #1628
Comments
Shout in the meantime if there are any questions. |
Thank you for the detailed investigation into this! Appreciate it! If I understand the conclusion it sounds that the fix is fairly simple by adding the mentioned error handling, so it throws an error if the object returned is not an instance (e.g. |
Yes. It took a bit of tracking down but I didn’t want to waste the investigation without some documentation of it. Incidentally, I’ve not had chance to retry with a later version of the ‘SQLServer’ module yet, but I believe the fix (suggested above) will at least save somebody else falling down this rabbit hole whilst investigating this issue. |
I was finally able to get around to retrying the above functionality this week. It does seem that upgrading the I've submitted PR #1651 to resolve the outstanding issue (i.e. catch the scenario where there are no SQL instances found within Shout if you've any questions. |
Details of the scenario you tried and the problem that is occurring
Background
I've been attempting to install SQL Server 2019 (not using any Cumulative Updates, yet) using the
SqlServerDsc
module's resources. The installation has been performed correctly (making use of theSQLSetup
resource), up until I attempt to set the TCP port number for the SQL Instance using the combination of related, resources within theSqlServerDsc
PSModule - These areSqlProtocol
andSqlProtocolTcpIp
(example usage below).I have kept hitting the scenario where the ports are not set to what I was/am expecting. The SQL instances installed seem to be using dynamic ports (I'm intending to set them as fixed for
IP1
,IP2
,IP3
andIPAll
).The short answer to all of this might be to add an additional check/guard clause in
Get-ServerProtocolObject
to ensure there is aServerInstance
obtained (rather than proceeding silently without one), but I was putting this together as investigating in case anyone else hit this problem/issue.Investigations
I believe I've traced this problem back to the
Get-ServerProtocolObject
function within the included/embeddedSqlServerDsc.Common
PSModule (within theSqlServerDsc
PSModule).As part of this function, it performs...
... but the
ServerInstances
array property on the$managedComputerObject
object appears to be empty, even after a successful installation of SQL2019. where:Get-Service
I'd also noticed that the other properties on the
$managedComputerObject
object were empty arrays (i.e.Services
andClientProtocols
). This got me looking in the direction of the versions of binaries used.Findings
So, seeming, the
Get-ServerProtocolObject
function in theSqlServerDsc.Common
PSModule (embedded inSqlServerDsc module) is making use of the [
Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer](https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.management.smo.wmi.managedcomputer?view=sqlserver-2016&viewFallbackFrom=sqlserver-2019) type/class. This appears to be being obtained from the
SqlServer` PSModule.Having reviewed various sources of
Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer
, I've determined:SqlServer
PSModule v21.0.17279 ...(I was using this)... is usingMicrosoft.SqlServer.Management.Smo.Wmi.ManagedComputer
v14.0.17279.0SqlServer
PSModule v21.1.18229 ...(latest version)... is usingMicrosoft.SqlServer.Management.Smo.Wmi.ManagedComputer
v15.0.18229.0Microsoft.SqlServer.SqlManagementObjects
NuGet package v161.44091.28 is usingMicrosoft.SqlServer.Management.Smo.Wmi.ManagedComputer
v16.200.44091.28Note that the version of the
SqlServer
PSModule I was using also didn't seem to work withSQL2017
(as I'd perhaps expect given that it was using a v14.0 version ofMicrosoft.SqlServer.Management.Smo.Wmi.ManagedComputer
)? ... not looked too much further that that though.... so, as a result of all that, my conclusion is that:
SqlServer
module I was using doesn't yet supportSQL2019
through use ofMicrosoft.SqlServer.Management.Smo.Wmi.ManagedComputer
(or there is a problem/issue with it, and.or how it's used, and/or one or more referenced libraries it uses) .... sorry, not too narrowly scoped.Get-ServerProtocolObject
function within the included/embeddedSqlServerDsc.Common
PSModule (within theSqlServerDsc
PSModule) is continuing to execute, without raising an error/exception, even if it cannot obtain aServerInstance
and cannot assign it to the$serverInstance
within that function .... which then effectively makes the rest of the function perform nothing (and leaves the user of the DSC (i.e. myself in this case :) ) resource puzzled as to why the ports haven't been updated.Verbose logs showing the problem
N/A
Suggested solution to the issue
Seemingly, updating the installed
Sqlserver
module to v21.1.18229 does seem to resolve this (in terms of getting my test script working) although doesn't handle the "silent error" withinGet-ServerProtocolObject
.I'm going to try a complete rebuild and reinstall of SQL 2019 using the newer module over the next day or two (depending on priorities). I'll reply to this post/issue with any results and whether that resolved the installation.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
...and in addition to the above, I'd made a cut-down script (including tiny edits to functions to remove need for exception functions etc.) to test the scenario...
SQL Server edition and version the target node is running
SQL Server 2019 Enterprise
SQL Server PowerShell modules present on the target node
Further module version information above but....
SqlServer 21.1.18229 C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.1.18229\SqlServer.psd1
SqlServer 21.0.17279 C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.0.17279\SqlServer.psd1
SQLPS 15.0 C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\SQLPS\SQLPS.psd1
The operating system the target node is running
OsName : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.3986.amd64fre.rs1_release.201002-1707
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
PSVersion 5.1.14393.3866
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.3866
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used
SqlServerDsc 14.2.1 C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\14.2.1\SqlServerDsc.
The text was updated successfully, but these errors were encountered: