Question

I have a site that was backed up and restored from one content database to a new content database using the below command.

Backup-SPSite -Identity https://sp.domain.org/sites/thesite -Path D:\backups\site1.bak -UseSqlSnapshot
Restore-SPSite -Identity https://sp.domain.org/sites/thesite -Path D:\backups\site1.bak -HostHeaderWebApplication https://sphnsc01.domain.org -ContentDatabase SP_Content_Collab_005 -Force

Within this site collection, there were several Excel Web Access web parts pulling in an Excel file and various named ranges within it. They all now display the "The workbook cannot be opened" error.

Typically this is because the account running Excel Services doesn't have the proper access to the content database. I've double checked, and it does have the proper access. I've tested Excel Access webparts successfully with different site collections in the same content database, so I know it is working.

Looking at the verbose ULS logs, I see something along these lines:

    ExceptionHelper.IsUnrecoverable: Encountered a NullReferenceException, this isn't expected. Exception=System.NullReferenceException: Object reference not set to an instance of an object.    
     at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)    
     at Microsoft.SharePoint.SPSite.GetSPRequest()    
     at Microsoft.SharePoint.SPSite.get_Request()    
     at Microsoft.SharePoint.SPSite.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates)    
     at Microsoft.Office.Excel.Server.MossHost.SharePointHelperMethods.GetSite(String fileLocation, IClaimsIdentity claimsIdentity)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)

    SharePointFileLoader.GetSPFile: Sharepoint threw a handled exception - turning it into a FileOpen exception. Exception is: System.NullReferenceException: Object reference not set to an instance of an object.    
     at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)    
     at Microsoft.SharePoint.SPSite.GetSPRequest()    
     at Microsoft.SharePoint.SPSite.get_Request()    
     at Microsoft.SharePoint.SPSite.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates)    
     at Microsoft.Office.Excel.Server.MossHost.SharePointHelperMethods.GetSite(String fileLocation, IClaimsIdentity claimsIdentity)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)

    HostHelperMethods.TranslateOpenException: Original exception is Microsoft.Office.Excel.Server.Host.HostFileException ---> System.NullReferenceException: Object reference not set to an instance of an object.    
     at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)    
     at Microsoft.SharePoint.SPSite.GetSPRequest()    
     at Microsoft.SharePoint.SPSite.get_Request()    
     at Microsoft.SharePoint.SPSite.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates)    
     at Microsoft.Office.Excel.Server.MossHost.SharePointHelperMethods.GetSite(String fileLocation, IClaimsIdentity claimsIdentity)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)     -
     -- End of inner exception stack trace ---    
     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.CheckForPermissions(IClaimsIdentity claimsIdentity)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostHelperMethods.WithEnsureClaimsIdentitySetOnThread(IClaimsIdentity claimsIdentity, MethodToRun action)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostHelperMethods.TryExecuteWithUserContext(IIdentity userIdentity, Action`1 method)    
     at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.Init(Uri uri, Guid requestSiteId, IIdentity currentIdentity, ScenarioRestrictions restrictions, IExcelServerDocumentContext documentContext, FileLoaderHostInfo& outFileLoaderHostInfo)    
     at Microsoft.Office.Excel.Server.CalculationServer.SharePointFileLoader.Init(Uri uri, Guid requestSiteId, ScenarioRestrictions restrictions, IExcelServerDocumentContext documentContext)

    HostHelperMethods.TranslateOpenException: unknown error accessing file: https://sp.domain.org/sites/thesite/SharePoint%2020/file%20in%20question(Autosaved).xlsx 

Failed to load 'https://sp.domain.org/sites/thesite/SharePoint%2020/file%20in%20question(Autosaved).xlsx ' with error: 'Unable to open workbook due to unexpected exception: Microsoft.Office.Excel.Server.Host.HostFileException ---> System.NullReferenceException: Object reference not set to an instance of an object.    
 at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)    
 at Microsoft.SharePoint.SPSite.GetSPRequest()    
 at Microsoft.SharePoint.SPSite.get_Request()    
 at Microsoft.SharePoint.SPSite.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates)    
 at Microsoft.Office.Excel.Server.MossHost.SharePointHelperMethods.GetSite(String fileLocation, IClaimsIdentity claimsIdentity)    
 at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)     -
 -- End of inner exception stack trace ---    
 at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.GetSPFile(IClaimsIdentity claimsIdentity)    
 at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.CheckForPermissions(IClaimsIdentity claimsIdentity)    
 at Microsoft.Office.Excel.Server.MossHost.MossHostHelperMethods.WithEnsureClaimsIdentitySetOnThread(IClaimsIdentity claimsIdentity, MethodToRun action)    
 at Microsoft.Office.Excel.Server.MossHost.MossHostHelperMethods.TryExecuteWithUserContext(IIdentity userIdentity, Action`1 method)    
 at Microsoft.Office.Excel.Server.MossHost.MossHostFileLoader.Init(Uri uri, Guid requestSiteId, IIdentity currentIdentity, ScenarioRestrictions restrictions, IExcelServerDocumentContext documentContext, FileLoaderHostInfo& outFileLoaderHostInfo)    
 at Microsoft.Office.Excel.Server.CalculationServer.SharePointFileLoader.Init(Uri uri, Guid requestSiteId, ScenarioRestrictions restrictions, IExcelServerDocumentContext documentContext).'. [Session: 1.V24.8913T0W7/nQNr8dlVNPqdUyZ14.5.en-US5.en-US36.0e945cb1-c4b8-46bb-ac0a-de142051bdf01.A1.N User: 0e.t|pingfederate|me@domain.com]

I've tested this with several different XLSX files in the site collection and they all do this, so it is definitely an issue with the site collection and not the service, but I'm not sure where to go.

I've also tried disabling the enterprise features site collection feature and enabling it to no effect. Is this a cache problem perhaps? Or something internal with the restore as the site collection has a new site id?

Not sure where else to go with this.

Was it helpful?

Solution 2

Turns out that an IIS reset on the server running Excel Services fixed the problem. Must have been something hung up in memory.

OTHER TIPS

I haven't seen the issue before but have a couple of suggestions. If it is a caching issue as you say, then try an IISRESET on your web front end

Otherwise it may be a web part restore issue, maybe a hard coded site ID in the settings, create a new excel web access web part on the site and see if it works. If so, delete the web parts and re-create them.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top