SQL Server Setup – Could not allocate space for object ‘dbo.Large Object Storage System object: 422212467425280’ in database ‘tempdb’ because the ‘PRIMARY’ filegroup is full

-> I installed SQL Server 2019 and then tried applying Cumulative update 5 on top of it.

-> SQL Server 2019 CU5 failed with below error,

TITLE: SQL Server Setup failure.
SQL Server Setup has encountered the following error:
The NT service ‘SQLAgent$IN01’ could not be started.
Error code 0x84B20001.


For help, click: https://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&EvtType=0xAE7B8BF3%25400xF762992B%25401202%25401

BUTTONS:
OK

-> SQL Server was down. Received below error when tried starting SQL Service manually from configuration manager,

SQL Server Configuration Manager

The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.

OK

-> Checking SQL Server error log as the above error is very generic,

2020-08-02 14:51:26.78 Server Microsoft SQL Server 2019 (RTM-CU5) (KB4552255) – 15.0.4043.16 (X64)
Jun 10 2020 18:25:25
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Windows Server 2016 Datacenter 10.0 (Build 14393: ) (Hypervisor)

-> SQL Server error log shows that SQL Server is upgraded to 15.0.4043.

-> Checking further in SQL Server error log,

2020-08-02 14:51:30.26 spid9s Database ‘master’ is upgrading script ‘msdb110_upgrade.sql’ from level 251660240 to level 251662283.
2020-08-02 14:51:30.26 spid9s ———————————-
2020-08-02 14:51:30.26 spid9s Starting execution of PRE_MSDB.SQL
2020-08-02 14:51:30.26 spid9s ———————————-
2020-08-02 14:51:30.42 spid9s Setting database option COMPATIBILITY_LEVEL to 100 for database ‘msdb’.
2020-08-02 14:51:30.46 spid9s —————————————–
2020-08-02 14:51:30.46 spid9s Starting execution of PRE_SQLAGENT100.SQL
2020-08-02 14:51:30.46 spid9s —————————————–
.
.
.
2020-08-02 14:51:35.25 spid9s Creating procedure sp_purge_jobhistory…
2020-08-02 14:51:35.29 Logon Error: 18401, Severity: 14, State: 1.
2020-08-02 14:51:35.29 Logon Login failed for user ‘JBSQL1\jvivek2k1’. Reason: Server is in script upgrade mode. Only administrator can connect at this time. [CLIENT: ]
2020-08-02 14:51:35.29 spid9s
2020-08-02 14:51:35.29 spid9s Creating procedure sp_help_jobhistory…
2020-08-02 14:51:35.29 Logon Error: 18401, Severity: 14, State: 1.
2020-08-02 14:51:35.29 Logon Login failed for user ‘JBSQL1\jvivek2k1’. Reason: Server is in script upgrade mode. Only administrator can connect at this time. [CLIENT: ]
.
.
.
2020-08-02 15:08:51.69 spid9s Error: 1105, Severity: 17, State: 2.
2020-08-02 15:08:51.69 spid9s Could not allocate space for object ‘dbo.Large Object Storage System object: 422212467294208’ in database ‘tempdb’ because the ‘PRIMARY’ filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

2020-08-02 15:08:51.69 spid9s Error: 7399, Severity: 16, State: 1.
2020-08-02 15:08:51.69 spid9s The OLE DB provider “BULK” for linked server “(null)” reported an error. The provider did not give any information about the error.
2020-08-02 15:08:51.69 spid9s Error: 7330, Severity: 16, State: 2.
2020-08-02 15:08:51.69 spid9s Cannot fetch a row from OLE DB provider “BULK” for linked server “(null)”.
2020-08-02 15:08:51.69 spid9s Error: 912, Severity: 21, State: 2.
2020-08-02 15:08:51.69 spid9s Script level upgrade for database ‘master’ failed because upgrade step ‘msdb110_upgrade.sql’ encountered error 7330, state 2, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
2020-08-02 15:08:51.70 spid9s Error: 3417, Severity: 21, State: 3.
2020-08-02 15:08:51.70 spid9s Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
2020-08-02 15:08:51.73 spid9s SQL Trace was stopped due to server shutdown. Trace ID = ‘1’. This is an informational message only; no user action is required.

-> The script upgrade mode fails due to insufficient space in Tempdb.

-> I have added Trace flag 902 temporarily which stops script upgrade mode for troubleshooting purpose.

-> I started the SQL Services with trace flag 902 and checked the reason why tempdb was full.

-> I was able to see that autogrowth for Tempdb was disabled and the size was just 8 MB as I left the default value during SQL Server install.

-> It seems like I disabled the autogrowth value for tempdb, but forgot to increase the tempdb file size.

-> I enabled autogrowth for Tempdb files.

-> Removed Trace flag 902 from SQL Services and restarted SQL Services.

-> It did started fine this time and could login to SQL Server without any issues.

-> I checked SQL server error log and there were no errors.

-> Since the CU 5 install crashed with “Could not start SQL Server” error. I decided to repair the SQL server instance, just to make sure there are no issues.

-> SQL Server repair completed fine.

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.

VS Shell installation has failed with exit code 1638

-> SQL Server 2016 installation failed with below error,

TITLE: Microsoft SQL Server 2016 Setup
——————————
The following error has occurred:
VS Shell installation has failed with exit code 1638.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.5026.0&EvtType=0x5B39C8B9%25401434%25403
——————————
BUTTONS:
OK
——————————

-> In my case, all components completed fine except Integration Services. Below was the error found during setup for Integration services,

Action required:
Use the following information to resolve the error, and then try the setup process again.
Feature failure reason:
An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Error details:
§ Error installing Microsoft Visual C++ 2015 Redistributable
VS Shell installation has failed with exit code 1638.
Error code: 1638
Log file: C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20191119_153017\VCRuntime140_x64_Cpu64_1.log
Visit http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.5026.0&EvtType=VCRuntime140_x64%40Install%400×1638 to get help on troubleshooting.
Product Update:
Product Update has successfully applied KB 4052908 <http://support.microsoft.com/?id=4052908&gt;. These updates have set the patch level of the Setup operation to 13.2.5026.0.

-> Above error is pretty clear that it is not able to install Microsoft Visual C++ 2015 Redistributable.

-> Details.txt contained below message/error,

(04) 2019-11-19 15:42:11 Slp: The directory monitor thread is interrupted due to the following exception while monitoring the notifications for directory ‘C:\Program Files\Microsoft SQL Server\’
(04) 2019-11-19 15:42:11 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(04) 2019-11-19 15:42:11 Slp: Inner exceptions are being indented
(04) 2019-11-19 15:42:11 Slp:
(04) 2019-11-19 15:42:11 Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException
(04) 2019-11-19 15:42:11 Slp: Message:
(04) 2019-11-19 15:42:11 Slp: The directory monitor thread is interrupted. Message: ‘The directory monitor thread is interrupted due to a StopMonitor call.’
(04) 2019-11-19 15:42:11 Slp: HResult : 0x86a40016
(04) 2019-11-19 15:42:11 Slp: FacilityCode : 1700 (6a4)
(04) 2019-11-19 15:42:11 Slp: ErrorCode : 22 (0016)
(04) 2019-11-19 15:42:11 Slp: Data:
(04) 2019-11-19 15:42:11 Slp: ErrorMessage = The directory monitor thread is interrupted due to a StopMonitor call.
(04) 2019-11-19 15:42:11 Slp: WatsonData = Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException@22
(04) 2019-11-19 15:42:11 Slp: Stack:
(04) 2019-11-19 15:42:11 Slp: at Microsoft.SqlServer.Configuration.Sco.DirectoryMonitor.Monitor()

-> Tried this article. But Integration Services installation failed again with same error.

-> Checked Add/Remove programs for list of “Microsoft Visual C++ ….” installation and I could see Visual C++ 2013, 2015, 2017 Redistributable  installed.

-> I was installing SQL Server 2016 on a new server with no other SQL Server instances. So i thought of uninstalling Microsoft Visual C++ 2015, 2017 Redistributable both X64, X86 and start the install again. But, I couldn’t uninstall from Add/Remove programs.

-> When I click on Microsoft Visual C++ 2015, 2017 Redistributable and clicked on Modify or Uninstall, nothing happened. Couldn’t see any uninstall/Modify dialog box coming up. I even tried that after restarting the server, but no luck.

-> Executed below from administrative command prompt.


"C:\ProgramData\Package Cache\{80586c77-db42-44bb-bfc8-7aebbb220c00}\VC_redist.x64.exe" /uninstall

"C:\ProgramData\Package Cache\{3ee5e5bb-b7cc-4556-8861-a00a82977d6c}\VC_redist.x64.exe" /uninstall

"C:\ProgramData\Package Cache\{206898cc-4b41-4d98-ac28-9f9ae57f91fe}\VC_redist.x86.exe" /uninstall

"C:\ProgramData\Package Cache\{6c6356fe-cbfa-4944-9bed-a9e99f45cb7a}\VC_redist.x64.exe" /uninstall

-> Please note that, I performed above action as this was a new database server and had no worries of any existing SQL Server instances.

-> Rebooted the server and performed the SQL Server Integration Services install again and this time it installed just fine.

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.

Error 1311.Source file not found: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache\KB4018073\ServicePack\redist\VisualStudioShell\VC10SP1\vc_red.msi. Verify that the file exists and that you can access it.

-> I was applying SQL Server 2012 Service Pack 4 on a database server. It failed with below error,

Instance MSSQLSERVER overall summary:
Final result: The patch installer has failed to update the shared features. To determine the reason for failure, review the log files.
Exit code (Decimal): -2068709375
Exit facility code: 1202
Exit error code: 1
Exit message: The required MSI package ‘C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache\KB4018073\ServicePack\redist\VisualStudioShell\VC10SP1\vc_red.msi’ doesn’t exist.
Start time: 2018-02-20 09:54:47
End time: 2018-02-20 09:57:19
Requested action: Patch
Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.7001.0&amp;
EvtType=0xB34122F7%400xF762992B%401202%401&EvtType=0xB34122F7%400xF762992B%401202%401
Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: Microsoft Visual Studio 2010 Redistributables
Component error code: 1311
Component log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20180220_103719\MSSQLSERVER\VC10Redist_Cpu64_1.log
Error description: Error 1311.Source file not found: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache\KB4018073\ServicePack\redist\VisualStudioShell\VC10SP1\vc_red.msi. Verify that the file exists and that you can access it.
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.7001.0&amp;
EvtType=vc_red.msi%40InstallFiles%401311

-> There were no missing MSI/MSP file. I extracted SQL Server 2014 Service Pack 4 KB4018073 to C:\temp\SP4 and searched for vc_red.msi file.

-> I placed the files vc_red.msi and vc_red.cab from C:\temp\SP4\redist\visualstudioshell\vc10sp1\x64 to C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache\KB4018073\ServicePack\redist\VisualStudioShell\VC10SP1\.

-> Started the patch and it failed with below error,

Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: Microsoft Visual Studio 2010 Redistributables
Component error code: 1642
Component log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20180220_104714\MSSQLSERVER\VC10Redist_Cpu32_1.log
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&amp;
ProdVer=11.0.7001.0&EvtType=vc_red.msi%400x162A16FE%400×1642

-> Replaced the files vc_red.msi and vc_red.cab from C:\temp\SP4\redist\visualstudioshell\vc10sp1\x86 to C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache\KB4018073\ServicePack\redist\VisualStudioShell\VC10SP1\.

-> Started the patching again and it completed fine without any issues.

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.