Croway opened a new pull request, #30167: URL: https://github.com/apache/camel/pull/30167
JIRA: [CAMEL-27019](https://issues.apache.org/jira/browse/CAMEL-27019) - With a wrong password, the sftp consumer sent the password up to 18 times per poll: JSch asks for it again after each rejection, up to its `MaxAuthTries` (6) per connection, Camel's `UserInfo` gave it each time, and `SftpOperations.connect` opened up to `maximumReconnectAttempts` (3) connections also after a rejected login. With `autoCreate=true` the start-up connect added 18 more. On a server with a lockout policy this locks the account. - `SftpOperations`: the `UserInfo` gives the password once per session, with the `password` or the `keyboard-interactive` method. When the server asks again, it throws, so JSch ends the session (`Auth fail for user '...': the server did not accept the password`). A keyboard-interactive request without prompts does not count as a password answer. - `SftpOperations.tryConnect`: a rejected login (that exception, or JSch's `Auth fail ...` / `Auth cancel ...`) ends the reconnect attempts. Other connection failures are still retried `maximumReconnectAttempts` times. - `RemoteFileConsumer`: the `Cannot connect/login to: ...` WARN now gives the reason (`due to: <message of the cause>`). This WARN is shared, so it also changes for ftp, ftps and mina-sftp. - Docs: the "Connection errors" section of the sftp page (and its catalog copy). Tests: `SftpConsumerWrongPasswordIT` (new). Before the fix, the server counts `[18, 36]` passwords after polls 1 and 2 (password and keyboard-interactive methods), and 36 after the first poll with `autoCreate`. The WARN has no reason. After the fix the counts are `[1, 2]` and 2, and the WARN gives the reason. Controls that pass before and after: the right password logs in once with either method, and a connection the server closes is still retried 3 times per poll. Upgrade guide: entry in `camel-4x-upgrade-guide-4_24.adoc` (camel-ftp - sftp sends the password once per connection, and does not retry a rejected login). _Claude Code on behalf of Federico Mariani_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
