Running as SYSTEM
Building in workspace /Users/mac/.jenkins/workspace/trainSchedule
The recommended git tool is: NONE
No credentials specified
git rev-parse --resolve-git-dir /Users/mac/.jenkins/workspace/trainSchedule/.git # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url https://github.com/linuxacademy/cicd-pipeline-train-schedule-jenkins # timeout=10
Fetching upstream changes from https://github.com/linuxacademy/cicd-pipeline-train-schedule-jenkins
git --version # timeout=10
git --version # 'git version 2.30.1 (Apple Git-130)'
git fetch --tags --force --progress -- https://github.com/linuxacademy/cicd-pipeline-train-schedule-jenkins +refs/heads/:refs/remotes/origin/ # timeout=10
git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision 1603f84d1f50794623c71673920fc3111280045f (refs/remotes/origin/master)
git config core.sparsecheckout # timeout=10
git checkout -f 1603f84d1f50794623c71673920fc3111280045f # timeout=10
Commit message: "specify a newer version of node and npm"
First time build. Skipping changelog.
[Gradle] - Launching build.
[trainSchedule] $ /Users/mac/.jenkins/workspace/trainSchedule/gradlew build
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '19'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Archiving artifacts
Finished: FAILURE
Related
I have been using Jenkins for a few days, and before: I used the GITEA plugin
Now that I have switched my projects to GitBucket, I would like to use the "Build by Webhook" Feature.
I followed many tutorials, and now : i'm stuck on a simple/big problem.
In advance, I'm sorry to have to blur the sensitive links, I know it can be annoying.
Here is the full error :
using credential 10
Wiping out workspace first.
Contributing variables:
Cloning the remote Git repository
Cloning repository https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT
> git init /Jenkins/workspace/GitBUcket # timeout=10
Fetching upstream changes from https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT
> git --version # timeout=10
> git --version # 'git version 2.20.1'
using GIT_ASKPASS to set credentials Utilisateur GitBucket Perso
> git fetch --tags --force --progress -- https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://MY_GITBUCKET/git/MY_USERNAME/MY_PROJECT # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
Seen 0 remote branches
> git show-ref --tags -d # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE
Here is my configuration on Jenkins : https://i.stack.imgur.com/jdlTt.png
Thank you very much in advance
EDIT : My only branche is master --> https://i.imgur.com/lXJ0xyN.png
This is what you can try:
Manage Jenkins -> Global Tool Configuration -> Git
Check if Path to Git executable is set: C:\PATH\git.exe
Dashboard -> select your job -> Configure -> Source Code Management -> select Git
Insert your Repository URL and Credentials(Optional) then under Branches to build change */master to */main.
I put "make" in Jenkins's Execute Shell, following the tutorial here https://github.com/jbankes/Hello_Jenkins, but Jenkins does not run the make from the underlying Github repository, as shown in the error message below.
What is the right way to demand Jenkins to run "make" from its monitored GitHub repository?
Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/test003
The recommended git tool is: NONE
No credentials specified
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/zhoulaifu/Hello_Jenkins # timeout=10
Fetching upstream changes from https://github.com/zhoulaifu/Hello_Jenkins
> git --version # timeout=10
> git --version # 'git version 2.20.1'
> git fetch --tags --force --progress -- https://github.com/zhoulaifu/Hello_Jenkins +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision bc3931a313e4f3945c257ae3247e63265b1debb7 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f bc3931a313e4f3945c257ae3247e63265b1debb7 # timeout=10
Commit message: "Otherside (#5)"
> git rev-list --no-walk bc3931a313e4f3945c257ae3247e63265b1debb7 # timeout=10
[test003] $ /bin/sh -xe /tmp/jenkins2704537311990415428.sh
+ make
make: *** No targets specified and no makefile found. Stop.
Build step 'Execute shell' marked build as failure
Finished: FAILURE
In the repository Make file located inside original folder. So to be able to run Make you need navigate to it.
After git clone execute cd original/ and then run Make.
After job build starts in jenkins my git-lab server's memory becomes full. Job is successful after restarting the Jenkins server.Jenkins has become too slow Sometimes Error comes with signal 9 also. Thank-you in advance. I have attached the log of the failed build.
started by user ME
Building in workspace /var/lib/jenkins/workspace/my_Project
using credential ABC
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url git#myrepo:root/My_Project.git # timeout=10
Fetching upstream changes from git#myrepo:root/My_Project.git
> /usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
> /usr/bin/git fetch --tags --progress git#myrepo:root/My_Project.git +refs/heads/*:refs/remotes/origin/*
> /usr/bin/git rev-parse refs/remotes/origin/My_Project_Develop^{commit} # timeout=10
> /usr/bin/git rev-parse refs/remotes/origin/origin/My_Project_Develop^{commit} # timeout=10
Checking out Revision fbd8fcef97895366d1d08bccb22615712d1f9ef0 (refs/remotes/origin/My_Project_Develop)
> /usr/bin/git config core.sparsecheckout # timeout=10
> /usr/bin/git checkout -f fbd8fcef97895366d1d08bccb22615712d1f9ef0
Commit message: "Update features of Software."
> /usr/bin/git rev-list --no-walk fbd8fcef97895366d1d08bccb22615712d1f9ef0 # timeout=10
Checking for pre-build
Executing pre-build step
Checking if email needs to be generated
No emails were triggered.
[My_Project] $ /bin/sh -xe /tmp/jenkins6218118938138193412.sh
+ id -un
root
+ SSH_OPTS='-o StrictHostKeyChecking=no -o ConnectTimeout=5'
+ sudo git checkout My_Project_Develop
Previous HEAD position was fbd8fce... Update features of Software.
Switched to branch 'My_Project_Develop'
Your branch is behind 'origin/My_Project_Develop' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Build step 'Execute shell' marked build as failure
Discard old builds...
#1040 is removed because status FAILURE is not to be kept
Checking for post-build
Performing post-build step
Checking if email needs to be generated
No emails were triggered.
Finished: FAILURE
You need to pull the My_Project_Develop branch, checkout is only switching to this branch. Your branch is locally behind the server.
The message is clear:
Your branch is behind 'origin/My_Project_Develop' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Usually this is done by Jenkins. I need more info how you run this job.
So I am using the Jenkins codedeploy plugin to trigger an S3 bucket put of a zip file that is being pulled from my BitBucket repo so then CodeDeploy can deploy the revision to my EC2 instances. Some services via Jenkins succeed, but others fail with this log error. Note: the permissions on /tmp directory is 700.
I thought in order to avoid this warning error, "npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})" I could do npm install --no-optional but that clearly wasnt the reason why the build was not successful. Another good thing to note is that multiple services are using the same code deploy application and deployment group to install to the same instance. i.e each service is pulled from a different branch and pushed to the same instance via Code Deploy. I know it sounds super complex, but any help here is really appreciated!
Started by user xxxx
Building in workspace /var/lib/jenkins/workspace/Livit-Dev_Node
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://xxxx # timeout=10
Fetching upstream changes from https://xxxx
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress xxxx+refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/BRIDG-oauth-
implementation^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/BRIDG-oauth-
implementation^{commit} # timeout=10
Checking out Revision 0a2ebd5f1633483cea93d8a627870ac794a6556c
(refs/remotes/origin/BRIDG-oauth-implementation)
> git config core.sparsecheckout # timeout=10
> git checkout -f 0a2ebd5f1633483cea93d8a627870ac794a6556c
Commit message: "Merged in Test-Commit (pull request #22)"
> git rev-list --no-walk f7b3a6a9a26e413412bb5ddadec504da9500ba35 #
timeout=10
[Livit-Dev_Node] $ /bin/sh -xe /tmp/jenkins6283232840818429990.sh
+ npm -v 5.6.0
+ npm install --no-optional
npm WARN livit-backend#1.0.0 No repository field.
npm WARN livit-backend#1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3
(node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform
for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current:
{"os":"linux","arch":"x64"})
up to date in 6.31s
Zipping files into /tmp/#13-767184457865657281.zip
Failed CodeDeploy post-build step; exception follows.
Unable to get file permissions
hudson.os.PosixException: Unable to get file permissions null
at hudson.util.IOUtils.mode(IOUtils.java:133)
at hudson.util.io.ZipArchiver.visit(ZipArchiver.java:55)
at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
at hudson.util.DirScanner$Glob.scan(DirScanner.java:131)
at hudson.FilePath$1.invoke(FilePath.java:473)
at hudson.FilePath$1.invoke(FilePath.java:469)
at hudson.FilePath.act(FilePath.java:1009)
at hudson.FilePath.act(FilePath.java:987)
at hudson.FilePath.archive(FilePath.java:469)
at hudson.FilePath.zip(FilePath.java:456)
atcom.amazonaws.codedeploy.AWSCodeDeployPublisher.zipAndUpload(AWSCodeDeployPublisher.java:358)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:230)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at
I copy-pasted jenkins job (which works in Grails 2.4.5) but it fails in new Grails 3.1.2 project:
Started by user Michal Szulc
Building in workspace <http://jenkins.example.com/job/project-server/ws/>
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.project-server_repository.url http://git.example.pl/scm/es/project-server.git # timeout=10
Fetching upstream changes from http://git.example.pl/scm/es/project-server.git
> /usr/bin/git --version # timeout=10
using .gitcredentials to set credentials
> /usr/bin/git config --local credential.helper store --file=/tmp/git6110612657385406031.credentials # timeout=10
> /usr/bin/git -c core.askpass=true fetch --tags --progress http://git.example.pl/scm/es/project-server.git +refs/heads/*:refs/remotes/project-server_repository/*
> /usr/bin/git config --local --remove-section credential # timeout=10
> /usr/bin/git rev-parse refs/remotes/project-server_repository/master^{commit} # timeout=10
> /usr/bin/git rev-parse refs/remotes/project-server_repository/project-server_repository/master^{commit} # timeout=10
Checking out Revision eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90 (refs/remotes/project-server_repository/master)
> /usr/bin/git config core.sparsecheckout # timeout=10
> /usr/bin/git checkout -f eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90
> /usr/bin/git rev-list eb5ef3113a02e6dc325d91ba5cc4b9ee7b935c90 # timeout=10
[project-server] $ /var/lib/jenkins/tools/com.g2one.hudson.grails.GrailsInstallation/3.1.2/bin/grails -Dgrails.work.dir=<http://jenkins.example.com/job/project-server/ws//target> -Dserver.port=40855 clean --non-interactive --plain-output
Error |
Command [clean] error: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.11-bin.zip'.
Problem with provided build arguments: [-non-interactive, --console, plain].
Unknown command-line option '-n'.
Either it is not a valid build option or it is not supported in the target Gradle version.
Not all of the Gradle command line options are supported build arguments.
Examples of supported build arguments: '--info', '-u', '-p'.
Examples of unsupported build options: '--daemon', '-?', '-v'.
Please find more information in the javadoc for the BuildLauncher class. (Use --stacktrace to see the full trace)
Build step 'Build With Grails' marked build as failure
If I run ./gradlew clean or ./gradlew war in local environment it works perfectly. How to run it by jenkins?
I'm still not sure why this situation has happened but I resolved an issue by changing Build -> Build With Grails -> Targets:
clean "war api.project-server.pl.war"
to:
"war api.project-server.pl.war"