Automation task "Open Analysis from Library" fails with error "Failed to open data source. ---> System.UnauthorizedAccessException: Cannot access file"

Automation task "Open Analysis from Library" fails with error "Failed to open data source. ---> System.UnauthorizedAccessException: Cannot access file"

book

Article ID: KB0074852

calendar_today

Updated On:

Products Versions
Spotfire Automation Services 7.5 and later

Description

This article will help you resolve the error, "Open Analysis from Library" fails with error "Failed to open data source. ---> System.UnauthorizedAccessException: Cannot access file" when running an automation task.

Environment

All supported Windows Operating systems

Resolution

1. Create a shared folder within your network. This can be on a file server as well.
2. Confirm that the Node Manager service and Spotfire Server services are running using the same custom Windows account.
User-added image
3. Provide read/write access to this Windows user on the shared folder.
User-added image
4. Place Excel, txt files, etc. with which you plan to create reports in this network shared folder.
5. Created a report keeping the above files as a data source and publish them to the library.
6. Login to the Spotfire Server and export the Automation server configuration. Follow the steps below.
 -------------------------------------------------------------------------------
- run the export config command at command prompt.
  <installation folder>\7.5.0\tomcat\bin>config export-service-config  --deployment-area="Production" --force --capability=AUTOMATION_SERVICES
- Provide the config Tool Password when prompted.
User-added image

- Browse to the location "<installation folder>\7.5.0\tomcat\bin\config\root\" and edit "Spotfire.Dxp.Worker.Host.exe.config"
User-added image

-Add the file share to the "AllowedFilePaths"
  Sample: <string>\\fileshare01\spotfire</string>   (Here "fileshare01" is my file server and "spotfire" is a folder that I created to place the source files)
User-added image

- Save the config file and import it as follows.
   <installation folder>\7.5.0\tomcat\bin>config import-service-config  --config-name="AllowLinked01"
- Provide the config Tool Password when prompted.
User-added image

- Login to the Spotfire Admin console > Open "Nodes and Services".
- Click on Automation Service > Click "Edit"on the right hand top corner.
- Select the new configuration and update.
User-added image

-----------------------------------------------------------------

NOTE: In Spotfire Versions 10.3 and higher the service config commands need to be executed from "<installation folder>\tss\10.3.0\tomcat\spotfire-bin"

Issue/Introduction

Automation task "Open Analysis from Library" fails with the error "Failed to open data source. ---> System.UnauthorizedAccessException: Cannot access file".