[RTFACT-20086] Slow response from with Move API when conan user/channel changes Created: 09/Sep/19  Updated: 10/Sep/19

Status: Open
Project: Artifactory Binary Repository
Component/s: Conan
Affects Version/s: 6.11.3
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Daniel Peacock Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: api, move


 Description   

In RTFACT-14165 support was added to change user/channel of a conan artifact when promoting it via the move API. It isn't behaving as expected, though, with the API never returning a response, and not fully deleting the old package during a move.

For example, performing a move without changing the user/channel works fine, with the HTTP call returning a response in less than half a second:

$ curl -u ******  -sS -X POST /api/move/conan-test/user/package/1.0.0/test?to=/conan-release/user/package/1.0.0/test{{{}}
  "messages" : [ {
    "level" : "INFO",
    "message" : "moving conan-test:user/package/1.0.0/test to conan-release:user/package/1.0.0/test completed successfully, 9 artifacts and 6 folders were moved"
  } ]
}

Afterwords, the new artifact is in the expected location, and the old artifact is gone (although the "/user/package/1.0.0" directory remains, even if empty).

However, attempting a move where the user/channel changes, the API never responds. Eventually the nginx reverse proxy we have in front of artifactory times out after 90 seconds, and returns a 504.

$ curl -u ******  -sS -X POST /api/move/conan-test/user/package/1.0.0/test?to=/conan-release/company/package/1.0.0/release

Afterwords, it appears that artifactory did successfully move the package to the new location, however, it leaves behind two "index.json" files and a ".timestamp" files (along with the directory structure containing them).



 Comments   
Comment by Daniel Peacock [ 09/Sep/19 ]

As an aside, when combined with a few other quirks of the move command, promoting conan artifacts is robustly rather tricky. This is the best I've gotten.

# check if package already exists, otherwise we will copy into directory rather replace
GET /api/storage/${dstRepo}/${dstUser}/${dstPackage}/${dstVersion}/${dstChannel}
if empty:
    DELETE /${dstRepo}/${dstUser}/${dstPackage}/${dstVersion}/${dstChannel}
# Do the move
POST /api/move/${srcRepo}/${srcUser}/${srcPackage}/${srcVersion}/${srcChannel}?to=${dstRepo}/${dstUser}/${dstPackage}/${dstVersion}/${dstChannel}
# Update the artifactory properties used to find the package
PATCH /api/metadata/${dstRepo}/${dstUser}/${dstPackage}/${dstVersion}/${dstChannel} '{"props:{"conan.package.channel":"${dstChannel}","conan.package.user":"${dstUser}"'}}
# Delete the old files left behind
DELETE /${srcRepo}/${srcUser}/${srcPackage}/${srcVersion}/${srcChannel}
GET /api/storage/${srcRepo}/${srcUser}/${srcPackage}/${srcVersion}
if empty:
    DELETE /${srcRepo}/${srcUser}/${srcPackage}/${srcVersion}
    GET /api/storage/${srcRepo}/${srcUser}/${srcPackage}
    if empty:
        DELETE /${srcRepo}/${srcUser}/${srcPackage}
        GET /api/storage/${srcRepo}/${srcUser}
        if empty:
            DELETE /${srcRepo}/${srcUser}{{ }}

Comment by Daniel Peacock [ 10/Sep/19 ]

Okay, I got permissions needed to test behind the reverse proxy. The move API command does respond, it just takes 2 minutes, and then fails with a locking error:

{{{}}
  "messages" : [ {
    "level" : "ERROR",
    "message" : "Failed to move from src=conan-test/user/package/1.0.0/test to target=/conan-release/company/package/1.0.0/release: Lock on LockEntryId conan-release:company/package/1.0.0/release/0/package/4aef0acd9b358b5834258318a9b9a1ea018517a0/index.json not acquired in 120 seconds. Lock info: org.artifactory.storage.fs.lock.provider.JVMLockWrapper@4a87df60."
  } ]
}

 It looks like this is a duplicate of RTFACT-19146

Generated at Wed Feb 19 05:20:15 UTC 2020 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.