Product: TIBCO Spotfire®
Data function fails to execute with the error: "Could not execute function call. TIBCO Spotfire Statistics Services did not return a response. See the debug log for further information.
Product: TIBCO Spotfire Statistics Services
Version: All Supported Versions
OS: All Supported Operating Systems
--------------------
Product: TIBCO Spotfire (desktop client / Analyst / Professional)
Version: All Supported Version
OS: All Supported Operating Systems
--------------------
When attempting to execute a data function in the installed Analyst/Professional/Desktop client which is executed on an external TIBCO Spotfire Statistics Services server, the data function fails and the following error is reported in the status bar:
• "Could not execute function call. TIBCO Spotfire Statistics Services did not return a response. See the debug log for further information."
In the status bar Notifications in the installed Analyst/Professional/Desktop client, the following error is seen:
===========================
"Could not execute function call. TIBCO Spotfire Statistics Services did not return a response. See the debug log for further information."
===========================
On the TIBCO Spotfire Statistics Services server in the "SplusServer.log" file, the following error is seen:
===========================
2016-05-03 13:28:27,267 | ERROR | | JobExecutionPoolThread | JobExecutionThreadPool-1: Error while executing the Runnable:
java.lang.IllegalStateException: execution failed jobId:316
at com.insightful.splusserver.threadpool.ScheduledJobExecutor.execute(ScheduledJobExecutor.java:89)
at com.insightful.splusserver.threadpool.JobExecutionPoolThread.run(JobExecutionPoolThread.java:132)
....
Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column "WARNINGS VARCHAR(65535)": "'{""warnings"":[""`[<-.data.frame`(`*tmp*`, , indexed, value = list(2.1, 2.1, 2.1, : provided 104 variables to replace 1 variables... (67207)"; SQL statement:
update SPLUS_JOBS set VERSION = ?,STATUS = ?,JOB_TYPE = ?,SERVER_INSTANCE = ?,NOTIFICATION_REQUEST = ?,PACKAGE = ?,CODE = ?,USER = ?,CREDENTIAL = ?,TIME_CREATED = ?,TIME_SCHEDULED = ?,TIME_QUEUED = ?,TIME_DEQUEUED = ?,TIME_SPLUS_START = ?,TIME_SPLUS_END = ?,TIME_SERVER_END = ?,TIME_PREPARED = ?,SERVER_ID = ?,RUNNING_EXEC_CMD = ?,RESULTS_DIR = ?,OUTPUT = ?,ERROR = ?,MESSAGE = ?,INIT_OUTPUT = ?,INIT_ERROR = ?,FULL_LOG = ?,JAVA_STDOUT_TEXT = ?,JAVA_STDERR_TEXT = ?,READ_JUNK = ?,WARNINGS = ?,PERCENT = ?,QUEUE_COUNT = ?,SESSION_TOKEN = ?,USER_DOMAIN = ? where ID=? and VERSION=?-1 [90005-129]
===========================
This will be seen when a data function execution results in more than 65535 characters of warning messages. This is beyond the maximum character count allowed for the WARNINGS column in the TIBCO Spotfire Statistics Services server application database which stores the job execution history. The job execution fails since the TIBCO Spotfire Statistics Services server does not currently truncate warnings as needed.
You can workaround this issue by reducing or suppressing the number of warnings returned by the data function script.
Option 1:
Wrap the entire problematic script in a call to the function provided below, suppressTrailingWarnings(), which will suppress all but the first 'nWarningsToSignal' warnings.
===========================
suppressTrailingWarnings <- function(expr, nWarningsToSignal = 5)
{
nWarnings <- 0
on.exit(
if (nWarnings >= nWarningsToSignal) {
warning("Only the first ", nWarningsToSignal - 1, " of ", nWarnings, " warnings were reported")
}
)
withCallingHandlers(
expr,
warning=function(w){
nWarnings <<- nWarnings + 1
if (nWarnings < nWarningsToSignal) {
warning(w)
}
invokeRestart("muffleWarning")
}
)
}
===========================
Since this function is not defined in a package, you need to define it in the data function script. For example, assume your failing script is:
===========================
fit <- lm(Y ~ X1 + X2, data = DATA)
RESIDUALS <- residuals(fit)
FITTEDVALUES <- fitted(fit)
===========================
Define the suppressTrailingWarnings() function and then wrap the problematic function in it, like this:
===========================
suppressTrailingWarnings <- function(expr, nWarningsToSignal = 5)
{
nWarnings <- 0
on.exit(
if (nWarnings >= nWarningsToSignal) {
warning("Only the first ", nWarningsToSignal - 1, " of ", nWarnings, " warnings were reported")
}
)
withCallingHandlers(
expr,
warning=function(w){
nWarnings <<- nWarnings + 1
if (nWarnings < nWarningsToSignal) {
warning(w)
}
invokeRestart("muffleWarning")
}
)
}
suppressTrailingWarnings({
fit <- lm(Y ~ X1 + X2, data = DATA)
RESIDUALS <- residuals(fit)
FITTEDVALUES <- fitted(fit)
}, nWarningsToSignal = 3) # default is 5
===========================
That function should emit at most 'nWarningsToSignal' warnings (including a possible trailing warning that says how many were not reported). For example:
===========================
> funkyFunction <- function(i) if (i<0) warning(i, " is negative")
>
> suppressTrailingWarnings(for(i in 5:-3) funkyFunction(i))
Warning messages:
1: In funkyFunction(i) : -1 is negative
2: In funkyFunction(i) : -2 is negative
3: In funkyFunction(i) : -3 is negative
>
> suppressTrailingWarnings(for(i in 5:-300) funkyFunction(i))
Warning messages:
1: In funkyFunction(i) : -1 is negative
2: In funkyFunction(i) : -2 is negative
3: In funkyFunction(i) : -3 is negative
4: In funkyFunction(i) : -4 is negative
5: In suppressTrailingWarnings(for(i in 5:-300) funkyFunction(i)) : Only the first 4 of 300 warnings were reported
===========================
Option 2:
For single statements, you can use the suppressWarnings() function but this is inefficient for more complex data functions:
• suppressWarnings( expr )
Option 3:
You can disable warnings globally with the options() function, but it is not optimal to completely disable warnings:
• options( warn = -1 )
Comments
0 comments
Article is closed for comments.