Error while trying to run "source" command

45 views
Skip to first unread message

Jibsan Joel Rosa Toirac

unread,
Nov 23, 2020, 1:54:23 PM11/23/20
to Jenkins Users

Hello every one, I'm trying o build a .war file using Grails. For this I already Installed Grails on my Jenkins Node and on the way I did it, before start using Grails commands form build the War, I have to set the source of the Grails Commands. I have to do:

$ source "$HOME/.sdkman/bin/sdkman-init.sh"

If I run this as "root" or even "jenkins" user, it work perfectely but on the Job I set it in a "Shell" and I got the following error.

Running as SYSTEM Building in workspace /var/lib/jenkins/workspace/Build and Deploy Integro Cloud [Build and Deploy Integro Cloud] $ /usr/local/bin -xe /tmp/jenkins762672155125796765.sh FATAL: command execution failed java.io.IOException: error=13, Permission denied at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) Caused: java.io.IOException: Cannot run program "/usr/local/bin" (in directory "/var/lib/jenkins/workspace/Build and Deploy Integro Cloud"): error=13, Permission denied at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at hudson.Proc$LocalProc.<init>(Proc.java:250) at hudson.Proc$LocalProc.<init>(Proc.java:219) at hudson.Launcher$LocalLauncher.launch(Launcher.java:937) at hudson.Launcher$ProcStarter.start(Launcher.java:455) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1853) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:427) Build step 'Execute shell' marked build as failure Finished: FAILURE

Please any help will be well received.

Greetings,

Eng. Jibsan

zil...@gmail.com

unread,
Nov 25, 2020, 9:42:48 AM11/25/20
to Jenkins Users
Have you tried

$ sudo source "$HOME/.sdkman/bin/sdkman-init.sh"


Jibsan Joel Rosa Toirac

unread,
Nov 25, 2020, 10:02:13 AM11/25/20
to jenkins...@googlegroups.com
Yes brother but it accept the command but do nothing

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a1d32df4-bca2-4c52-aa65-631d53e8347cn%40googlegroups.com.

zil...@gmail.com

unread,
Nov 25, 2020, 10:09:52 AM11/25/20
to Jenkins Users
I don't know what your script does, but a war file expects files in certain directories. Put a pwd statement right before you run the script to ensure it's where you expect it to run. If not cd to that directory. Example

$ pwd
$ cd $WORKSPACE
$ sudo source "$HOME/.sdkman/bin/sdkman-init.sh"

Slide

unread,
Nov 25, 2020, 10:20:59 AM11/25/20
to Jenkins User Mailing List
You may also want to verify that the HOME environment variable is set, it may not be set the way that the jenkins agent is run.



--
Reply all
Reply to author
Forward
0 new messages