From b4b77d283570135180e4bfd0f93ffef00c37a281 Mon Sep 17 00:00:00 2001 From: Assaf Attias <49212512+attiasas@users.noreply.github.com> Date: Sun, 26 Mar 2023 17:00:23 +0300 Subject: [PATCH] Transfer - If plugin not install log information (#720) --- artifactory/commands/transferfiles/transfer.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/artifactory/commands/transferfiles/transfer.go b/artifactory/commands/transferfiles/transfer.go index db1f63b9d..59a693a61 100644 --- a/artifactory/commands/transferfiles/transfer.go +++ b/artifactory/commands/transferfiles/transfer.go @@ -695,7 +695,14 @@ func validateDataTransferPluginMinimumVersion(currentVersion string) error { func getAndValidateDataTransferPlugin(srcUpService *srcUserPluginService) error { verifyResponse, err := srcUpService.verifyCompatibilityRequest() if err != nil { - return err + errMsg := err.Error() + reason := "" + if strings.Contains(errMsg, "The execution name '") && strings.Contains(errMsg, "' could not be found") { + start := strings.Index(errMsg, "'") + missingApi := errMsg[start+1 : strings.Index(errMsg[start+1:], "'")+start+1] + reason = fmt.Sprintf(" This is because the '%s' API exposed by the plugin returns a '404 Not Found' response.", missingApi) + } + return fmt.Errorf("%s;\nIt looks like the 'data-transfer' user plugin isn't installed on the source instance.%s Please refer to the documentation available at https://www.jfrog.com/confluence/display/JFROG/Transfer+Artifactory+Configuration+and+Files+to+JFrog+Cloud for installation instructions", errMsg, reason) } err = validateDataTransferPluginMinimumVersion(verifyResponse.Version)