Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JFROG_CLI_RELEASES_REPO doesn't work on private Artifactory #2231

Closed
usinelogicielle opened this issue Oct 2, 2023 · 9 comments
Closed

JFROG_CLI_RELEASES_REPO doesn't work on private Artifactory #2231

usinelogicielle opened this issue Oct 2, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@usinelogicielle
Copy link

Describe the bug

Configuring the new environment variable JFROG_CLI_RELEASES_REPO,
and trying using "jfrog mvn".
Jfrog can't download the build-info-extractor-maven3 jar because the URL is wrong.
It seems Jfrog add repo name from JFROG Artifactory.

Current behavior

export JFROG_CLI_RELEASES_REPO="token_artifactory_serverid/jfrogcli-maven-remote"

jfrogcli-maven-remote is the name of our remote repository pointing to "https://oss.jfrog.org/artifactory/oss-release-local"

$jfrog mvn-config --server-id-deploy token_artifactory_serverid --repo-deploy-snapshots testci-maven-dev --repo-deploy-releases testci-maven --server-id-resolve token_artifactory_serverid --repo-resolve-releases testci-maven --repo-resolve-snapshots testci-maven-dev

$jfrog mvn clean install -B -Dartifactory.publish.artifacts=false
14:58:37 [Debug] JFrog CLI version: 2.48.0
14:58:37 [Debug] OS/Arch: linux/amd64
14:58:39 [Debug] failed while trying to check latest JFrog CLI version: couldn't get latest JFrog CLI latest version info from GitHub API: Get "https://api.github.com/repos/jfrog/jfrog-cli/releases/latest": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
14:58:39 [Debug] Saving build general details at: /home/ad/<username>/.jfrog/builds/43f7e3bd69def55d0da30b88b42048bf646b4d44e94b9d88410956223da85394/partials
14:58:39 [Debug] Usage Report: Sending info...
14:58:39 [🔵Info] Downloading JFrog's Dependency from https://<ARTIFACTORY_HOST>/artifactory/jfrogcli-maven-remote/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.41.5/build-info-extractor-maven3-2.41.5-uber.jar
14:58:39 [Debug] Sending HTTP GET request to: https://<ARTIFACTORY_HOST>/artifactory/api/system/version
14:58:39 [Debug] Sending HTTP HEAD request to: https://<ARTIFACTORY_HOST>/artifactory/jfrogcli-maven-remote/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.41.5/build-info-extractor-maven3-2.41.5-uber.jar
14:58:39 [Debug] Artifactory response: 200
14:58:39 [Debug] JFrog Artifactory version is: 7.55.3
14:58:39 [Debug] Sending HTTP POST request to: https://<ARTIFACTORY_HOST>/artifactory/api/system/usage
14:58:40 [🟠Warn] Failed to get remote file details.
 Got: server response: 404
14:58:40 [Debug] Sending HTTP GET request to: https://<ARTIFACTORY_HOST>/artifactory/jfrogcli-maven-remote/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.41.5/build-info-extractor-maven3-2.41.5-uber.jar
14:58:40 [🚨Error] server response: 404

The URL to download the jar is wrong

https://<ARTIFACTORY_HOST>/artifactory/jfrogcli-maven-remote/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.41.5/build-info-extractor-maven3-2.41.5-uber.jar => https://<ARTIFACTORY_HOST>/artifactory/jfrogcli-maven-remote/org/jfrog/buildinfo/build-info-extractor-maven3/2.41.5/build-info-extractor-maven3-2.41.5-uber.jar

Reproduction steps

Already explained in Current behavior

Expected behavior

Construct the good URL of personnal remote repository

JFrog CLI version

2.48.0

Operating system type and version

OS/Arch: linux/amd64

JFrog Artifactory version

7.55.3 rev

JFrog Xray version

3.62.4

@usinelogicielle usinelogicielle added the bug Something isn't working label Oct 2, 2023
@evil-of-blad
Copy link

I also found the same problem,I am trying to lower the jf-cli version.

@usinelogicielle
Copy link
Author

Hello, any update ? This problem is blocking us.

@biernatt
Copy link

same problem here, tested on jfrog-cli-2.52.2.x86_64.rpm

@eyalbe4
Copy link
Contributor

eyalbe4 commented Dec 15, 2023

All,
Let us share an update here soon.

@eranturgeman
Copy link
Contributor

eranturgeman commented Dec 17, 2023

Hello @usinelogicielle, @evil-of-blad and @biernatt , thank you for reaching out!

The information regarding the jfrogcli-maven-remote repository pointing to 'https://oss.jfrog.org/artifactory/oss-release-local' is based on a legacy setup. Our current methodology employs a different approach.

By utilizing the 'jf options' command, you'll notice that the required configuration for JFROG_CLI_RELEASES_REPO is to proxy to 'https://releases.jfrog.io', not 'https://oss.jfrog.org/artifactory/oss-release-local'.

Screenshot 2023-12-17 at 10 51 26

The 'https://releases.jfrog.io' serves as a proxy from where all necessary resources for our workflows can be downloaded seamlessly. When supplying the server ID (token_artifactory_serverid) and setting JFROG_CLI_RELEASES_REPO to 'https://releases.jfrog.io', the URL will be automatically constructed as follows:

https://releases.jfrog.io/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.41.5/build-info-extractor-maven3-2.41.5-uber.jar

Which is the correct URL for the requested resource.

We trust this solution resolves the issue you've encountered. If you have any further questions or if the solution didn't fix your problem, please don't hesitate to let us know.

@usinelogicielle
Copy link
Author

Hi @eranturgeman,

I understand the change. But the variable documentation would have to be modified. It says that JFROG_CLI_RELEASES_REPO corresponds to a repository. And not to an Artifactory server.
We have our own instance of Artifactory, so we need to tell our users to change this variable with our server.
And to create an oss-release-local repository in our instance, which is a remote from https://releases.jfrog.io/artifactory/oss-release-local.

I think this would work, but it distorts the naming convention to have a repository named "local" when it's a remote.

@biernatt
Copy link

We resolve the case by adding proxy repo to Jfrog oss-release-local in our Antifactory

@chkp-roniz
Copy link

We had this issue as well...

We did proxy https://releases.jfrog.io/artifactory/oss-release-local, and got the 404 failure

After adding a proxy to https://releases.jfrog.io, the issue was resolved

@eyalbe4 eyalbe4 closed this as completed Feb 28, 2024
@KRiusd
Copy link

KRiusd commented Dec 19, 2024

This solution sounds more linke a workaround as it takes all flexability structuring and naming the source repository.

I would favour setting up any mvn repository pointing to https://releases.jfrog.io/artifactory/oss-release-local and the cli not to add "artifactory/oss-release-local" to the request.

Example:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants