iGlow / Blog / JSchException: Auth fail

SAP CPI error

com.jcraft.jsch.JSchException: Auth fail in SAP CPI

Short answer: This error means the SFTP server refused the login from SAP CPI. It usually happens when the user name, the password or key, or the authentication method in the SFTP channel does not match what the server accepts. To fix it, check these with the server team and run the SSH connectivity test.

The problem

A scheduled SFTP poll fails and the log says only "Auth fail". It does not say whether the user, the password, the key or the login method is wrong, and the server team cannot see the problem from their side. You go back and forth on key types and settings with no clear answer.

What does JSchException: Auth fail mean?

JSchException: Auth fail comes from JSch, the Java SSH library inside the CPI SFTP adapter. The connection to the server worked, and the server's host key was accepted. Then the login step failed. SAP covers the message in KBA 2122397.

Full text in the log: com.jcraft.jsch.JSchException: Auth fail

Why does it happen?

The most common cause comes first.

How do I fix JSchException: Auth fail in SAP CPI?

  1. Check the user name and the Authentication setting in the SFTP channel.
  2. For key login, confirm the server holds the public part of the key pair you deployed.
  3. Ask the server team which login methods and key algorithms the server accepts.
  4. Run Manage Security > Connectivity Tests > SSH to test the login. Fix what it reports, then resend.

How do I confirm it is fixed?

The SSH test succeeds, and the next SFTP poll or send finishes without the exception.

Which adapter or step causes it?

The SFTP sender and receiver adapters.

Tips to avoid it next time

Ask the server team for the exact login method before you build the channel. Keep the private key alias and the user name in your notes. When a server is upgraded, its allowed key types can change, so a login that worked for years can start to fail. If the error says the file or folder is missing instead, you have a different problem: see No such file or directory. You can also trace the message to see the exact step that failed.

See all ten in the 10 most common SAP CPI errors and how to fix each for SAP Cloud Integration (SAP Integration Suite).

The easy way: fix JSchException Auth fail with iGlow

iGlow is an AI agent for SAP Integration Suite and CPI that runs as a Chrome extension side panel. The hunt above is what the Fix button does for you.

  1. Open the panel. The failed message is listed with a Fix button.
  2. Click Fix. iGlow reads the error and the SFTP step and explains that the server refused the login.
  3. Follow the next steps: what to confirm with the server team, such as the user, the login method and the key algorithm, and the SSH connectivity test to run. iGlow does not set real passwords or keys for you.
iGlow panel chat for the demo iFlow Orders_Blog_Demo with a card of 2 failed messages, each with its time, the label Fails until fixed, the start of the HttpResponseException error text and a Fix button
Failed messages in the iGlow panel: time, error text, a hint that the message fails until fixed, and a Fix button. (This example shows a different error.)
The Fix flow, shown on another error (a null amount in a Groovy mapping script in the demo iFlow Invoice_S4_to_Ariba): click Fix, read the cause, review the patch. In the clip the patch is rejected, so nothing changes. For an SFTP login error, iGlow gives next steps and does not change credentials or keys.

Nothing is saved or deployed without your click, and tenants tagged PRD are never changed. See the Fix failed messages guide. Add iGlow to Chrome.

Questions

What does com.jcraft.jsch.JSchException: Auth fail mean?

The SFTP server refused the login. The connection was made, but the user, password, key or method was not accepted.

How do I fix JSchException: Auth fail in SAP CPI?

Check user name and authentication in the SFTP channel, make sure the server has the matching public key, and run the SSH connectivity test.

Which adapter or step causes JSchException: Auth fail?

The SFTP adapter, in a sender or receiver channel.

More from the blog and guides