Errors when trying to save TIBCO Spotfire analysis: "Unable to save the file" "DirectoryNotFoundException at mscorlib" "Could not find a part of the path".

Errors when trying to save TIBCO Spotfire analysis: "Unable to save the file" "DirectoryNotFoundException at mscorlib" "Could not find a part of the path".

book

Article ID: KB0072330

calendar_today

Updated On:

Products Versions
Spotfire Analyst 11.2 and lower
TIBCO Cloud Spotfire 11.2 and lower

Description

If the TIBCO Spotfire Analyst client has been open for a long time, the following error may be seen while saving the analysis file:
 
Error message: Unable to save the file test_analysys_file.dxp.FileNotFoundException at mscorlib:Could not find file 'C:\Users\test_user\AppData\Local\Temp\TIBCO\Spotfire\<version>\xxxx-xxxx\xxxxxxx.xxx.tmp'.Stack Trace:   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,   FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)   at Spotfire.Dxp.Framework.Persistence.EmbeddedResource.OpenRead()   at Spotfire.Dxp.Framework.Persistence.ImmutableEmbeddedResource.Save(Stream stream)   at Spotfire.Dxp.Application.AnalyticItems.PersistedBookmarks.WriteToZip(ZipWriter zipWriter, CxxSession session)   at Spotfire.Dxp.Application.AnalyticItems.BookmarkManager.Spotfire.Dxp.Framework.Persistence.IDxpFileContributor.OnWriteToDxp(DocumentLocationType documentLocationType, ZipWriter zipWriter)   at Spotfire.Dxp.Framework.Persistence.DxpFileContributorRegistry.OnWriteToDxp(DocumentLocationType documentLocationType, ZipWriter zipWriter)   at Spotfire.Dxp.Framework.Persistence.PersistenceManager.Save(DocumentTypes documentType, DocumentNode doc, IDocumentSaveSettings settings, Stream targetStream)   at Spotfire.Dxp.Framework.Persistence.PersistenceManager.Save(DocumentTypes documentType, DocumentNode doc, IDocumentSaveSettings settings, String fileName)   at Spotfire.Dxp.Framework.DocumentModel.DocumentManager`1.<>c__DisplayClass63_0.<Save>b__0()   at Spotfire.Dxp.Forms.Application.FormsProgressService.ProgressThread.DoOperationLoop()

This error is complaining about a missing ".tmp" file under the path mentioned in the above error message.  Spotfire creates temporary files while analysis files are being built. When saving the analysis file, Spotfire uses those temporary files.  If there is an anti-virus or garbage collection program running on the machine, it might end up deleting these temporary files on regular basis. As a result, Spotfire will not be able to find these temporary files while saving the analysis file and will throw this error.
 

Issue/Introduction

This article describes errors that may occur when attempting to save a Spotfire analysis: "Unable to save the file" "DirectoryNotFoundException at mscorlib" "Could not find a part of the path".

Resolution

The issue has been addressed in TIBCO Spotfire version 11.3, so the recommended solution is to upgrade to that version or higher. 

For TIBCO Spotfire version 11.2 or lower: 
This may happen if antivirus or garbage collection software applications delete the temp folder and/or the *.tmp file whose contents are necessary for saving the DXP file. If antivirus software is installed, ask the IT/Security team to exclude the TIBCO Spotfire installed client folders from the virus scan, i.e., exclude the "C:\Users\<username>\AppData\Local\Temp\TIBCO\Spotfire\<Version>\" folder from the scan.

Once this occurs, there is no way to recover from this error (unless IT can recover the deleted .tmp files that Spotfire needs to continue with the save process).

One way to avoid the issue is to save the analysis frequently. Alternatively, if the changes you have made are in pages or visualizations then these can be copied to another instance of Spotfire:
  1. Launch another instance of the TIBCO Spotfire installed client (keeping open the report which cannot be saved)
  2. Open the last saved version of report again
  3. Copy those new/modified pages or visualizations from the report which cannot be saved (see Copying Data, Pages or Visualizations for details)
  4. Paste those pages or visualizations into the newly opened instance of the TIBCO Spotfire installed client
  5. Save the newly opened report where you pasted the new/modified content

Additional Information

Doc: Copying Data, Pages or Visualizations