Deploy exe to server to schedule workflow with External Tool node

#1

I have a workflow that uses the external tool node. The node run a vb script using cscript.exe. It works great when running it manually, however it doesn’t work when scheduling it.

Can we deploy cscript.exe to the server so the scheduler knows where to pick up the exe and run my script?

Error msg from scheduler email:

Many Thanks

0 Likes

#2

Hi there,

Welcome to KNIME Community Forum!

Moved your topic to KNIME Server Category. I guess that is the server you are talking about.

When you say it works when started manually you mean manually from Server or manually on your computer?

Br,
Ivan

0 Likes

#3

Hi,

I mean manually on my computer.

When i schedule it on the server to run at a specific time, i get the email error from the original post.

0 Likes

#4

Hi,

Just to see if I got it right what you are trying to achieve. You want to execute Refresh.vbs on your input file (data from KNIME) under cscript.exe? In order for it to work in your KNIME Server environment not only should you deploy your exe but also vbs and your paths to input and output files should be accessible from KNIME Server or modified.

If I misunderstood something give it another go and we’ll try to figure it out.

Br,
Ivan

0 Likes

#5

Hi Ivan,

Your understanding is correct.

However the input and output file is essentially a dummy file. I don’t require a file but KNIME complains if those fields are blank.

How would I go about deploying my exe and vbs to the server?

Thanks

0 Likes

#6

Hi,

I see. I suggest you use relative paths in these cases. Create data folder within your workflow folder and there create text.csv file. Relative path to the file is then knime://knime.workflow/data/text.csv. This way transferring your workflow to Server or sending it to colleague doesn’t affect execution. Also you can create script folder in the same place and access Refresh.vbs and cscript.exe with relative paths. If the exe is too big and you will use it in multiple workflows having it with every workflow doesn’t make sense so find an adequate place on your KNIME Server and point your External Tool node to it.

I guess you KNIME Server is on Windows as your exe applies to Windows only?

Br,
Ivan

0 Likes

#7

I am familiar with writing a csv to a relative path by using the CSV writer node.

However, how do I write Refresh.vbs, cscript.exe to your suggested relative path? is there a specific node to use?

The .exe is very small so it should be fine.

Yes, i’m using Windows and my exe applies to windows.

Thank you!

0 Likes

#8

Hi,

relative paths are not node related. Check this video: https://www.knime.com/knime-introductory-course/chapter2/section1/absolute-and-relative-paths-knime-protocol.

My suggestion is to keep your files and scripts within your workflow folder and then deploying workflow to KNIME Server means transferring your files to Server as well. In that case using relative paths makes sense :wink:

Br,
Ivan

0 Likes

#10

Hi Ivan,

I’ve put cscript.exe and Refresh.vbs into my local workflow folder and then deployed my workflow.
image

The external node is now looking at my workflow folder.

However, when I run the deployed workflow on the server (through the web port) I get the below error.

Please let me know if this is what you were suggesting.

Thank you!

0 Likes

#11

Hi,

sort of :slight_smile:

So in workflow folder on your computer you can create additional folders from Windows Explorer (data and scripts for example):

WFStructure

and inside you can put your txt files and scripts. In node do not use absolute paths but rather relative paths. So paths would look like this:

Try it out and let me know how it went!

Br,
Ivan

0 Likes

#12

Thank you for the clarification!

I’ve tried your suggested values in the KNIME external tool node.

I get the below error prompt:
image

I’ve copied my files in a script folder as suggested below:

Thank you!

0 Likes

#13

Does the external tool node allow relative paths?

If I use the csv reader node to read a csv (knime://knime.workflow/data/text.csv), KNIME doesn’t complain, however the external tool node throws the below error.

image

Any ideas?

0 Likes

#14

Hi there,

Seems that Path to Executable, Execute in directory and Commandline Arguments options are not able to be relative…

Did you tried it out with absolute paths?

Br,
Ivan

0 Likes

#15

Yes, I’ve tried it with absolute paths and it works successfully when triggered manually but it DOES NOT work when scheduling it.

0 Likes

#16

Hi,

How does your External Tool node configuration on deployed workflow looks like? It should be pointing to the new .exe location.

Br,
Ivan

0 Likes

#17

It looks currently looks like this:

Again, this works when I execute it manually, but doesn’t with a schedule.

What do you mean by new location?

0 Likes

#18

Put it in a network drive somewhere both the Server can see it and your PC. Preferable an absolute path.

To be absolutely sure log into the machine that knime server is on as the “service” account knime is running (if you don’t have the credentials get your system admin to do it for you) on to check if that user can see where you have put the files.

Just path the path of the executable and the like into windows explorer on the server machine.

I doubt the server will be able to “see” the c:\users\lava…" folder, hence the error message.

2 Likes

#19

Hi Tim,

Thanks for the response.

I’ve tried putting the file in a shared drive as you can see from the original post, and no luck.
I didn’t want to have to go through my system admins, but it looks like this may be the only option.

I’ll start the conversation with my sys admins and post my results.

Thank you!

0 Likes

#20

I wonder if there is some KNIME code that could be called in a Java snippet to convert a mount point URL to an absolute path?

0 Likes

#21

Hi everyone,

I’ve recently been working with the External SSH Tool to see if it can help me achieve what I’m trying to do. From my understanding, it creates an SSH connection to remote host (KNIME server) which would run my .exe and .vbs. I’ve played around with the parameters, but I’m not sure how to configure it before the External Tool node. Can the External SSH Tool help my approach?

I’ve used the wine function illustrated from this thread:
https://stackoverflow.com/questions/20335878/is-it-possible-to-run-a-vbscript-in-unix-environment

Thanks

0 Likes