SFTP module is not working properly

0
Dear reader. I would like to use the SFTP module from the app store. I can't get it running properly. I have installed an SFTP server on my laptop and I have tested the server by connecting to it using FileZilla SFTP client. This works fine. but when I try to connect to the server from the Mendix module, I receive a console error 'Access denied'. This is what I have done so far: Installed SFTP module. Run the microflow ASu_CreateSFTPInformation during start up of the program. Created a custom button, which runs the ShowSFTPInformation microflow. I have entered username, password etc. Saved the private key in the private.key document and 127.0.0.1 in the known.hosts document in the Resources/SFTP directory. Inserted the SFTPFileDocument_Overview in my application, which is filled by a custom microflow, based on the example in the SFTP module (I retrieve SFTPInformation (this works) and then call the 'GetFileList...' Java action call). The custom microflow in 4) throws an error at the Java action call step, which looks like this (sorry for the huge post). Does anyone know how to fix this error? - An error has occurred while handling the request. [User 'admin' with session id 'f3486078-e5b8-4115-9fa3-634b296a37fc' and roles 'Administrator'] -------- lg: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document with action LIST. at SFTPConnection.GetFileList (JavaAction : 'Call 'GetFileListFromSFTPLocation'') Advanced stacktrace: at mx.a(SourceFile:185) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document with action LIST. at com.mendix.core.Core.execute(SourceFile:232) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document with action LIST. at hE.b(SourceFile:218) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document with action LIST. at sftpconnection.helpers.HandleFileSftp.handleFile(HandleFileSftp.java:143) Caused by: com.jcraft.jsch.JSchException: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1 resolve) at com.jcraft.jsch.Util.createSocket(Util.java:341) at com.jcraft.jsch.Session.connect(Session.java:194) at com.jcraft.jsch.Session.connect(Session.java:162) at sftpconnection.helpers.HandleFileSftp.handleFile(HandleFileSftp.java:95) at sftpconnection.actions.GetFileListFromSFTPLocation.executeAction(GetFileListFromSFTPLocation.java:45) at sftpconnection.actions.GetFileListFromSFTPLocation.executeAction(GetFileListFromSFTPLocation.java:25) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hE.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at ln.a(SourceFile:69) at mx.a(SourceFile:72) at mw.a(SourceFile:151) at mw.executeAction(SourceFile:98) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457) at hE.b(SourceFile:207) at com.mendix.core.Core.execute(SourceFile:226) at gp.execute(SourceFile:186) at jd.a(SourceFile:319) at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161) at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160) at akka.actor.Actor$class.apply(Actor.scala:545) at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156) at akka.actor.LocalActorRef.invoke(ActorRef.scala:910) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192) Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1 resolve) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) at java.security.AccessController.checkPermission(AccessController.java:549) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
asked
3 answers
1

Make sure you do not have "emulate cloud security" enabled under -> project -> settings -> configuration -> "default" (or your own) -> server -> emulate cloud security.

answered
1

What Jaap suggested or add

permission java.net.SocketPermission "127.0.0.1", "resolve";

to the .policy file in the folder location of your business modeler (i.e. C:\Program Files (x86)\Mendix\4.5.2\runtime)

Update This new exception you are experiencing originates from the library(JSch) this Mendix module uses. To be pointed to the cause of this exception, you could google for it as the problem seems to be in your current server set-up. After some further investigation: According to the filezilla project, filezilla server does not support SSH.

Chech this thread which discusses SFTP Servers to enable you to test locally.

answered
0

Thanks Jaap and Roeland. I did what you both said but now the 'Access denied' error has changed to this 'Auth fail' error. However, I am confidant that I have entered valid credentials. Do you have any suggestions?

An error has occurred while handling the request. [User 'admin' with session id '256662b4-a153-47ed-b5c6-97ca952053e0' and roles 'Administrator']

--------

lg: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document  with action LIST.
    at SFTPConnection.GetFileList (JavaAction : 'Call 'GetFileListFromSFTPLocation'')

Advanced stacktrace:
    at mx.a(SourceFile:185)
Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document  with action LIST.
    at com.mendix.core.Core.execute(SourceFile:232)
Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document  with action LIST.
    at hE.b(SourceFile:218)
Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: JschException occured for document  with action LIST.
    at sftpconnection.helpers.HandleFileSftp.handleFile(HandleFileSftp.java:143)
Caused by: com.jcraft.jsch.JSchException: Auth fail
    at com.jcraft.jsch.Session.connect(Session.java:484)
    at com.jcraft.jsch.Session.connect(Session.java:162)
    at sftpconnection.helpers.HandleFileSftp.handleFile(HandleFileSftp.java:95)
    at sftpconnection.actions.GetFileListFromSFTPLocation.executeAction(GetFileListFromSFTPLocation.java:45)
    at sftpconnection.actions.GetFileListFromSFTPLocation.executeAction(GetFileListFromSFTPLocation.java:25)
    at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57)
    at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457)
    at hE.b(SourceFile:207)
    at com.mendix.core.Core.execute(SourceFile:226)
    at ln.a(SourceFile:69)
    at mx.a(SourceFile:72)
    at mw.a(SourceFile:151)
    at mw.executeAction(SourceFile:98)
    at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57)
    at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457)
    at hE.b(SourceFile:207)
    at com.mendix.core.Core.execute(SourceFile:226)
    at gp.execute(SourceFile:186)
    at jd.a(SourceFile:319)
    at com.mendix.externalinterface.connector.RequestDispatching$Worker.a(SourceFile:170)
    at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.a(SourceFile:161)
    at com.mendix.externalinterface.connector.RequestDispatching$Worker$a.apply(SourceFile:160)
    at akka.actor.Actor$class.apply(Actor.scala:545)
    at com.mendix.externalinterface.connector.RequestDispatching$Worker.apply(SourceFile:156)
    at akka.actor.LocalActorRef.invoke(ActorRef.scala:910)
    at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25)
    at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:223)
    at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:123)
    at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:195)
    at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher.scala:123)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:662)
    at akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.scala:192)
answered