Switching to a drive- or share-based file store
By default, Internal Audit will store attachments inside its database. It is possible to change configuration so that files are stored directly on disk, either to a local or mapped drive, or on a network share.
NB: it is not possible to move existing files from inside the database to the disk-based file store, so this change should be made only at the commissioning of a system. If any attachments already exist (e.g. in libraries) then they must be removed and then re-added after the switch.
Implementation steps
- First, stop the Robot and the application pools for Pentana and the Web module (note that this will disconnect any connected users)
- Ensure that the Windows account used by the Pentana Service application pool has read/write permission to the storage location
- The configuration setting is held in the Web.config file for the main service. You will need to edit this file either by opening in Notepad, or in App Manager:
Under the section <Pentana.Tng.Service.FileService> add the following lines ([Path] is the location where the files are to be stored - note the trailing backslash):
<add key="FileStore" value="DiskFileStore"/>
<add key="PhysicalPath" value="[Path]\"/>
Example 1, files stored on a local or mapped drive (D:\data):
<Pentana.Tng.Service.FileService>
<add key="FileStore" value="DiskFileStore"/>
<add key="PhysicalPath" value="D:\data\"/>
<add key="ChunkSize" value="385920"/>
</Pentana.Tng.Service.FileService>
Example 2, files stored on a network share (\\servername\data):
<Pentana.Tng.Service.FileService>
<add key="FileStore" value="DiskFileStore"/>
<add key="PhysicalPath" value="\\servername\data\"/>
<add key="ChunkSize" value="385920"/>
</Pentana.Tng.Service.FileService> - Save the file
- Restart the application pools and Robot
Possible Errors
Having made this change, you may see the following errors:
"Document Is Unavailable"
"Document is unavailable" is displayed if you attempt to access a document which cannot be found - it may have been saved to the database file store before the configuration change was made, or have been removed from the disk file store.
"Document Info: File Uri requires a value to be entered"
This occurs if you attempt to open an audit after the change has been made and there were file attachments in the Steps Library. Internal Audit is unable to copy the source files as it can't find them.
"An error occurred during the Open File workflow"
This error occurs if the service does not have permission to access the storage location - check the NTFS and share permissions.
The full text of the error message is:
Universal Time: (2021-09-18 08:40:32) Local Time: (2021-09-18 09:40:32) TimeZone: (01:00:00 DST)
Version: 5.3.0.9
EXCEPTION: Exception
message: An error occurred during the Open File workflow
source: Pentana.Tng.UI.Smart.Common
target: Void Workflow_ProgressChanged(System.Object, Pentana.Tng.Core.WFProgressChangedEventArgs)
stack: at Pentana.Tng.UI.Smart.Common.DataGrid.WFCommandBase.Workflow_ProgressChanged(Object sender, WFProgressChangedEventArgs e)
at Pentana.Tng.Core.Workflow.OnProgressChanged(WFProgressChangedEventArgs e)
at Pentana.Tng.Core.Workflow.Step_ProgressChanged(Object sender, WFProgressChangedEventArgs e)
at Pentana.Tng.Agent.StepBase.OnProgressChanged(WFProgressChangedEventArgs e)
at Pentana.Tng.Agent.StepBase.FeedbackResult()
at Pentana.Tng.Agent.AsyncStepBase.Worker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
EXCEPTION: NullReferenceException
message: Object reference not set to an instance of an object.
source: Pentana.Tng.Workflows.UI
target: Boolean Download(System.String, System.String, Int32, System.String)
stack: at Pentana.Tng.Workflows.FileBrokerHelper.Download(String fileUri, String fileName, Int32 fileSize, String saveUri)
at Pentana.Tng.Workflows.OpenFileStep.LaunchReadOnly(String downloadFileUri, String fileName, Int32 fileSize, String savePathfileUri)
at Pentana.Tng.Workflows.OpenFileStep.LaunchFromUid(UniqueKey uid, Boolean readOnly, String downloadFileUri)
at Pentana.Tng.Workflows.OpenFileStep.CheckOutOrReadOnly(UniqueKey uid, String tempFileUri)
at Pentana.Tng.Workflows.OpenFileStep.Invoke()
at Pentana.Tng.Agent.AsyncStepBase.Worker_DoWork(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)