Getting errors when trying to backup SQL server with veeam
In Job.backup.logs getting
<01> Error Failed to create snapshot: Backup job failed.
[01.12.2021 08:50:06] <01> Error Cannot create a shadow copy of the volumes containing writer's data.
[01.12.2021 08:50:06] <01> Error A VSS critical writer has failed. Writer name: [SqlServerWriter]. Class ID: [{a65faa63-5ea8-4ebc-9dbd-a0c4db26912a}]. Instance ID: [{0984f742-a29b-4d5c-ac1e-b18489e72da3}]. Writer's state: [VSS_WS_FAILED_AT_PREPARE_SNAPSHOT]. Error code: [0x800423f4]. (System.Exception)
[01.12.2021 08:50:06] <01> Error at Veeam.EndPoint.SysUtils.CEpSnapshotHolder.WaitForSnapshotCreation()
[01.12.2021 08:50:06] <01> Error at Veeam.EndPoint.CEndPointAutoSnapshot.CreatePreparedFreezedSnapshot(CVolumeToSnapshot[] volumesToSnapshot, String[] excludedFolders, EVssBackupType vssBackupType, Boolean disableBcdUpdate)
[01.12.2021 08:50:06] <01> Error at Veeam.EndPoint.CEndPointAutoSnapshot.CreateFreezedSnapshot(CVolumeToSnapshot[] volumesToSnapshot, String[] excludedFolders, Boolean disableBcdUpdate, IEpAutoSnapshotCreationLogger logger)
[01.12.2021 08:50:06] <01> Error at Veeam.EndPoint.Sources.CVssSnapshotCreator.CreateSnapshot(CShadowVolumesLayout disksLayout, CLiveVolumeInfo[] volumes, CVolumesList nonShadowVolumes, CPartitionInfo[] partitionsToBackup, IDbExcludesProvider dbExcludesProvider, CBackupCreationUsnProvider backupCreationUsnProvider, Boolean dummySnapshot, CShadowVolumesLayout& shadowVolumesLayout)
Applications events in Event Viewer:
Sqllib error: OLEDB Error encountered calling ICommandText::Execute. hr = 0x80040e14. SQLSTATE: 42000, Native Error: 3013
Error state: 1, Severity: 16
Source: Microsoft SQL Server Native Client 11.0
Error message: BACKUP DATABASE is terminating abnormally.
SQLSTATE: 42000, Native Error: 3201
Error state: 7, Severity: 16
Source: Microsoft SQL Server Native Client 11.0
Error message: Cannot open backup device '{44972488-CB50-4FC6-A564-F4960056B1FA}1172'. Operating system error 0x80070002(The system cannot find the file specified.).
vssadmin list writers shows SQL VSS writers as “Retriable error
In SQL Server management studio, after executing
SELECT COUNT(*) FROM sys.databases where database_id not in ( 1,2,3,4 )
Got output of over 1000 databases.
Google search revealed that changing max worker threads Option in SQL server can fix the issue.

My machine has 4 CPUs so tried changing value from 0 to 512 didn’t help
So i changed Maximum worker threads to 3000 and backup was successful

The reason is that there are not enough free threads while creating the volume shadow copy with large number of databases.