Dbatools: [Bug] Restart-DbaService fails when Polybase feature or Launchpad is installed

Created on 7 Apr 2020  路  4Comments  路  Source: sqlcollaborative/dbatools

Environmental information

#### PowerShell version:

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




#### dbatools Module version:


Name    : dbatools
Path    : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.104\dbatools.psd1
Version : 1.0.104

Name    : dbatools
Path    : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.103\dbatools.psd1
Version : 1.0.103

Name    : dbatools
Path    : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.91\dbatools.psd1
Version : 1.0.91






PS C:\WINDOWS\system32> Get-Culture

LCID Name DisplayName
---- ---- -----------
1031 de-DE German (Germany)

SQL Server:

Microsoft SQL Server 2017 (RTM-CU19) (KB4535007) - 14.0.3281.6 (X64) Jan 23 2020 21:00:04 Copyright (C) 2017 Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: ) (Hypervisor)

and

Microsoft SQL Server 2019 (RTM-CU3) (KB4538853) - 15.0.4023.6 (X64) Mar 4 2020 00:59:26 Copyright (C) 2019 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: ) (Hypervisor)


/* REPLACE WITH output of @@LANGUAGE */

Report

Host used

  • [x ] powershell.exe
  • [x ] ISE
  • [x ] VS Code
  • [ ] Other (please specify)

If anything other than powershell.exe was used, please confirm that you can duplicate the issue with powershell.exe

  • [x ] Still buggy in powershell.exe

Errors Received

WARNING: [10:08:59][Update-ServiceStatus] (MSSQLSERVER on MYSERVER) The attempt to stop the service returned the
following error: The service cannot be stopped because other services that are running are dependent on it.
WARNING: [10:08:59][Update-ServiceStatus] (MSSQLSERVER on MYSERVER) Run the command with '-Force' switch to
force the restart of a dependent SQL Agent

Steps to Reproduce

SQL Server 2017 with R intergration installed, e.g. Launchpad service is available
SQL Server 2019 with Polybase integration, e.g. SQLPBENGINE and SQLPBDMS

Import-Module dbatools
$target = "MyTarget"
Restart-DbaService -ComputerName $target -Type Engine -force

Expected Behavior

That the DB Egnine would restart with all dependant services

Actual Behavior

Engine does not restart, only the Agent.
Warning that there are dependencies:
The attempt to stop the service returned the following error: The service cannot be stopped because other services that are running are dependent on it.

bugs_life

Most helpful comment

Hi @nvarscar, I have submitted PR#6458 to fix this. I see here that you may have been looking at this previously. Feel free to give a code review / comment there if you would have fixed differently.

All 4 comments

Yes, those dependencies were never tracked. Could you please provide all the service names in case I won't be able to repro your exact configuration in my lab?

Hi @nvarscar, I have submitted PR#6458 to fix this. I see here that you may have been looking at this previously. Feel free to give a code review / comment there if you would have fixed differently.

Yes, those dependencies were never tracked. Could you please provide all the service names in case I won't be able to repro your exact configuration in my lab?

Sorry @nvarscar
I did not recognize your comment (shame on me).

So, on the one hand you have MSSQLLaunchpad
On the other SQLPBDMS and SQLPBENGINE
What I did not test right now is if you will also have different Polybase service names in combination with a named instance.

You won't get Polybase for each instance, it has a standalone setup or a scale-out group....but I'm not sure what a scale-out group looks like.

Was this page helpful?
0 / 5 - 0 ratings