Try our conversational search powered by Generative AI!

Can't enter folder in file management

Vote:
 

We've got a problem with one of our folders. We get an error message as soon as we try to access it in the file manager. This specific folder contains videoclips.

We noticed that one of the video clips wasn't able to find its file so when I looked in the folder it said that it was checked out by one of our editors that must have done so by mistake. I right clicked it and choose to cancel checkout and after that we can't access the folder in the file manager but the files inside it is accessible on the site. We get the following error message:

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Web.Hosting.Versioning.VersioningFileSummary..ctor(FileItem file, FileOperations fileOp) +25
   EPiServer.Web.Hosting.Versioning.VersioningFileSystem.GetFileSummary(IFileHandler file) +96
   EPiServer.Web.Hosting.VersioningFile.get_Summary() +22
   EPiServer.UI.Hosting.DhtmlSupport.CanPersist(UnifiedDirectory dir) +38
   EPiServer.UI.Hosting.DhtmlSupport.SetUpHKA(UnifiedDirectory dir, AccessControlList acl) +661
   EPiServer.UI.Hosting.DhtmlSupport.OnPreRender(EventArgs e) +46
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
#45949
Nov 23, 2010 13:35
Vote:
 

Hmm I have seen this error before but never found any good solutions. What I did to fix it was delete all the files in the folder and upload them again (you need to delete them programmatically).

Hopefully someone has a better solution. I'm curious myself :).

Frederik

#45950
Nov 23, 2010 13:52
Vote:
 

Yeah, that's what I thought about doing. Would I really have to delete them programmatically? Won't it be enough to delete to folder? Or will that perhaps also cause an error?

#45956
Nov 23, 2010 15:13
Vote:
 

The problem is one of the files in the folder. So deleting the folder and uploading all the files again should also fix it.

#45966
Nov 23, 2010 20:58
Vote:
 

There is an error when you upload a file and it gets deleted in the database, but aint created.

Try to run this code

        protected void Button12_Click(object sender, EventArgs e)
        {
            StartIndexOnItemLit.Text = "";
             StringBuilder builder=new StringBuilder();
             VirtualPathHandler instance = VirtualPathHandler.Instance;
                
            foreach (var a in VirtualPathHandler.Instance.VirtualPathProviders.Keys)
            {
                if (a is VirtualPathUnifiedProvider)
                {

                    var dir = instance.GetDirectory((a as VirtualPathUnifiedProvider).VirtualPathRoot, true);

                    foreach (var element in dir.Children)
                    {
                        CheckItem(builder, element);
                    }
                }

            }
            StartIndexOnItemLit.Text="<ul>"+builder.ToString()+"</ul>";
            // Itera.Cms5Provider.AddToIndexer.Current.AddToIndex(StartIndexOnItem.Text, true, false);
        }

        private void CheckItem(StringBuilder builder, object element)
        {
            if (element is UnifiedDirectory)
            {
                CheckDir((element as UnifiedDirectory), builder);
            }
            if (element is UnifiedFile)
            {
                CheckFil((element as UnifiedFile), builder);
            }
        }
        void CheckDir(UnifiedDirectory dir, StringBuilder builder)
        {
            try
            {
                builder.AppendLine("<ul>");
                foreach (var a in dir.Children)
                {
                    CheckItem(builder, a);
                }
                builder.AppendLine("</ul>");
            }
            catch (System.Exception error)
            {
                builder.AppendLine(dir.Name+" "+dir.VirtualPath+" "+error.Message+" "+error.StackTrace);
            }
        }
        void CheckFil(UnifiedFile fil,StringBuilder builder)
        {
            try
            {
                var a = fil.Summary;
            }
            catch (Exception error)
            {
                
                builder.AppendLine("<li>deleting file since source don't exists " + fil.VirtualPath + "</li>");
                fil.Delete();
            }
        }

    

#45967
Nov 23, 2010 23:45
Vote:
 

Anders, that code worked like a charm! Thank you!!

#45985
Nov 24, 2010 10:08
Vote:
 

I got this error when I had made custom event handlings on fileCreate...So if it presists you need to debug some more :)

Good luck, and glad to be of help

#45987
Nov 24, 2010 10:10
Vote:
 

I don't really know why this happened to this site, it remains a mystery. I've added this piece of code to the action window just to be sure in the future. ;)

#45988
Nov 24, 2010 10:13
Vote:
 

Hi,

We have seen this problem before and also have a hotfix ready for it (bug#23743). But it only fixes the root cause (file version is 0), so you will have to delete the file yourself before you can access the folder again. 

#45998
Edited, Nov 24, 2010 11:52
Vote:
 

I have experienced exactly the same symptoms in CMS 7. Did you apply the hotfix yourself because it seems to still exists? ;)

#73498
Jul 24, 2013 22:34
Vote:
 

Sorry for the late reply. No other solution found so I've got the script saved in the Action Window for every time it occurs.

#73539
Jul 26, 2013 12:08
Vote:
 

My mistake, I intended the last comment for Episerver crew (Toni), but didn't indicate it at all :) This bug should be fixed in CMS 6 R2, but I have experienced it at least twice in CMS 7. 

#73540
Jul 26, 2013 12:45
Vote:
 

Jouni: It should actually have been fixed in CMS 6. If you can reproduce the problem in CMS 7 please contact support.

#73542
Jul 26, 2013 14:01
Vote:
 

We got this error in CMS 6 R2. I made a plugin from Anders code, and that fixed the problem. Reason was probably that the WebEditor had replaced a picture with a new one with the same name. (This of course works most of the time). 

#74365
Aug 26, 2013 12:42
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.