jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
529 stars 225 forks source link

Unable to move files when using a virtual repo #1105

Open testworksau opened 3 years ago

testworksau commented 3 years ago

We have a Virtual repo (let's call it generic-repo) which is hooked up to a local repo (let's call it local-generic-repo) and a number of smart remotes.

Calling the following command using the virtual repo: .\jfrog.exe rt move "generic-repo/some-folder/subfolder-a/" "generic-repo/some-folder/subfolder-b/" --dry-run=true --flat=true

results in output like:

[Info] [Thread 1] [Dry run] [Dry run] Moving artifact: generic-repo/some-folder/subfolder-a/some-file.exe to: generic-repo/some-folder/subfolder-b/some-file.exe

[Error] [Thread 1] [Dry run] Artifactory response: 409 Conflict
{
  "messages": [
    {
      "level": "ERROR",
      "message": "Failed to move from src=generic-repo/some-folder/subfolder-a/some-file.exe to target=generic-repo/some-folder/subfolder-b/some-file.exe: class org.artif
actory.repo.virtual.VirtualRepo cannot be cast to class org.artifactory.repo.LocalRepo (org.artifactory.repo.virtual.VirtualRepo and org.artifactory.repo.LocalRepo are in unnamed module of loader org.apache.catalina.loader.Par
allelWebappClassLoader @2da446d7)"
    }
  ]
}

Using the local repository (local-generic-repo) instead of the virtual repo in the above command works fine.

Expected behavior No exception should be raised.

Versions

stein321 commented 2 years ago

@testworksau if you use the copy command it should work

testworksau commented 2 years ago

Thanks @stein321 - would still be good if this was fixed so that we didn't have to follow the copy with a delete.