jfrog / jenkins-jfrog-plugin

Easy integration between Jenkins and the JFrog Platform.
https://github.com/jfrog/jenkins-jfrog-plugin
Apache License 2.0
39 stars 17 forks source link

Tool install via zip download fails #25

Closed amandel closed 1 year ago

amandel commented 1 year ago

Describe the bug

To workaround #23 #24 I've placed a zip archive of the needed jf tool to a local server. Installing it on a linux build agent fails with:

java.nio.file.AccessDeniedException: /export/build/jenkins-localfs/tools/io.jenkins.plugins.jfrog.JfrogInstallation

after creating the directory manually on the build agent the install works as expected:

root@agent:/export/build/jenkins-slave/tools# mkdir -p /export/build/jenkins-localfs/tools/io.jenkins.plugins.jfrog.JfrogInstallation
root@agent:/export/build/jenkins-slave/tools# chown jenkins:jenkins /export/build/jenkins-localfs/tool/io.jenkins.plugins.jfrog.JfrogInstallation

Current behavior

Installation of the cli fails.

Reproduction steps

No response

Expected behavior

No response

JFrog plugin version

1.0.5

JFrog CLI version

2.34.1

Operating system type and version

Ubuntu 22.04.1 LTS (build agent)

JFrog Artifactory version

No response

JFrog Xray version

No response

yahavi commented 1 year ago

Hi @amandel, Thanks for reporting this issue. We really appreciate your valuable feedback on this plugin.

Did it work for you without the chown command? It looks like a permissions issue and I'm not sure the plugin can resolve it. If the "tools" directory belongs to the root and the Jenkins' agent user belongs to the "jenkins" user, I'm not sure it is possible to change it from within the plugin.

I deleted the "tools" directory in my machine and downloaded a zip containing the JFrog CLI and the issue wasn't reproduced. Please let us know if you still think there is an issue here.

amandel commented 1 year ago

Hi @yahavi, thanks for looking into this. Today I can not reproduce it and the directory is created as expected. Not sure how this happened last time, I should have checked file permissions right away. So this one can be closed.