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
version 1.0.17: first call of OpenShiftDSL function, e.g. raw or process, fails with java.io.IOException: Cannot run program "oc" #180
Comments
@TomSchmitz Does your Jenkins instance have the |
hello @gomesp, our jenkins instance is running on OS RHEL 6. We have several oc CLIs installed and configured via the jenkins-client-plugin, see attached file. We don't set the oc CLI in the PATH explicity. We just switch to version 1.0.16 again and it is running successfully without configuring anything special for the oc CLIs. |
@gomesp We saw a similar issue when upgrading from 1.0.13 to 1.0.17. We configured Jenkins with multiple version of OC and we use code like the following to update the PATH environment variable:
` |
@gomesp , in order to confirm @fshehadeh's post, we are using a similar code to define oc tool and PATH: steps.withEnv(["PATH+OC=${ocDir}"]) { //do something with OpenShiftDSL } |
I have the same issue. |
It is not quite ready yet, but I believe I have a path to get the envs, including a PATH+OC, with the new form of process launching. I'll update again tomorrow after a few more cycles or work. |
@gabemontero I haven't taken a look yet, but I think I missed the part of locating Do you have any findings? Will you fix it or I will do the fix? |
I can confirm this issue too. I used the following script for my test:
It generated the following output:
It looks like the modified PATH variable is not passed to the plugin? |
@elbaer Yes, the modified environment variable given in withEnv is not handed in the new process launching mechanism. |
I'm close to having a fix @vfreex but I'm going to tag you in the PR for review, to cross reference with the prior situations you were trying to address. Hopefully the common workarounds I've found to properly set up ProcessBuilder to not interfere with your prior fix. |
I have a PR up that fixes my reproducer |
v1.0.18 of the plugin has been initiated with the jenkins update center |
I see the issue with v1.0.24 on jenkins 2.163. I havn't tried on earlier versions. It looks like the PATH is not passed to the plugin. oc is installed under /home/jenkins/openshift-origin-client-tools.
gives the following output:
|
I see that the issue I describe here is the same as #224. Sorry for not noticing that issue! |
Hello,
after updating jenkins-client-plugin version from 1.0.16 to 1.0.17 any OpenShiftDSL function will fail with a java.io.IOException: Cannot run program "oc" (in directory ...): error=2, No such file or directory.
Calling withCluster() and withProject() works just fine, but any other OpenShiftDSL function, e.g. raw or process, will fail.
You can find the full stacktrace in the attached text file.
If you need any further info, let me know.
Thank you for your help.
Tom
stacktraceIOException.txt
The text was updated successfully, but these errors were encountered: