Excel Reader / Writer - Can't write on local filesystem

Hello,

since last update, I can’t write or read Excel files from the local filesystem of the server anymore, because of insufficient permissions. I accessed the files via a direct file path, created in the workflow.
Is there a workaround, possibly with the knime context variables, to read / write from the local filesystem?

Many thanks in advance
David

1 Like

Hi David,

this is something which we changed on purpose. We got a lot of feedback from our customers that being able to write on the repository is a security breach for them. We are agreeing here and did deactivate this in our updated file handling nodes. In addition with our distributed executors writing to a local file system is not possible at all as well.

There is a workaround with which this is still possible.

What would be your use case to write directly to the file system?

Kind regards, Iris

1 Like

HI Iris
we have a workflow that uses the excel reader to read from the local file system, and currently, we are having a problem to read data through Webportal after Server update to Version: 4.10.1.0033 and client version 4.1.1.
showing workflow did not fully execute.

Excel Reader (XLS) 2:1
Execute failed: Direct access to the local file system is not allowed on KNIME Server.

would you mind to give me some guidance to solve the issue?
Thank you

Hi All.
so I created a workflow to test Excel Reader read from network shared drive.
I’m able to run output table with complete data when I use the Knime Analytics platform.but I’m not able to run on Webportal.
this is the error message.

Excel Reader (XLS) 8:1

Execute failed: Direct access to the local file system is not allowed on KNIME Server.

this is the screenshot of the workflow.
image

anyone may able to help me?
Thank you

Hi Iris,

sorry for the late reply. We have a workflow right now, which is reading and writing Excel files directly from a folder, located in the workflow folder.
Because relative paths (knime.workflow) didn’t work in the past, we accessed them via direct paths as a workaround. We didn’t use a proper database or filesystem, because the workflow is still a prototype.
Your argument regarding a security issue makes sense though. In that sense, we maybe should implement a better way to access and write the data.

Kind regards, David

Hi Iris,

We met the similar issue, but you mentioned:

Can I know what is the workaround? Can you create a simple workflow to illustrate the point?

Thanks,
Eric

Hi All,

sorry for the delay, but I still wanted to give you an overview what we are recommending in terms of best practices for your different use cases.

Temporary Files:

If your Excel nodes fail because you used the Create_Temp_Dir Node to generate the folder, we added a feature in the node for this. It now has the option to Create the temp directory inside the workflow folder, which we are recommending to change for existing nodes. For backwards compatability reasons, this option is deactivated in already recreated nodes and must be manually enabled.

image

The node than directly generates the workflow relative path, which can be used in the Excel nodes.

You can than use the generated flow variables in the node using Custom URL as below.

Accessing folder on the server

If you need to access the folder structure, e.g. because of a mounted sharepoint drive you first need to copy the file into your workflow folder. For this I added a component into my hub mountpoint which I hope make your life easier. We are aware of this need and will work on finding solutions for everyone.
For this I copy the file in a temporary directory. The component needs a temporary folder created beforehand.

image

Please do not forget to read the file using the Excel Reader node, you need to set Custom URL as above and use the FlowVariable output by the Copy local files into workflow component.

You can get my component here

And I added the example workflow here:

Please let me know if I can make you any more examples or the existing ones need improvement.

Have a great weekend!
Iris

4 Likes

Hi @Iris,

we are using the proposed workaround. Thank you very much for it. Nevertheless we were wondering if it would be possible to change the preferences as mentioned in https://docs.knime.com/2019-12/server_update_guide/index.html#local-fs-access to allow acces to the local file system.

Hi @jkempelis
absolutely, that is a really good thing as well! If you are comfortable for this, the setting is reverting back to the old behavior.

Hi @Iris,

we have included “/instance/org.knime.filehandling.core/allow_local_fs_access_on_server=true” in the servers .epf but it is not showing any effect. We have not updated to 4.10.2 yet. Could that be the reason?

Hi @jkempelis

yes this was included with the 4.10.2 release only.

We are going to release 4.10.3 this week because of an EJB based problem. So If you could wait until Monday, you could get the 4.10.3 already.

1 Like