Interaction of R and KNIME via popup box doesn't work since 3.6.1

Hi there,

I have a KNIME workflow in which I decrypt a pgp-file using an R Snippet. The R Code in this snippet uses the R package “gpg”. In KNIME 3.5.x, this workflow could be executed without any problems. Now, in KNIME 3.6.1, it doesn’t work anymore. I do not get an error message - the node runs like forever instead. As fas as I can tell, it is because the passphrase popup box doesn’t pop up.

However, when I start my pgp program and decrypt the file, KNIME notices that the password has been entered and the node is executed successfully.

@agaunt

we are very sorry to hear that.

Could you please provide us with the following information and we will have a look at it:

  • KNIME log (but I guess nothing is written there :slight_smile: )
  • R version
  • gpg version
  • your script (if that’s possible)
  • data similar to the one your are using - ofc only if available

Sorry for the inconveniences,
Mark

1 Like

Hi Mark,

okay, here we go:

The (relevant part of the) log:

2018-10-23 13:18:52,877 : DEBUG : ModalContext : LocalWorkspaceFileStore :  :  : Refreshed resource P/GPG Problem
2018-10-23 13:19:16,678 : DEBUG : main : WorkflowEditor :  :  : Creating WorkflowEditor...
2018-10-23 13:19:16,700 : DEBUG : main : WorkflowEditor :  :  : creating editor actions...
2018-10-23 13:19:16,815 : DEBUG : main : WorkflowEditor :  :  : Initializing editor UI...
2018-10-23 13:19:16,825 : DEBUG : main : WorkflowEditor :  :  : Opening workflow Editor on     workflow.knime
2018-10-23 13:19:16,835 : DEBUG : main : WorkflowEditor :  :  : Setting input into editor...
2018-10-23 13:19:16,848 : DEBUG : main : WorkflowEditor :  :  : Resource File's project: file:/U:/KNIME/KNIME%20Workspace/GPG%20Problem/
2018-10-23 13:19:17,050 : INFO  : ModalContext : LoadWorkflowRunnable :  :  : New workflow created.
2018-10-23 13:19:17,063 : DEBUG : ModalContext : NodeContainer :  :  : Workflow Manager 2 has new state: EXECUTED
2018-10-23 13:19:17,073 : DEBUG : ModalContext : WorkflowManager :  :  : Created subworkflow 2
2018-10-23 13:19:17,083 : DEBUG : ModalContext : WorkflowManager :  :  : Added new subworkflow 2
2018-10-23 13:19:17,093 : DEBUG : ModalContext : NodeContainer :  :  : ROOT  has new state: IDLE
2018-10-23 13:19:17,102 : DEBUG : ModalContext : WorkflowManager :  :  : Created project 2
2018-10-23 13:19:17,113 : DEBUG : main : WorkflowEditor :  :  : Saving workflow Workflow Manager 2
2018-10-23 13:19:17,524 : DEBUG : ModalContext : LocalWorkspaceContentProvider :  :  : Refreshing "/GPG Problem"
2018-10-23 13:19:17,577 : DEBUG : main : SVGExporter :  :  : Not saving SVG to workflow (viewer is null)
2018-10-23 13:19:17,596 : DEBUG : main : ProjectWorkflowMap :  :  : Adding "file:/U:/KNIME/KNIME%20Workspace/GPG%20Problem/" to project map (1 in total)
2018-10-23 13:19:17,609 : DEBUG : main : ProjectWorkflowMap :  :  : registering org.knime.workbench.editor2.WorkflowEditor@55b78dad to file:/U:/KNIME/KNIME%20Workspace/GPG%20Problem/. 1 registered clients now.
2018-10-23 13:19:17,620 : DEBUG : main : WorkflowEditor :  :  : Scheduled auto-save job for GPG Problem (every 900 secs without data)
2018-10-23 13:19:48,408 : DEBUG : main : Node : R Source (Table) : 2:1 : Configure succeeded. (R Source (Table))
2018-10-23 13:19:48,409 : DEBUG : KNIME-Workflow-Notifier : WorkflowEditor :  :  : Workflow event triggered: WorkflowEvent [type=NODE_ADDED;node=2:1;old=null;new=R Source (Table) 2:1 (IDLE);timestamp=23.10.2018 13:19:48]
2018-10-23 13:19:48,418 : DEBUG : main : NodeContainer :  :  : Setting dirty flag on GPG Problem 2
2018-10-23 13:19:48,437 : DEBUG : main : NodeContainer :  :  : R Source (Table) 2:1 has new state: CONFIGURED
2018-10-23 13:19:48,438 : DEBUG : KNIME-Workflow-Notifier : WorkflowEditor :  :  : Workflow event triggered: WorkflowEvent [type=WORKFLOW_DIRTY;node=2;old=null;new=null;timestamp=23.10.2018 13:19:48]
2018-10-23 13:19:48,447 : DEBUG : main : WorkflowManager :  :  : Added new node 2:1
2018-10-23 13:19:48,468 : DEBUG : main : NodeContainer :  :  : GPG Problem 2 has new state: CONFIGURED
2018-10-23 13:19:48,504 : DEBUG : main : WorkflowRootEditPart :  :  : part: NodeAnnotationEditPart(  )
2018-10-23 13:19:48,600 : DEBUG : main : WorkflowRootEditPart :  :  : part: NodeContainerEditPart( R Source (Table) 2:1 (CONFIGURED) )
2018-10-23 13:19:48,659 : DEBUG : KNIME-Node-Usage-Writer : NodeTimer$GlobalNodeStats :  :  : Successfully wrote node usage stats to file: U:\KNIME\KNIME Workspace\.metadata\knime\nodeusage_3.0.json
2018-10-23 13:19:53,253 : DEBUG : R Output Reader : RBinUtil :  :  : External Rscript process output: 
2018-10-23 13:19:53,253 : DEBUG : R Error Reader : RBinUtil :  :  : External Rscript process error output: 
2018-10-23 13:19:53,581 : DEBUG : R Error Reader : RBinUtil :  :  : External Rscript process error output: 
2018-10-23 13:19:53,581 : DEBUG : R Output Reader : RBinUtil :  :  : External Rscript process output: 
2018-10-23 13:19:54,643 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Connected to Rserve in 1 attempt(s) (0ms).
2018-10-23 13:19:57,350 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Terminating R process
2018-10-23 13:19:57,883 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Connected to Rserve in 1 attempt(s) (0ms).
2018-10-23 13:19:57,893 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Recovered with a new R process
2018-10-23 13:20:15,866 : DEBUG : R Error Reader : RBinUtil :  :  : External Rscript process error output: 
2018-10-23 13:20:15,866 : DEBUG : R Output Reader : RBinUtil :  :  : External Rscript process output: 
2018-10-23 13:23:58,377 : DEBUG : main : Node : R Source (Table) : 2:1 : reset
2018-10-23 13:23:58,388 : DEBUG : main : Node : R Source (Table) : 2:1 : clean output ports.
2018-10-23 13:23:58,400 : DEBUG : main : NodeContainer : R Source (Table) : 2:1 : R Source (Table) 2:1 has new state: IDLE
2018-10-23 13:23:58,411 : DEBUG : main : Node : R Source (Table) : 2:1 : Configure succeeded. (R Source (Table))
2018-10-23 13:23:58,421 : DEBUG : main : NodeContainer : R Source (Table) : 2:1 : R Source (Table) 2:1 has new state: CONFIGURED
2018-10-23 13:23:58,443 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Terminating R process
2018-10-23 13:23:58,992 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Connected to Rserve in 1 attempt(s) (0ms).
2018-10-23 13:23:59,002 : DEBUG : AWT-EventQueue-0 : RController : R Source (Table) : 2:1 : Recovered with a new R process
2018-10-23 13:24:01,873 : DEBUG : main : ExecuteAction :  :  : Creating execution job for 1 node(s)...
2018-10-23 13:24:01,883 : DEBUG : main : NodeContainer :  :  : R Source (Table) 2:1 has new state: CONFIGURED_MARKEDFOREXEC
2018-10-23 13:24:01,894 : DEBUG : main : NodeContainer :  :  : R Source (Table) 2:1 has new state: CONFIGURED_QUEUED
2018-10-23 13:24:01,906 : DEBUG : main : NodeContainer :  :  : GPG Problem 2 has new state: EXECUTING
2018-10-23 13:24:01,916 : DEBUG : KNIME-Worker-3 : WorkflowManager : R Source (Table) : 2:1 : R Source (Table) 2:1 doBeforePreExecution
2018-10-23 13:24:01,926 : DEBUG : KNIME-Worker-3 : NodeContainer : R Source (Table) : 2:1 : R Source (Table) 2:1 has new state: PREEXECUTE
2018-10-23 13:24:01,936 : DEBUG : KNIME-Worker-3 : WorkflowManager : R Source (Table) : 2:1 : R Source (Table) 2:1 doBeforeExecution
2018-10-23 13:24:01,936 : DEBUG : KNIME-WFM-Parent-Notifier : NodeContainer :  :  : ROOT  has new state: EXECUTING
2018-10-23 13:24:01,948 : DEBUG : KNIME-Worker-3 : NodeContainer : R Source (Table) : 2:1 : R Source (Table) 2:1 has new state: EXECUTING
2018-10-23 13:24:01,970 : DEBUG : KNIME-Worker-3 : WorkflowFileStoreHandlerRepository : R Source (Table) : 2:1 : Adding handler 6c32a114-5a6c-49e8-b243-c8f9a6b48912 (R Source (Table) 2:1: <no directory>) - 1 in total
2018-10-23 13:24:01,980 : DEBUG : KNIME-Worker-3 : LocalNodeExecutionJob : R Source (Table) : 2:1 : R Source (Table) 2:1 Start execute
2018-10-23 13:24:02,400 : DEBUG : R Output Reader : RBinUtil :  :  : External Rscript process output: 
2018-10-23 13:24:02,400 : DEBUG : R Error Reader : RBinUtil :  :  : External Rscript process error output: 
2018-10-23 13:24:18,845 : DEBUG : main : NodeContainerEditPart :  :  : R Source (Table) 2:1 (EXECUTING)
  • R version 3.4.2
  • gpg version 0.5

R script:

install.packages("gpg", repos = "http://cran.uib.no")
library(gpg)
gpg_decrypt("myfile.csv.gpg")

I don’t think sharing any data is useful, because this problem is not data-dependent.

Kind regards,
agaunt

@agaunt

what operating system are you running?

Just tested everything under Ubuntu 18.04 LTS (however using R 3.4.4) and it works just fine.

Looking forward hearing from you.

Hi Mark, I use Windows 10.

Hi @agaunt

I finally managed to reproduce your problem!

First of all. This has nothing to do with KNIME, but with GPG4win.

I guess you have a fresh windows installation and installed besides KNIME 3.6.1 also the current version of GPG4win.
The problem is that the gpg R package cannot open the popup (pinedit) using newer versions of GPG4win. You have the following two options:

  1. Install an older version of GPG4win (using 2.3.4 worked fine for me)

  2. Try using rcrypt instead (If I remember correctly, the popup appears with the current GPG4win version).

I hope that solves your problem.

Looking forward hearing from you,
Mark

P.S. We would highly appreciate if you could select this reply solves the problem if it does so :slight_smile:

2 Likes

Hi Mark,

first of all I’m very sorry for the belated reply. Using an older version of GPG4win was not an option, since this would have been neccessary on a larger number of notebooks without administrator rights.

I tried using rcrypt, but couldn’t manage to get this package to work, even not on my local R instance.

After a bit of research, I found the KNIME node Bash. It can send commands to the terminal, so it follows basically the same concept as rcrypt, but without the bypass R. I used the bash command
gpg.exe --output "path\to\my\file.csv" -d "path\to\my\encrypted\file.csv.gpg"
and as execution directory the folder where my gpg.exe is located in.

Kind regards
Agaunt

3 Likes

That’s great news!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.