SFTP - JSchException: Algorithm negotiation fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 05:23 AM - edited 08-30-2023 05:25 AM
When I tried to read the SFTP (CSV file) in Databricks I'm getting the below error
"JSchException: Algorithm negotiation fail"
Code:
var df = spark.read
.options(Map("header"->"true",
"host"->"20.118.190.30",
"username"->"user",
"password"->"pass",
"fileFormat"->"csv",
"dfsTempPath"-> "/ftp/tmp/",
"sep"->",",
"treatEmptyValuesAsNulls"->"false")).sftp("/home/user/sftp_test/sample_csv.csv");
Databricks Version: 12.2 LTS
Apache Spark : 3.3.2
Scala : 2.12
Library installed:
com.github.arcizon:spark-filetransfer_2.12:0.3.0
com.jcraft:jsch:0.1.55
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 02:56 PM
@MonishKumar Could you provide the entire exception ?
From the one line error message, I suspect this is due to the SSL cipher suites required by the SFTP server is not available on cluster.
You can run below to get the cipher suites that sftp required:
%sh
sudo apt-get -y install nmap
nmap --script ssl-enum-ciphers -p 22 20.118.190.31