BetterCMS icon indicating copy to clipboard operation
BetterCMS copied to clipboard

Image upload sometimes fails (IE10).

Open ghost opened this issue 13 years ago • 3 comments

Sometimes it is reproducible when bigger files (>1MB) is uploaded and during upload process hit "Save" button - file is processing message will never disappear.

Additionally, sometimes error message is shown, while upload is successful: upload image

ghost avatar Aug 01 '13 14:08 ghost

Issue related LOG from staging.

2013-08-01 14:11:43.9376 Failed to execute command UndoUploadCommand. Request data: BetterCms.Module.MediaManager.Command.Upload.UndoUpload.UndoUploadRequest. 
MediaImage with id b5b76708-65ef-4028-8f25-a20d00e9d74d Entity was updated by another transaction. BetterCms.Core.Exceptions.DataTier.ConcurrentDataException: MediaImage with id b5b76708-65ef-4028-8f25-a20d00e9d74d Entity was updated by another transaction.
   at BetterCms.Core.DataAccess.DataContext.Interceptors.StaleInterceptor.OnFlushDirty(Object entity, Object id, Object[] currentState, Object[] previousState, String[] propertyNames, IType[] types)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.InvokeInterceptor(ISessionImplementor session, Object entity, EntityEntry entry, Object[] values, IEntityPersister persister)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.HandleInterception(FlushEntityEvent event)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.ScheduleUpdate(FlushEntityEvent event)
   at NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
   at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at BetterCms.Core.DataAccess.DataContext.DefaultUnitOfWork.Commit()
   at BetterCms.Module.MediaManager.Services.DefaultMediaImageService.RemoveImageWithFiles(Guid mediaImageId, Int32 version)
   at BetterCms.Module.MediaManager.Command.Upload.UndoUpload.UndoUploadCommand.Execute(UndoUploadRequest request)
   at BetterCms.Module.Root.Mvc.CommandHandler.ExecuteCommand[TRequest,TResponse](ICommand`2 command, TRequest request)
2013-08-01 14:18:31.1963 Failed to execute command ConfirmUploadCommand. Request data: RootFolderId: a9d3852a-e902-4a9c-b805-a20d00eb4d05, RootFolderType: 0, SelectedFolderId: a9d3852a-e902-4a9c-b805-a20d00eb4d05, ReuploadMediaId: 00000000-0000-0000-0000-000000000000. 
Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [BetterCms.Module.MediaManager.Models.MediaImage#bb740b80-827f-41bf-8408-a20d00ebcbff] NHibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [BetterCms.Module.MediaManager.Models.MediaImage#bb740b80-827f-41bf-8408-a20d00ebcbff]
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at NHibernate.Transaction.AdoTransaction.Commit()
   at BetterCms.Core.DataAccess.DataContext.DefaultUnitOfWork.Commit()
   at BetterCms.Module.MediaManager.Command.Upload.ConfirmUpload.ConfirmUploadCommand.Execute(MultiFileUploadViewModel request)
   at BetterCms.Module.Root.Mvc.CommandHandler.ExecuteCommand[TRequest,TResponse](ICommand`2 command, TRequest request)

ghost avatar Aug 01 '13 14:08 ghost

Both issues were reproduced in Chrome also. P.s.: on FF everything went ok, but it could be that i've just missed "right" moment for clicking "Save".

daivabrazukaite avatar Aug 01 '13 14:08 daivabrazukaite

Issue (when file is in processing state forever) is some how concurrency related - deeper investigation is needed.

Scope:

  • ConfirmUploadCommand.cs
  • DefaultMediaFileService.cs

Easiest way to reproduce (locally on DEV env with remote cloud storage):

  • Select image to re-upload
  • After file is uploaded but still processing in the server (is being sent to the cloud storage) - hit Save button in the upload dialog.

ghost avatar Aug 02 '13 13:08 ghost