I am having no luck getting sFTP to work after upg...
# lucee
j
I am having no luck getting sFTP to work after upgrading to 5.4.3.2....pretty straightforward setup, scheduled task that uses sFTP to go grab a file and process it, worked prior to the patch on version (5.3.8.206) --- it looks like the underlying library for sFTP has been updated...yeah I know pretty big leap forward, a server I was handed to manage
b
I'm curious about this as I have a client also using sFTP, but they haven't updated the CommandBox instances yet that run the task runners that processes it
What is the error you get?
j
short version of it: com.jcraft.jsch.JSchException: Auth fail for methods 'publickey'
b
Ahh, JSch and it's worthless error messages, lol
Is there a full stack?
j
yeah, let me get it
Copy code
lucee.runtime.exp.NativeException: com.jcraft.jsch.JSchException: Auth fail for methods 'publickey' at lucee.runtime.net.ftp.SFTPClientImpl.handleFail(SFTPClientImpl.java:394) at lucee.runtime.net.ftp.SFTPClientImpl.connect(SFTPClientImpl.java:117) at lucee.runtime.net.ftp.FTPWrap.connect(FTPWrap.java:118) at lucee.runtime.net.ftp.FTPWrap.<init>(FTPWrap.java:61) at lucee.runtime.net.ftp.FTPPoolImpl._get(FTPPoolImpl.java:83) at lucee.runtime.net.ftp.FTPPoolImpl.get(FTPPoolImpl.java:38) at lucee.runtime.tag.Ftp.getClient(Ftp.java:498) at lucee.runtime.tag.Ftp.actionOpen(Ftp.java:622) at lucee.runtime.tag.Ftp.doEndTag(Ftp.java:179) at tasks.aim.pull_files_cfm$cf$1z0.call(/tasks/AIM/pull_files.cfm:9) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1056) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:948) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2493) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2478) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2449) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1216) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1162) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:872) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: com.jcraft.jsch.JSchException: Auth fail for methods 'publickey' ... 43 more Caused by: com.jcraft.jsch.JSchException: Auth fail for methods 'publickey' at com.jcraft.jsch.Session.connect(Session.java:499) at com.jcraft.jsch.Session.connect(Session.java:187) at lucee.runtime.net.ftp.SFTPClientImpl.connect(SFTPClientImpl.java:101) ... 41 more
wanted to see if we were missing anything before submitting a ticket
j
some of these ideas seem relevant. possibly a keytype issue and possibly a server configured with low retry threshold. https://github.com/mwiede/jsch/issues/47. i'm not sure how to influence which key types lucee configures jsch with, tho. https://github.com/mwiede/jsch/issues/47
b
@John If this same exact code, key, and server worked in a previous version of Lucee I'd put in a ticket
But the best way to get it worked on is prolly if you can have some example, or at least document the exact kind of key, etc
j
yeah it did, I will submit the ticket
👍 2
thanks
b
I've pinged my client with a note to test before we upgrade that server for them 🙂
a
This one already has/had a ticket I think. We had this issue (and discussed it) a few weeks back. Lemme try to find it. Need to set a param on yer javaargs
And we added this to
LUCEE_JAVA_OPTS
in our Dockerfile:
Copy code
-Djsch.server_host_key=ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss
You will want to set
-Djsch.publickey
instead though.
(and its value will be different too, but from that doc link above, it's easy enough to work out)
j
i think you could connect using cli
ssh
with verbose logging to see what it ends up connecting with, then emulate it with the java properties. that key type could go at the beginning of the list (since i think it tries each list member in order until success).
👍 1
a
Yeah. We had a more verbose error like this:
Copy code
com.jcraft.jsch.JSchAlgoNegoFailException:
Algorithm negotiation fail:
algorithmName="server_host_key"
jschProposal="ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256"
serverProposal="ssh-rsa"
So I derived that list of algos from the merge of those two. Plus another one from a different supplier's FTP server that also had the same issue.
(no idea if this is the best approach, but it worked and I could move on to [something not caused by Lucee] for a few min until the next %^%$^& happened)
j
@Adam Cameron - not sure we are hitting the exact same issue, we have dealt with that one previously and got past it, what we are hitting now is a brick wall, I am going to create a separate ticket and let the devs figure it out --- appreciate the info and the help, short-term we are setting the task up on a server with a older version of lucee
👍 1
wanted to share, we kept at it and Adam's post led us down a path to the solution...updated the ticket with what we did to get it running again: https://luceeserver.atlassian.net/browse/LDEV-4684
👍 2
⭐ 2
a
Nice work sharing back!
c
Thanks for this thread everyone... it has helped immensely.
j
Awesome