The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
web service error "The script could not be parsed"
Hi,
I have a RM process that runs well on local, but the web service has error:
de.rapidanalytics.ejb.service.ServiceDataSourceException Error executing process /home/RM/0_main_recommender for service 0_main_recommender: The script could not be parsed.
Couldn't find similar error online. Could somebody help please? Thanks!
RM in XML:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.4.000">
<context>
<input/>
<output/>
<macros>
<macro>
<key>TABLE_IN_KNOWN</key>
<value>-1</value>
</macro>
<macro>
<key>TABLE_IN</key>
<value>-1</value>
</macro>
<macro>
<key>PREDICTOR</key>
<value>-1</value>
</macro>
<macro>
<key>LABEL</key>
<value>-1</value>
</macro>
<macro>
<key>METRIC</key>
<value>-1</value>
</macro>
<macro>
<key>GROUP</key>
<value>-1</value>
</macro>
<macro>
<key>METADATA</key>
<value>-1</value>
</macro>
<macro>
<key>TABLE_OUT</key>
<value>-1</value>
</macro>
</macros>
</context>
<operator activated="true" class="process" compatibility="6.4.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="r_scripting:execute_r" compatibility="6.4.000" expanded="true" height="60" name="Execute R" width="90" x="45" y="30">
<parameter key="script" value="library(RODBC) library(readr) library(dplyr) # get metadata from different sources #### parse_metadata = function(table_in_known, table_in, col_predictor, col_label, col_metric, col_group, metadata, table_out){ if(table_in_known != -1) { # read metadata from database ch = odbcConnect('AnalyticsEngine') sql0 = paste0(" SELECT * FROM [dbo].[aap_data_attribute_metadata] WHERE [table] = '", table_in_known, "'") sql0 = paste0(' SELECT * FROM [dbo].[aap_data_attribute_metadata]') cat(sql0, '\n\n') metadata_fixed = sqlQuery(ch, sql0) table_in = table_in_known } else { if (metadata != -1){ } else{ # what format of metadata? XML? metadata_fixed = data.frame(metadata) } # save it to database } if(table_out == -1){ table_out = paste(table_in, format(Sys.time(), '%Y_%m_%d_%H_%M_%S'), sep = '_') } list(table_in, metadata_fixed, table_out) } decide_scenario = function(metadata){ if ( ! 'label' %in% metadata$role){ # unsupervised scenario = c('outlier', 'clustering') } else if ( sum(metadata$role == 'label') > 1 ){ stop('more than one label not allowed') } else { # supervised if (metadata[metadata$role == 'label', 'datatype'] %in% c('numeric', 'int')) { scenario = 'regression' # if(metadata[metadata$role == 'label', 'datatype'] == 'int' & dat$){ # # warning('are you sure the label is numeric, rather than classes?') # } } else if (metadata[metadata$role == 'label', 'datatype'] %in% c('character', 'factor')) { scenario = 'classification' } } if('datetime' %in% metadata$role){ scenario = append(scenario, c('ts', 'aggregation')) } scenario = append(scenario, 'feature_engineering') # this always work? } rm_main = function(dat, in_rapidminer = T){ # macro inputs from UI (default of macros is -1) #### # either data source with known metadata table_in_known = '%{TABLE_IN_KNOWN}' # or new data with metadata table_in = '%{TABLE_IN}' col_predictor = '%{PREDICTOR}' col_label = '%{LABEL}' col_metric = '%{METRIC}' col_group = '%{GROUP}' # or metadata = '%{METADATA}' # metadata (role and datatype) about the columns. If have this, `column_in` and `group` are ignored # # don't do this step now (high automation) #### # # show user available algorithms based on metadata, and use chooses some of them if(in_rapidminer == F){ table_in_known = 'HHS_CLM_ROLLING_36_MONTHS_Jul14_provider_daily' } # now specify output table table_out = '%{TABLE_OUT}' # parse and organize metadata from different sources #### parsed = parse_metadata(table_in_known, table_in, col_predictor, col_label, col_metric, col_group, metadata, table_out) table_in = parsed[[1]] metadata = parsed[[2]] table_out = parsed[[3]] scenario = decide_scenario(metadata) cat('scenario:', scenario, '\n') cat('table_in:', table_in, '\n') cat('table_out:', table_out, '\n') }"/>
</operator>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
I have seen this before when my server didn't have access to a datasource that was needed or called within the script and the script was throwing an error. Not at my server right now, will try to look more into it tomorrow but wanted to point you in a hopefully useful direction!
Looked more closely - what is likely happening is a datasource connection issue from the server. Can't reproduce obviously b/c it is your sources, but double-check connections from your RM server to the database tables.