Table to R node not executed in batch mode

HI @mlauber71
When I execute my batch file, all my workflow executes except my Table to R. I can’t finds any log file for anything that was ran as a batch file. I would like to know what is the best way to trouble shoot this issue
Regards
Pio

image

rframe <- knime.in

Day <- c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",

"Friday", "Saturday")[as.POSIXlt(Sys.Date())$wday + 1]

if( Day == ‘Monday’ |Day == ‘Tuesday’ |Day == ‘Wednesday’ |Day == ‘Thursday’ | Day == ‘Friday’){

library(mailR)

library(htmlTable)

#rename column names to own

names(knime.in)[2] <- ‘STAGE / STEP’

names(knime.in)[1] <- ‘Number of Wafers’

Convert the data frame into an HTML Table

y <- htmlTable(knime.in, rnames = FALSE)

location <- paste0("J:/ENG/PIO/")

Define body of email

#Paste is basically a concat

html_body <- paste0(’<font color=“blue”><b> Number of Stage;Step with over 2 wafer counts</b></font>’, y, ‘<font color=“blue”><b> Number of P2 wafers </b></font>’, knime.flow.in[[“LOTID (Unique count)”]], ‘<font color=“blue”><br><b> Number of P1 wafers </b></font>’,knime.flow.in[[“LOTID (Count)”]],’<font color=“blue”><br><b> Number of wafers over 72 hrs </b></font>’,knime.flow.in[[“Count(LOTID)”]],’<font color=“blue”><br><b> Number of Scap wafers to be reviewed </b></font>’,knime.flow.in[[“Lot”]],’<font color=“blue”><br><b>Google Vacuum Daily Report - Vacuum Hold Tab & Scrap Tab has been updated’)

library(mailR)

#set working directory

setwd(location)

send.mail(to = c("pio.jesudoss@xxxx.com"),

from = "pio.jesudoss@xxxx.com",

#to = c("pio.jesudoss@xxxx.com"),

#subject = paste0("Changepoint - Detection on ", knime.flow.in[["Prod_Code"]], " Rosewood ", knime.flow.in[["Target_Var"]]),

subject = "Vacuum Daily Report - HOLDS & SCRAP",

body = html_body,

html = TRUE,

inline = TRUE,

smtp = list(host.name = "mailhost.xxxx.com",

port = 25,

ssl = FALSE),

#attach.files = c(paste0(location_a,"Top_10_Tools.pdf"), paste0(location_a,"Top_tools_data.csv"), paste0(location_a,"Top_10_Recipes.pdf"), paste0(location_a,"Top_recipes_data.csv"), paste0(location_a,"Top_10_metrology.pdf"), paste0(location_a,"Top_met_data.csv"), paste0(location_a,"Top_10_LSP.pdf"), paste0(location_a,"Top_LSP_data.csv")),

#attach.files = c(paste0(location,"HOLDS.csv"),paste0(location,"Hold_Greater_72_Hours_Details.csv"),paste0(location,"Scrap_wafers_to_be_rewviewed.csv")),

authenticate = FALSE,

send = TRUE)}

Hi there Pio,

I have moved your question to new topic as it didn’t seemed much related to the original one.

Log files are located in knime-workspace/.metadata/knime/knime.log regardless of execution way - through GUI or batch :wink:

I guess workflow executes just fine in GUI?

Br,
Ivan

1 Like

Hi @ipazin
That is ok. When I run it in the GUI, I have no problem at all. But when I run the batch file, all the other parts of the work flow executes perfectly fine except the the table to R part. But When I run the batch file, i have to close KNIME.
I have checked my log files numerous times and I can’t any information when I run a batch file. If I open Knime then I have all the information.
This makes it hard for me to try and troubleshoot
Any help would be good
Regards
Pio

Hi @pio,

running batch mode doesn’t require closing KNIME. Only workflow being called can’t be opened in GUI editor if default preferences regarding workflow locking are not changed (default preference is that workflow is locked when opened and thus can not be run by another KNIME instance).

What log are you checking? I have just tested it and knime.log gets populated when batch mode is invoked. Not sure there is option to change that behavior so check your log again :wink:

Br,
Ivan

1 Like

Hi @ipazin
As per your suggestion, I have left KNIME open with the workflow closed. I ran the batch file and checked the log file. I repeated this couple of times now. I still can’t find any log but as soon asI start working on any of my work flow, I can see the logs. So i don’t understand why this would happen
Regards
Po

could you provide us with the command which you use to start the batch mode and which operating system do you use?

Additionally it would be good to see a minimal example that crashes in your configuration so that we might have the same base to test and explore.

1 Like

Hi @mlauber71

This is the batch file that I use

echo on

“C:\Users\222223\Documents\knime_3.7.1\knime.exe” -nosplash -reset -application org.knime.product.KNIME_BATCH_APPLICATION --launcher.suppressErrors -preferences=“C:\Users\222223\Documents\KNIME_Prefs\knime_preferences.epf” -workflowDir=“C:\Users\222223\pio\knime_ws\Vacuum_Holds_Scrap_Project_Deployed”

exit /b

I am running my batch file in windows. I have no issues when I run the work flow in the GUI. Everything is ok but when I run the batch file. All the nodes execute except the Table to R node.

I don’t understand your question about the configuration. What minimal example do you require
Regards
Pio

Hi @pio, did you make sure that the knime_preferences.epf contains the correct path your R instance and that this instance also has the packages mailR and htmlTable installed?

2 Likes

Hi there,

Where are you checking these logs? Log file you should be checking is in
you knime-workspace/.metadata/knime/knime.log

If there is nothing that would indicate your batch call is executing workflow in other workspace. Do you have any other workspace?

Br,
Ivan

1 Like

Hi @ipazin
When i open the console it points to


*** Welcome to KNIME Analytics Platform v3.7.1.v201901281154 ***
*** Copyright by KNIME AG, Zurich, Switzerland ***


Log file is located at: C:\Users\222223\pio.metadata\knime\knime.log

And that is where I am looking.

Is there a way to change the log file path or is there a way i can find out where else it could be?

Regards
Pio

Hi @agaunt,
I have the path file pointing towards R. I have also checked that the library contains mailR and htmlTable. First they were in 2 different places. I have copied the packages over made sure that the library path is the same. After doing this i ran the batch file and again only Table to R didn’t compute.

image

Regards
Pio

Hi @pio,

Can you check the path you provided? It is a bit weird - C:\Users\222223\pio.metadata\knime\knime.log

From your batch call the log file should be here:
C:\Users\222223\pio\knime_ws.metadata\knime\knime.log

Br,
Ivan

Hi @ipazin,
You are right. I checked the the Knime.log at C:\Users\222223\pio\knime_ws.metadata\knime\knime.log. This log seems to have stopped updating since 7th of june.

How do I go about merging the location of the log file?
Regards
Pio

Hi,

good we managed to find one of your log files :smiley:

Anyways you should organize your workspaces and check your exported preferences file. I guess you have more than one workspace and the one from which you exported preferences are not one that has everything configured properly for R.

Why are you even using -preferences argument? If using workflowDir argument KNIME batch will automatically start workflow execution in the workspace where your workflow is located…

Br,
Ivan

1 Like

Hi @ipazin,
sounds good.
Could you detail how about I have to get this done, please?
Regards
Pio

Hi,

From KNIME GUI go File --> Switch Workspace and there you will see which workspaces are available.

Additionally call your batch without -preferences parameter and see what happens and is there any information in corresponding log file.

Br,
Ivan

1 Like

Hi @ipazin,
I tried to switch the work space as per your suggestion but it was only pointing to one work space.
In the batch file, I tried without and with the preference ( again as per your suggestion, I saved it to the work space folder) In both case the batch file executed perfectly but i still can’t seem to get a log.
Regards
Pio

Hi @pio ,

Table to R node as well?

Br,
Ivan

Hi @ipazin
Yip. Thanks for all the help.
One question that still remains is the log file. I will keep trying to figure it out
Regards
Pio

Hi,

glad it works now!

If you figure it out regarding logs feel free to share it here with us :slight_smile:

Br,
Ivan