R plot error in R scripting nodes

I really like the R nodes from mpicbg I had it working but recently have an error where they will not work. The Rserve is verified working. Here is the error from the log. Any help? I really do not want to lose these excellent nodes.

Thank you in advance,
Mike

2021-12-15 07:43:00,917 : ERROR : KNIME-Worker-8-R Plot 3:130 : : Node : R Plot : 3:130 : Execute failed: Failed to save R workspace: voidEval failed, request status: error code: 127
de.mpicbg.knime.scripting.core.exceptions.KnimeScriptingException: Failed to save R workspace: voidEval failed, request status: error code: 127
at de.mpicbg.knime.scripting.r.RUtils.saveWorkspaceToFile(RUtils.java:574)
at de.mpicbg.knime.scripting.r.plots.AbstractRPlotNodeModel.createInternals(AbstractRPlotNodeModel.java:247)
at de.mpicbg.knime.scripting.r.plots.AbstractRPlotNodeModel.pullOutputFromR(AbstractRPlotNodeModel.java:113)
at de.mpicbg.knime.scripting.r.node.plot.RPlotNodeModel.executeImpl(RPlotNodeModel.java:49)
at de.mpicbg.knime.scripting.core.AbstractScriptingNodeModel.execute(AbstractScriptingNodeModel.java:176)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:549)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1259)
at org.knime.core.node.Node.execute(Node.java:1039)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:365)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:219)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

@MikeK welcome to the KNIME forum.

Maybe you could provide us with an example that used to work so we could try to investigate.

Data table is very simple. All R nodes in the R scripting do not work.

image
2021-12-15 10_53_24-Filtered table - 3_135 - Column Filter

Even this 2 node workflow fails

image

Hi Mike,

did you try to restart the Rserve process? I know that does not solve the issue that this type of error occurs, but often it helped in my case. Just kill it in TaskManager or Activity Manager and restart it in R. Maybe that helps for the moment…
Martin

1 Like

@MikeK I thought about an actual example with data and code, I cannot say much from the screenshots :slight_smile:

1 Like

I have restarted Rserve and KNIME several times

Are these the community or the ‚official‘ knime R nodes. Have you tried the other ones?

It is the community R scripting nodes. I think I found the solution. I restarted the Rserver with the options Rserve(args = “–vanilla”) and it is working now. Not sure what the vanilla option does but it helped. I have used the Microsoft R version of Rserve in the past that supported parallel R sessions. Releases · microsoft/deployr-rserve · GitHub

I might switch to that version to see if it is more stable on windows.

Mike

2 Likes

@MikeK glad you found a solution. For the R community nodes I found it best to combine it with RSclient and control it like this. You will have to set the port in the KNIME preferences.

library(Rserve)
library(RSclient)

Rserve(port = 6311, debug = FALSE, args = “–vanilla”)

# start the RServe(er)
rsc <- RSconnect(port = 6311)

# shutdown the server after you used it
RSshutdown(rsc)

I collected some articles about KNIME and R. I typically would use the “official” version:

1 Like

@Mike great that you solved it.

Indeed you need to start the R server with
library(Rserve); Rserve(args = “–vanilla”)
… this is what the nodes will also tell you in the console, if they dont find any Rserve process.

The option --vanilla is just a combination of several options to be set for Rserve, See below:

Options:
--save Do save workspace at the end of the session
--no-save Don't save it
--no-environ Don't read the site and user environment files
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the user R profile
--restore Do restore previously saved objects at startup
--no-restore-data Don't restore previously saved objects
--no-restore-history Don't restore the R history file
--no-restore Don't restore anything
--vanilla Combine --no-save, --no-restore, --no-site-file,--no-init-file and --no-environ

@mlauber71 thanks for the hint to RSclient and all the documentation! I will have a look into this…

2 Likes