Cannot delete big media files

Mahmoud Ibrahim asked on March 24, 2022 01:44

I have Kentico 12 MVC Application, I'm trying delete media file from media library, The file size is 400MB, clicking delete button beside the file freezes the site for about 2 or 3 minutes then nothing happens, the file still exists and I can download it. in event lg there is a new log in event logs with Event code = "DELETEOBJ" and description = "Delete Media file 'test_big_file'", and after a while an error appear

Message: Thread was being aborted.

Exception type: System.Threading.ThreadAbortException Stack trace: at SNIReadSyncOverAsync(SNI_ConnWrapper* , SNI_Packet** , Int32 ) at SNINativeMethodWrapper.SNIReadSyncOverAsync(SafeHandle pConn, IntPtr& packet, Int32 timeout) at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync() at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket() at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer() at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at CMS.DataEngine.AbstractDataConnection.ExecuteQuery(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction) at CMS.DataEngine.GeneralConnection.RunQuery(QueryParameters query) at CMS.DataEngine.GeneralConnection.RunQueryWithRetry(QueryParameters query, Int32 retryCount) at CMS.DataEngine.GeneralConnection.ExecuteQuery(QueryParameters query, Int32& totalRecords) at CMS.DataEngine.DataQueryBase1.GetDataFromDBInternal() at CMS.DataEngine.DataQueryBase1.GetDataFromDB() at CMS.DataEngine.DataQueryBase1.GetData() at CMS.DataEngine.SimpleDataClass.Insert(Boolean initId) at CMS.DataEngine.AbstractInfoBase1.InsertData() at CMS.DataEngine.AbstractInfoProvider3.SetInfo(TInfo info) at CMS.Synchronization.ObjectVersionManager.CreateVersion(GeneralizedInfo infoObj, Int32 userId, Boolean forceVersion) at CMS.Synchronization.ObjectVersionManager.EnsureDeletedVersion(GeneralizedInfo infoObj) at CMS.Synchronization.Synchronization.CreateVersion(LogObjectChangeSettings settings) at CMS.Synchronization.SynchronizationActionManager.ExecuteActions(LogObjectChangeSettings settings) at CMS.Synchronization.SynchronizationHelper.<>c__DisplayClass16_0.b__0() at CMS.Helpers.AbstractStockHelper1.ExecuteWithEmptyStorage(Action action, String key, Boolean caseSensitive) at CMS.Synchronization.SynchronizationHelper.LogObjectChange(LogObjectChangeSettings settings) at CMS.Synchronization.SynchronizationHandlers.Delete_Before(Object sender, ObjectEventArgs e) at CMS.Base.AbstractHandler.CallEventHandler[TArgs](EventHandler1 h, TArgs e) at CMS.Base.AbstractHandler.Raise[TArgs](String partName, List1 list, TArgs e, Boolean important) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler2.RaiseBefore(TArgs e) at CMS.Base.AdvancedHandler2.StartEvent(TArgs e, Boolean allowEvent) at CMS.DataEngine.ObjectHandler.StartEvent(BaseInfo obj) at CMS.DataEngine.AbstractInfoBase1.DeleteData() at CMS.DataEngine.AbstractInfoProvider`3.DeleteInfo(TInfo info) at CMS.MediaLibrary.MediaFileInfoProvider.DeleteMediaFileInfoInternal(MediaFileInfo infoObj) at CMSModules_MediaLibrary_Controls_MediaLibrary_MediaLibrary.PerformDeleteMediaFile(String filePath) in D:\Agents\KENTICO-01_work\630\s\src\backend\Presentation\CMS\CMSModules\MediaLibrary\Controls\MediaLibrary\MediaLibrary.ascx.cs:line 1912

This does not happen with small files.

Correct Answer

Brenden Kehren answered on March 24, 2022 02:13

This could be a couple of things:

  • Is it safe to assume you're storing the files in the file system and not the database?
  • Do you have "waiting" web farm tasks to sync between the MVC and the CMS site? Check out the Web Farm app to see if your web farms are working properly in the CMS.
  • What are the specs of the server the site and database are on? Is it possible the server is running out of resources trying to perform those actions? Could try to increase the resources temporarily and perform your delete.
1 votesVote for this answer Unmark Correct answer

Recent Answers


Mahmoud Ibrahim answered on March 24, 2022 05:27

Thanks Brenden Kehren for your answer and yes, I save the files in file system not the database. about the web farms, actually this is the main issue as the synchronization between admin and web application is not working with big files however both web farms are healthy and I cannot see any waiting tasks.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.