TERR library load error in TSSS 7.11.1: 'Error: restricted call to find.package for package data.table'

TERR library load error in TSSS 7.11.1: 'Error: restricted call to find.package for package data.table'

book

Article ID: KB0078717

calendar_today

Updated On:

Products Versions
Spotfire Statistics Services 7.11.1 and higher

Description

TERR library load error in TSSS 7.11.1:  'Error: restricted call to find.package for package data.table'

Getting this error when trying to load the user-contributed "data.table" package from the open-source R community's CRAN repository, after upgrading to TIBCO Spotfire Statistics Services 7.11.1:

Could not execute function call.
TIBCO Spotfire Statistics Services returned an error: 'Error: restricted call to find.package for package data.table
eval(expr, envir, enclos)
eval(expr, envir, enclos)
library(data.table)
find.package(package, lib.loc, verbose = verbose, quiet = TRUE)'.
at Spotfire.Dxp.Data.DataFunctions.Executors.RemoteFunctionClient.OnExecuting()
at Spotfire.Dxp.Data.DataFunctions.Executors.AbstractFunctionClient.<RunFunction>d__0.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.Executors.SPlusFunctionExecutor.<ExecuteFunction>d__0.MoveNext()
at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__6.MoveNext()

 

Issue/Introduction

TERR library load error in TSSS 7.11.1: 'Error: restricted call to find.package for package data.table'

Environment

All supported environments

Resolution

This is the expected result with the default setting for one of the important new features in TIBCO Spotfire Statistics Services (TSSS) 7.11.1, when running a TIBCO Enterprise Runtime for R (TERR) call to library(data.table). 

(This is also true for any other call to library() that tries to load one of the more than 12000 user-contributed R packages that are available for download from the open-source R community's CRAN repository).

From page 8 in the Release Notes for TSSS 7.11.1 (file "TIB_sf_statsvcs_7.11.1_relnotes.pdf" in the downloaded installation media):

-----
New Features

This release introduces the following new features.

- This release of Spotfire Statistics Services sets default properties that restrict running arbitrary scripts that could cause harm by accessing the file system or the internet. It also sets a default property that allows only data function calls sent from TIBCO Spotfire. See 'Changes in Functionality' and 'TIBCO Spotfire® Statistics Services Installation and Administration' for more information.

...

For more information about these properties, see the 'spserver.properties' reference ("Server properties") in the TIBCO Spotfire Statistics Services Installation and Administration Guide.
-----

The values for each of those new settings can be changed by editing and saving the TSSS instance's "spserver.properties" configuration file, then restarting the Statistics Services service (as a Windows or Linux service) to make it read the modified file.
 

The following is one of those new properties:

terr.restricted.execution.mode=true

When this property is set to "true" (which is the default), TSSS 7.11.1 runs its TERR engines using the new restricted execution mode (REX), which is described on page 7 in the Release Notes for TERR 4.5.0 (file "TIB_terr_4.5.0_relnotes.pdf" in the downloaded installation media):

-----
Controlling script execution

This release of TERR focuses on providing a means for safely evaluating and executing arbitrary scripts without worrying that a script could cause harm, such as deleting files or uploading confidential information to the internet.

See terrUtils::evalREX for more information.
-----

In a TERR 4.5.0 Console session, the following command will open the help file that provides additional details about TERR's restricted execution mode:

?terrUtils::evalREX

The following command (adapted from an example in the help file) tests a call to library(data.table) in restricted execution mode, and shows that the command is restricted:

>
>
> terrUtils::evalREX( quote( library(data.table) ) )
Error: restricted call to find.package for package data.table
>
>
> traceback()
4: find.package(package, lib.loc, verbose = verbose, quiet = TRUE)
3: library(data.table)
2: eval(expr, envir, enclos)
1: eval(expr, envir, enclos)
>
>

Note:  a call to library() without any arguments (with empty parentheses) is also restricted.

Use of CRAN packages:

User-contributed R packages from the open-source R community's CRAN repository (https://cran.r-project.org/) are available under separate open source software license terms and are not part of the TIBCO Spotfire product line. As such, user-contributed CRAN packages are not within the scope of your license for any TIBCO Spotfire product. User-contributed CRAN packages are not supported, maintained, or warranted in any way by TIBCO Software Inc. Download and use of CRAN packages is solely at your own discretion and subject to the free open source license terms applicable to each individual package.