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

On jenkins restart, Jfrog Plugin/artifactory integration throws "Server id 'null' doesn't exists" #38

Open
jhennafc opened this issue Sep 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jhennafc
Copy link

jhennafc commented Sep 5, 2024

Describe the bug

I'm using the Jfrog plugin to automatically install the cli from artifactory. I am testing the jrog tools cli install in a freestyle pipeline.

On a Jenkins restart, the pipeline does not recognize the artifactory server, and I will need to manually go to
Manage Jenkins -> Tools -> JFrog CLI installations and hit Apply.

Current behavior

This is my test pipeline:

pipeline
{
    agent any
    tools 
   {
        jfrog 'public-jfrog-cli'
    }
    stages 
   {
        stage ('Testing') 
       {
            steps 
            {
                jf "-v"
            }
        } 
    }
}

This is the error thrown if I restart Jenkins and build that pipeline straightaway:

Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 97b07401-d789-4554-9de6-d8f0e0a8cd04
java.io.IOException: Server id 'null' doesn't exists.
	at io.jenkins.plugins.jfrog.ArtifactoryInstaller.performInstallation(ArtifactoryInstaller.java:56)
	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:221)
	at io.jenkins.plugins.jfrog.JfrogInstallation.forNode(JfrogInstallation.java:50)
	at io.jenkins.plugins.jfrog.JfrogInstallation.forNode(JfrogInstallation.java:32)
	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:157)
	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:138)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
/data/jenkins/workspace/jfrogtest@tmp/jfrog/1/.jfrog deleted
Finished: FAILURE

image
image

Reproduction steps

  • Configure Manage Jenkins -> System -> JFrog Plugin Configuration
    • for Credentials, I use a Vault Secret Text Credential via Access Token
  • Configure Manage Jenkins -> Tools -> JFrog CLI installations
  • Create a Freestyle Pipeline
  • Restart Jenkins
  • Run Freestyle Pipeline

Expected behavior

On a Jenkins restart, artifactory server should be set automatically.

JFrog plugin version

1.5.1

JFrog CLI version

v2-jf/2.8.0/jfrog-cli-windows-amd64/jf.exe

Operating system type and version

Linux - 5.4.0-150-generic

JFrog Artifactory version

No response

JFrog Xray version

No response

@jhennafc jhennafc added the bug Something isn't working label Sep 5, 2024
@yahavi
Copy link
Collaborator

yahavi commented Oct 11, 2024

@jhennafc
Thank you for using the Jenkins JFrog plugin!
We were unable to reproduce the issue with version 1.5.4. Could you please confirm if it still occurs in the latest version?

@rams29
Copy link

rams29 commented Oct 24, 2024

Hi, im running into the same exact issue.

Jenkins - [CloudBees CI Managed Controller 2.401.1.3]
JFrog Plugin Version - 1.4.0

Error:

[Pipeline] End of Pipeline
java.io.IOException: Server id 'null' doesn't exists.
at io.jenkins.plugins.jfrog.ArtifactoryInstaller.performInstallation(ArtifactoryInstaller.java:64)
at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:221)
at io.jenkins.plugins.jfrog.JfrogInstallation.forNode(JfrogInstallation.java:50)
at io.jenkins.plugins.jfrog.JfrogInstallation.forNode(JfrogInstallation.java:32)
at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:157)
at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:138)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
/var/jenkins_home/jobs/TEST/workspace/jfrogcli@tmp/jfrog/6/.jfrog deleted
Finished: FAILURE

@rams29
Copy link

rams29 commented Oct 25, 2024

I was able to resolve it by adding a new remote-repo in our artifactory instance called "jfrog-cli-remote" and then reference it in the Jenkins tools configuration pointing to https://releases.jfrog.io/artifactory/jfrog-cli

Image

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

3 participants