Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
himanshup
Contributor II
Contributor II

com.jcraft.jsch.JSchException: Auth cancel for methods 'password,publickey'

Hi,
on runnuiong the job in Talend8 studio (localhost or remoteserver), I am getting this error:

Exception in component tFTPPut_1 (FTP)
com.jcraft.jsch.JSchException: Auth cancel for methods 'password,publickey'
at com.jcraft.jsch.Session.connect(Session.java:532)
at com.jcraft.jsch.Session.connect(Session.java:194)
at edi_anthology.ftp_1_0.FTP.tFTPPut_1Process(FTP.java:1001)
at edi_anthology.ftp_1_0.FTP.tSetGlobalVar_1Process(FTP.java:1461)
at edi_anthology.ftp_1_0.FTP.runJobInTOS(FTP.java:2197)
at edi_anthology.ftp_1_0.FTP.main(FTP.java:1746)
[FATAL] 15:42:52 edi_anthology.ftp_1_0.FTP- tFTPPut_1 Auth cancel for methods 'password,publickey'
com.jcraft.jsch.JSchException: Auth cancel for methods 'password,publickey'
at com.jcraft.jsch.Session.connect(Session.java:532) ~[jsch-0.2.1.jar:0.2.1]
at com.jcraft.jsch.Session.connect(Session.java:194) ~[jsch-0.2.1.jar:0.2.1]
at edi_anthology.ftp_1_0.FTP.tFTPPut_1Process(FTP.java:1001) [classes/:?]
at edi_anthology.ftp_1_0.FTP.tSetGlobalVar_1Process(FTP.java:1461) [classes/:?]
at edi_anthology.ftp_1_0.FTP.runJobInTOS(FTP.java:2197) [classes/:?]
at edi_anthology.ftp_1_0.FTP.main(FTP.java:1746) [classes/:?]
[statistics] disconnected
 
We are on:
Talend Data Services Platform 
Version: 8
Build id: 20240524_0800-patch
Labels (1)
7 Replies
Xiaodi_Shi
Support
Support

Hello,

Which version of java do you use? The updates for Talend products delivered in May 2024 came with the requirement to start most of the modules with Java 17.

https://help.talend.com/en-US/installation-guide-windows/Cloud/compatible-java-environments

What's your key type? Is it ssh-ed25519?

Here is an article about:

https://github.com/mwiede/jsch#are-ssh-ed25519-ssh-ed448-curve25519-sha256-curve448-sha512--chacha20...

 

I'm supposing you need either higher version of java or add bouncy castle with a tLibraryLoad component.

Best regards

Sabrina

himanshup
Contributor II
Contributor II
Author

Hello,

I downloaded the Bouncy Castle and included that in tLibraryLoad component. I got the same error.
I am not sure how to tell what the key type is. I am fairly new to Talend.
I am trying to upgrade an existing project from Talend 7 to Talend 8

Thank you.

Xiaodi_Shi
Support
Support

Hello,

1. Please try adding the parameters below to the "Config client" option of tFTPConnection as below and let us know if that resolves the issue:
Client Parameter : "PubkeyAcceptedKeyTypes"
Value : "ssh-rsa"

or
JSch.setConfig("PubkeyAcceptedKeyTypes", "ssh-rsa," + JSch.getConfig("PubkeyAcceptedKeyTypes"));

https://help.talend.com/en-US/components/8.0/ftp/tftpconnection-standard-properties


2. If the suggestion above does not work, can you please try using downloading jsch-0.1.55 and see if that allows the job to run? This can be added to your job using tLibraryload or using the "Custom maven uri"/manually adding the jar in Studio.

Best regards

Sabrina

 

himanshup
Contributor II
Contributor II
Author

Hi Sabrina,

Thanks for the recommendations.
RE:

1. I am using tFTPPut component, and I added Client Parameter : "PubkeyAcceptedKeyTypes"
Value : "ssh-rsa".

However, I am not sure how to add:JSch.setConfig("PubkeyAcceptedKeyTypes", "ssh-rsa," + JSch.getConfig("PubkeyAcceptedKeyTypes"));

2. I added tLibraryload component using jsch-0.1.55.jar; and that one also errored out. However, this time the error is different :

Exception in component tFTPPut_1 (FTP)

com.jcraft.jsch.JSchException: Auth cancel

at com.jcraft.jsch.Session.connect(Session.java:518)

at com.jcraft.jsch.Session.connect(Session.java:183)

at edi_anthology.ftp_1_0.FTP.tFTPPut_1Process(FTP.java:1024)

at edi_anthology.ftp_1_0.FTP.tSetGlobalVar_1Process(FTP.java:1636)

at edi_anthology.ftp_1_0.FTP.runJobInTOS(FTP.java:2384)

at edi_anthology.ftp_1_0.FTP.main(FTP.java:1921)

[FATAL] 08:44:43 edi_anthology.ftp_1_0.FTP- tFTPPut_1 Auth cancel

com.jcraft.jsch.JSchException: Auth cancel

at com.jcraft.jsch.Session.connect(Session.java:518) ~[jsch-0.1.55.jar:?]

at com.jcraft.jsch.Session.connect(Session.java:183) ~[jsch-0.1.55.jar:?]

at edi_anthology.ftp_1_0.FTP.tFTPPut_1Process(FTP.java:1024) [classes/:?]

at edi_anthology.ftp_1_0.FTP.tSetGlobalVar_1Process(FTP.java:1636) [classes/:?]

at edi_anthology.ftp_1_0.FTP.runJobInTOS(FTP.java:2384) [classes/:?]

at edi_anthology.ftp_1_0.FTP.main(FTP.java:1921) [classes/:?]

[statistics] disconnected

 

Job FTP ended at 08:44 05/08/2024. [Exit code = 1]

 

Thanks again.

 

Xiaodi_Shi
Support
Support

Hello,

The "Config client" option is available in tFTPConnection component which is used to set JSch encryption algorithm properties.

Please use tFTPConnection-->onsubjobok-->tFTPPut to put files onto an FTP server.

Best regards

Sabrina

 

himanshup
Contributor II
Contributor II
Author

Thanks Sabrina,

Where do I use:
JSch.setConfig("PubkeyAcceptedKeyTypes", "ssh-rsa," + JSch.getConfig("PubkeyAcceptedKeyTypes"));

Also,

I added tFTPConnection component with Client Parameter : "PubkeyAcceptedKeyTypes"
Value : "ssh-rsa".;
Then tFTPConnection-->onsubjobok-->tFTPPut.
Added bouncy castle and jsch-0.1.55.jar in tLibraryLoad component for each; I get this INFO/Exception messages with Exit Code = 1:

Starting job FTP at 10:20 08/08/2024.

[INFO ] 10:20:26 edi_anthology.ftp_1_0.FTP- Project name: EDI_ANTHOLOGY
Job name: FTP GIT Commit ID: 67110b72734c5c4de41d892c771ccb7cc2adccc4

Talend Version: 8.0.1.20240524_0800-patch

[INFO ] 10:20:26 edi_anthology.ftp_1_0.FTP- TalendJob: 'FTP' - Start.

[INFO ] 10:20:26 edi_anthology.ftp_1_0.FTP- TalendJob: 'FTP' - Started.

[statistics] connecting to socket on port 3513

[statistics] connected

[INFO ] 10:20:26 edi_anthology.ftp_1_0.FTP- tFTPConnection_1 - SFTP authentication using a public key.

[INFO ] 10:20:27 edi_anthology.ftp_1_0.FTP- tFTPConnection_1 - Attempt to connect to 'ftp.campuslabs.com' with username 'unr'.

Exception in component tFTPConnection_1 (FTP)

com.jcraft.jsch.JSchException: Auth cancel

at com.jcraft.jsch.Session.connect(Session.java:518)

at edi_anthology.ftp_1_0.FTP.tFTPConnection_1Process(FTP.java:1004)

at edi_anthology.ftp_1_0.FTP.tSetGlobalVar_1Process(FTP.java:1999)

at edi_anthology.ftp_1_0.FTP.runJobInTOS(FTP.java:2759)

at edi_anthology.ftp_1_0.FTP.main(FTP.java:2284)

[FATAL] 10:20:28 edi_anthology.ftp_1_0.FTP- tFTPConnection_1 Auth cancel

com.jcraft.jsch.JSchException: Auth cancel

at com.jcraft.jsch.Session.connect(Session.java:518) ~[jsch-0.1.55.jar:?]

at edi_anthology.ftp_1_0.FTP.tFTPConnection_1Process(FTP.java:1004) [classes/:?]

at edi_anthology.ftp_1_0.FTP.tSetGlobalVar_1Process(FTP.java:1999) [classes/:?]

at edi_anthology.ftp_1_0.FTP.runJobInTOS(FTP.java:2759) [classes/:?]

at edi_anthology.ftp_1_0.FTP.main(FTP.java:2284) [classes/:?]

[statistics] disconnected

[INFO ] 10:20:28 edi_anthology.ftp_1_0.FTP- TalendJob: 'FTP' - Finished - status: failure returnCode: 1

 

Job FTP ended at 10:20 08/08/2024. [Exit code = 1]

 

Xiaodi_Shi
Support
Support

Hello,

Please try adding the parameter under tFTPConnection > Advanced settings > Config client > Client parameter:

SFTP_Workaround.PNG


Here is a related official article about:

https://community.qlik.com/t5/Official-Support-Articles/Talend-Studio-Expanding-your-SFTP-security-a...

Best regards

Sabrina