diff --git a/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java b/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java index a74998aa63e..95666cf8cf4 100644 --- a/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java +++ b/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java @@ -217,7 +217,7 @@ public class RepositoriesService extends AbstractComponent implements ClusterSta try { repository.endVerification(verificationToken); } catch (Throwable t) { - logger.warn("[{}] failed to finish repository verification", repositoryName, t); + logger.warn("[{}] failed to finish repository verification", t, repositoryName); listener.onFailure(t); return; } @@ -233,7 +233,7 @@ public class RepositoriesService extends AbstractComponent implements ClusterSta try { repository.endVerification(verificationToken); } catch (Throwable t1) { - logger.warn("[{}] failed to finish repository verification", repositoryName, t); + logger.warn("[{}] failed to finish repository verification", t1, repositoryName); } listener.onFailure(t); } diff --git a/core/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java b/core/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java index 11fb1cb3225..35a168428bf 100644 --- a/core/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java +++ b/core/src/main/java/org/elasticsearch/repositories/VerifyNodeRepositoryAction.java @@ -80,6 +80,7 @@ public class VerifyNodeRepositoryAction extends AbstractComponent { try { doVerify(repository, verificationToken); } catch (Throwable t) { + logger.warn("[{}] failed to verify repository", t, repository); errors.add(new VerificationFailure(node.id(), ExceptionsHelper.detailedMessage(t))); } if (counter.decrementAndGet() == 0) { @@ -146,7 +147,12 @@ public class VerifyNodeRepositoryAction extends AbstractComponent { class VerifyNodeRepositoryRequestHandler implements TransportRequestHandler { @Override public void messageReceived(VerifyNodeRepositoryRequest request, TransportChannel channel) throws Exception { - doVerify(request.repository, request.verificationToken); + try { + doVerify(request.repository, request.verificationToken); + } catch (Exception ex) { + logger.warn("[{}] failed to verify repository", ex, request.repository); + throw ex; + } channel.sendResponse(TransportResponse.Empty.INSTANCE); } }