[
https://jira.codehaus.org/browse/WAGON-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=319792#comment-319792
]
Bryan Kelly commented on WAGON-391:
-----------------------------------
I think the retry logic could be added to AbstractJschWagon.java around line
200, it could look something like the following:
StringWriter stringWriter = new StringWriter();
for (int tries = 0; tries < 10; tries++) {
try {
session.connect();
if (getKnownHostsProvider() != null) {
PrintWriter w = new
PrintWriter(stringWriter);
HostKeyRepository hkr =
sch.getHostKeyRepository();
HostKey[] keys = hkr.getHostKey();
for (int i = 0; keys != null && i <
keys.length; i++) {
HostKey key = keys[i];
w.println(key.getHost() + " " +
key.getType() + " " + key.getKey());
}
}
break;
} catch (JSchException e) {
if (tries < 10) {
continue;
}
if
(e.getMessage().startsWith("UnknownHostKey:") ||
e.getMessage().startsWith("reject HostKey:")) {
throw new UnknownHostException(host, e);
} else if (e.getMessage().indexOf("HostKey has
been changed") >= 0) {
throw new
KnownHostChangedException(host, e);
} else {
throw new
AuthenticationException("Cannot connect. Reason: " + e.getMessage(), e);
}
}
}
> Error installing artifact's metadata: Error while deploying metadata:
> Authentication failed: Cannot connect. Reason: verify: false
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: WAGON-391
> URL: https://jira.codehaus.org/browse/WAGON-391
> Project: Maven Wagon
> Issue Type: Bug
> Components: wagon-ssh
> Affects Versions: 2.3
> Reporter: Bryan Kelly
>
> When attempting to publish an artifact to an ssh server we get the following
> exception intermittently:
> Error installing artifact's metadata: Error while deploying metadata:
> Authentication failed: Cannot connect. Reason: verify: false
> Other consumers of the jsch library have had a similar issue [1], their fix
> was to add retry logic while attempting to make the connection to the ssh
> server.
> [1] https://github.com/int128/gradle-ssh-plugin/issues/11
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira