Ant fails on Slave Jenkins on Mac - macos

I am getting this error:-
Cannot run program "ant" (in directory "/Users/test/~/.jenkins/~/.jenkins/workspace/"): error=2, No such file or directory.
As you can see that directory path is somehow messed up. I dont have idea where to fix it. I am new to jenkins so plz try to be descriptive.
I have slave jenkins in mac under user:- test/.jenkins

Related

jenkins pipeline no permission to run a tool from system32 folder

I'm running jenkins pipeline on a slave computer (slave run from agent command line - user with full admin privileges).
when trying to run a tool from system32 folder, it failes: The system cannot find the path specified.
if I copy the tool to c:\myfolder, it succeeds.
I've also tried to run msbuild - fails on post build regsvr32. but, when running the same command via computer's command line (not jenkins), it succeeds.
It looks like I have a problem with permissions but I do not know what is wrong. jenkins is running via command line with a user that have administrator permissions.
any ideas?

Jenkins Blue Ocean ./gradlew: No such file or directory

I am having trouble getting Blue Ocean to recognize where my default gradle folder is on my Mac OSX. I have GRADLE_HOME set to /opt/gradle.
I keep getting the following error message when running my shell script ./gradlew assembleDebug:
/Users/me/.jenkins/workspace/project#tmp/durable-d97717dc/script.sh:
line 2: ./gradlew: No such file or directory
script returned exit code 1
I could see two reasons for that error:
Your script is not executed in the folder where your gradlew lays.
The gradlew has not set the correct permissions set for the calling user.
Adding a check for existing and the correct permissions on the file to execute could help you to sort these problems out.

Error in Maven goal inside Jenkins on Docker in Windows

I am trying to setup jenkins on docker in my windows machine. Everything was going smooth until I configured the maven goal in Jenkins. It looks like maven is overlooking the Jenkins_home path configured while starting the docker. I used the following command during startup
docker run -p 8080:8080 -p 50000:50000 -v //D/jenkins:/var/jenkins_home Jenkins
I also tried the following
docker run -p 8080:8080 -p 50000:50000 -v jenkins_home://D/jenkins_workspace jenkins
but I keep getting the error
[crazywebapp_dev] $ mvn clean install
FATAL: command execution failed java.io.IOException: error=2, No such
file or directory at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(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 "mvn" (in directory
"/var/jenkins_home/workspace/crazywebapp_dev"): error=2, No such file
or directory at
java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at
hudson.Proc$LocalProc.(Proc.java:249)
I believe it has got to do something with maven because the Jenkins workspace is getting created in my D: drive and the code is checked out successfully from bit bucket and the workspace contents shows up in Jenkins. I have also noticed that even though the workspace is created in my D: drive, Jenkins_home still shows up as /var/Jenkins_home in the Jenkins config page. Please help me figure this out.
I have also noticed that even though the workspace is created in my
D: drive, Jenkins_home still shows up as /var/Jenkins_home in the
Jenkins config page. Please help me figure this out.
From the containers perspective, there is no D: drive, the jenkins_home will always be /var/jenkins_home inside the container.
The syntax -v //D/jenkins:/var/jenkins_home means mount D:\jenkins onto /var/jenkins_home inside the container. This will effectively just replace or backup the containers jenkins home in the jenkins folder.
The syntax -v jenkins_home://D/jenkins_workspace is not useful. It means "create" a /D/jenkins_workspace directory inside the container and use a named volume called jenkins_home to backup this folder. This is not useful.
The main problem that you have, is that maven is not installed inside the jenkins container. Thus jenkins clearly can't find it. You need to configure maven to be installed. You can do that in jenkins, by going to:
Manage Jenkins > Configure System > Maven section and then configure it to install maven automatically.

NiFi Build Errors

I'm trying to build Apache NiFi after cloning it from https://github.com/apache/nifi and it keeps failing on the tests on the nifi-standard-processors project. I opened up the output file in the surefire-reports directory and there's the below error that it can't run program "cmd" in directory /var/test, because no such file or directory exists. The first time I ran the install it didn't exist, but I created it and I still get the error message. I do a sanity check every time to make sure the directory still does exist. Does anyone have any idea what might be causing this issue? I'm only taking a very few steps to do this. They are posted below. I'm logged on as root on a CentOS Linux VM. Thanks in advance for any help.
Steps:
cd /tmp
git clone https://github.com/apache/nifi
cd nifi
mvn clean install
[main] ERROR org.apache.nifi.processors.standard.ExecuteProcess - ExecuteProcess[id=a8d6b3a3-befa-4b74-a962-330bd021ec7b] Failed to create process due to java.io.IOException: Cannot run program "cmd" (in directory "/var/test"): error=2, No such file or directory: java.io.IOException: Cannot run program "cmd" (in directory "/var/test"): error=2, No such file or directory
I believe this is due to a recent commit "solving" this ticket[1]. I actually already reopened[2] it due to failures on TravisCI and the contributor is currently working on a fix.
In order to build now, you can tell maven to "skip tests" by running the command with the proper flag: mvn clean install -Dmaven.test.skip=true
[1] https://issues.apache.org/jira/browse/NIFI-2905
[2] https://issues.apache.org/jira/browse/NIFI-2905?focusedCommentId=15603258&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15603258

Jenkins MSBuild plugin not working with cygwin on windows slave

I am trying to run msbuild on a slave with cygwin (the master is ubuntu)
I am getting the following error:
FATAL: /cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe doesn't exist
The file does exist in the said location. (and I was case sensitive)
I have also installed the "cygpath" jenkins plugin, but I am still getting the same error
I also changed the path to C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
but getting the same error (but with relevant path)
It seems that :
c:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\MSBuild.exe
does the trick

Resources