Friday, February 25, 2022

Cannot open backup device. Operating system error 5(Access is denied.). RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

Came across this error while trying to restore a SQL database backup which was stored in a container to Azure SQL managed instance.

Operating system error 5(Access is denied.).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

The blob would connect properly and show the backup file.

Solution:

Deleted the stored credentials in the database and did the process again for restoring backup.





Monday, February 14, 2022

Service time out. Failed to start in time : ServicesPipeTimeout registry setting

Create the following DWORD registry key in on your Windows Server in.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

Name: ServicesPipeTimeout
Type: REG_DWORD
Data: The number of milliseconds that you want to give the services to start in.

 

I have entered 300000 which is 5 minutes.

 

 

 Here is a small script if you want to run this on multiple servers remotely.

$colComputers = @("GATEWAY1","GATEWAY2")

foreach ($strComputer in $colComputers)

 {
  #Open remote registry
  $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $strComputer)
  #Open the targeted remote registry key/subkey for read and write ($True)
  $regKey= $reg.OpenSubKey("SYSTEM\CurrentControlSet\Control",$True)
  $regKey.Setvalue('ServicesPipeTimeout',300000, 'dword')
  $reg.Close
 }