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
530 stars 227 forks source link

In some cases, transitive downloads from smart remote repositories will fail #1608

Open elinafl opened 2 years ago

elinafl commented 2 years ago

Describe the bug The JFrog CLI download command executes an AQL query behind the scenes. When attempting to download a file that is not yet cached from a smart remote repository, the AQL will return 0 results (since remote credentials are required for the AQL to execute a transitive search). Some remote endpoints allow anonymous downloads and do not provide a username and password for authentication. This behavior was observed with a smart remote repository pointing to https://releases.jfrog.io/. Transitive downloads with REST API work as expected and the transitive downloads from a repository pointing to https://releases.jfrog.io/ should be possible as in any other smart remote repository.

To Reproduce

  1. Create a generic remote repository pointing to https://releases.jfrog.io/
  2. Configure the JFrog CLI to work with your Artifactory instance and allow transitive downloads by adding the JFROG_CLI_TRANSITIVE_DOWNLOAD_EXPERIMENTAL=TRUE flag
  3. Try to download a file: jfrog rt dl jfrog-cli/v2/2.0.1/jfrog-cli-linux-386/jfrog
  4. The file will not be downloaded since the AQL is returning 0 results

Expected behavior It should be possible to download the CLI packages using the JFrog CLI, as it is possible via REST API. It should be possible to download from this smart remote repository as any other smart remote repository.

Versions

robinhellmers commented 1 year ago

I see the same behavior. It is possible to use the REST API with cURL, but with the jfrog cli it needs to be cached first and then downloaded from the cache path