SharePoint MOSS 2007 - Style Library - File Not Found

A client called up - after they performed a site collection export and import (in order to duplicate a site), the Publishing features we developed for them stopped working.  The site looks wrong.

So I pull out my detective hat and get to work.

  1. IE Developer Tools quickly showed that there's a problem getting the CSS files from Style Library, where our feature deploys the CSS files
  2. Jumping into the Style Library - things look in place.  Click on the CSS file itself -> File Not Found
  3. Times like this one just LOVES SharePoint.  The main trap here really is that a whole number of files could be "not found".  And that error doesn't actually mean an awful lot.
  4. Tried the simplest: knowing this file is part of the site definition, I deleted the file and re-activated our package.  SharePoint says file is back.  But again, clicking on it leads to the File Not Found error, again
  5. Quick check of the 12 Hive on the Web Front Ends (WFE) quickly determined that the file does exist in \FEATURES\
  6. Imagining that it may be customized somehow, I tried Reset to Site Definition.  Still no good.
  7. On the edge of going to the log files… 
  8. When I remembered that we can try to see what the real error is.  So take a detour to the web.config
    1. CustomError="Off"
    2. CallStack="True"
  9. Ah ha.  Site <guid> not found.  Stacktrace says Blobcache is involved.
  10. This actually makes a lot of sense and confirms we weren't just mad.  Yes there is a file missing - the cache file!  Our file is actually fine sleeping in the content database.
  11. Confirmed with customer they did switch on Blobcache a few month ago.  But obviously it's now interfering with the export/import routine. 
  12. Switched BlobCache off via web.config
  13. Refresh (F5) the site - everything's running just fine again :-)

All in about 50mins work.  In hindsight…  jump to the Stack Trace right away to save guess work.

In SharePoint 2010 - errors will be displayed with a Correlation ID, allowing admins to quickly jump to the error stack trace in the log files.