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

Get-DBAStartupParameter against an FCI randomly returns null results or arrays of arbitrary length #9465

Open
hotsauceror opened this issue Sep 10, 2024 · 1 comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers

Comments

@hotsauceror
Copy link

Verified issue does not already exist?

No, I did not search

What error did you receive?

$ get-dbastartupparameter -sqlinstance VNN.DOMAIN\mssqlserver -credential $t1

ComputerName         : VNN.DOMAIN
InstanceName         :
SqlInstance          :
MasterData           : f:\sql\bin\mssql\MSSQL15.MSSQLSERVER\MSSQL\Data\master.mdf
MasterLog            : f:\sql\bin\mssql\MSSQL15.MSSQLSERVER\MSSQL\Data\\mastlog.ldf
ErrorLog             : f:\sql\bin\mssql\MSSQL15.MSSQLSERVER\MSSQL\Log\ERRORLOG
TraceFlags           : {4618, 4610, 9567}
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      : -df:\sql\bin\mssql\MSSQL15.MSSQLSERVER\MSSQL\Data\master.mdf;-ef:\sql\bin\mssql\MSSQL15.MSSQLSERVER\MSSQL\Log\ERRORLOG;-lf:\sql\bin\mssql\MSSQL15.MSSQLSERVER\MSSQL\Data\\mastlog.ldf;-T4618;-T4610;-T9567

$ get-dbastartupparameter -sqlinstance VNN.DOMAIN\mssqlserver -credential $t1


ComputerName         : VNN.DOMAIN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN.DOMAIN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN.DOMAIN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN.DOMAIN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN.DOMAIN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :



$ get-dbastartupparameter -sqlinstance VNN -credential $t1


ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :



get-dbastartupparameter -sqlinstance VNN -credential $t1                                                                                                                                                             

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :

ComputerName         : VNN
InstanceName         :
SqlInstance          :
MasterData           : {}
MasterLog            : {}
ErrorLog             : {}
TraceFlags           : None
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      :



$ get-dbastartupparameter -sqlinstance STANDALONE -credential $t1                                                                                                                                                             

ComputerName         : STANDALONE
InstanceName         :
SqlInstance          :
MasterData           : f:\sql\sys\mssql\master.mdf
MasterLog            : f:\sql\sys\mssql\mastlog.ldf
ErrorLog             : f:\sql\bin\mssql\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG
TraceFlags           : {4610, 4618, 9567}
DebugFlags           : None
CommandPromptStart   : False
MinimalStart         : False
MemoryToReserve      : 0
SingleUser           : False
SingleUserName       :
NoLoggingToWinEvents : False
StartAsNamedInstance : False
DisableMonitoring    : False
IncreasedExtents     : False
ParameterString      : -df:\sql\sys\mssql\master.mdf;-ef:\sql\bin\mssql\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG;-lf:\sql\sys\mssql\mastlog.ldf;-T4610;-T4618;-T9567

Steps to Reproduce

get-dbastartupparameter -sqlinstance $VNN -credential $CRED

or

$result = get-dbastartupparmaeter -sqlinstance $VNN -credential $CRED 
# please include variable values (redacted or fake if needed) for reference

Please confirm that you are running the most recent version of dbatools

2.1.14

Other details or mentions

This behavior only happens with FCIs.

I am running this against a two-node multi-subnet FCI. I have confirmed that the FCI is online and in good state. I'm pulling the master data and log paths for some code that moves the system dbs. The script that performs the work randomly fails with "cannot call a method on a null object" and in rarer cases "there is no TraceFlags property on the object".

I ran the same code successfully against a half-dozen standalone instances last week and all returned the expected result set, every time.

The FCI behavior is unpredictable, and varies inconsistently with whether I pass the 'short' name, the FQDN, etc. Sometimes it returns an array where the first object is null and the rest are correct; sometimes it returns an array of three objects, sometimes it returns an array of up to eight objects, and sometimes it returns a single object. I assume it is iterating over multiple variants of the FCI name and over each cluster node, but I cannot put any rhyme or reason to it. Nor can I figure out why sometimes it returns exactly what it ought, and then fails several times in a row, with different results.

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

5.1.19041.4780

SQL Server Edition and Build number

Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Datacenter 10.0 (Build 20348: ) (Hypervisor)

.NET Framework Version

.NET Framework 4.8.9261.0

@hotsauceror hotsauceror added bugs life triage required New issue that has not been reviewed by maintainers labels Sep 10, 2024
@hotsauceror
Copy link
Author

Sorry. I did search for existing errors, and the closest I could find was #7035. That didn't seem related at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant