Hello,
On our new SQLServer 2016, the "Maintenance Cleanup Task" do not delete backup file.
I never had the problem with on older installation (2008R2 to 2014)
In the activity monitor, the session running this command is waiting on "MSQL_XP" .
"EXECUTE master.dbo.xp_delete_file 0,N'U:\Backup\MSSQL13.SSDE\MSSQL\Backup\model\model_backup_2016_09_16_155708_9880904.bak'"
Then after 60 seconds, the task go in error :
Executed as user: xxxx\yyyyy . Microsoft (R) SQL Server Execute Package Utility Version 13.0.1601.5 for 64-bit Copyright (C) 2016 Microsoft. All rights reserved. Started: 16:08:16 Progress: 2016-09-16 16:08:16.77 Source: {F609BD64-CBC9-42CF-85EE-3537D0A1DF7A} Executing query "DECLARE @Guid UNIQUEIDENTIFIER EXECUTE msdb..sp...".: 100% complete End Progress Error: 2016-09-16 16:09:16.89 Code: 0xC002F210 Source: Maintenance Cleanup Task Execute SQL Task Description: Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'U:\Backup\MS..." failed with the following error: "Error executing xp_delete_file extended stored procedure: Specified file is not a SQL Server backup file.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 16:08:16 Finished: 16:09:17 Elapsed: 60.938 seconds. The package execution failed. The step failed.
I tried reading the header of this file, no problem found :
RESTORE HEADERONLY
FROM DISK = N'U:\Backup\MSSQL13.SSDE\MSSQL\Backup\model\model_backup_2016_09_16_155708_9880904.bak'
WITH NOUNLOAD;
GO
model_backup_2016_09_16_155708_9880904NULL1NULL012saSERVER\SSDEmodel8522003-04-08 09:13:36.0002833408340000001727000373400000017440000134000000172700037340000001665000372016-09-16 15:57:09.0002016-09-16 15:57:09.00000103319660913046081301708SERVER 512EBD0FE66-F91F-43F1-99C3-B52D803BB13690D16058-F1D1-4E96-8EC6-8D7BFDA42F15Latin1_General_CI_ASEBD0FE66-F91F-43F1-99C3-B52D803BB136000000000090D16058-F1D1-4E96-8EC6-8D7BFDA42F15NULLSIMPLENULLNULLDatabaseBC2B2591-4ECC-4760-8811-5E5D3EECCABD28334080NULLNULLNULL
I tried to delete a specific Maintenance plan text report, it worked fine. This problem seems to be specific for backup file, compressed or not.
I have the same problem on every other server with SQLServer 2016.