I'm trying to make sure that all tests complete before making a deployment. For this I have enabled Jenkins for my app. I can run builds successfully from git push and from Jenkins UI if myapp-bldr node is up and running, however if I try to run a build after a period of inactivity (basically wait for myapp-bldr to go down and free up a gear in my account), Jenkins build fails with below details:
> rhc app-deploy HEAD --app myapp
Deployment of git ref 'HEAD' in progress for application myapp ...
Executing Jenkins build.
You can track your build at https://jenkins-mydomain.rhcloud.com/job/myapp-build
Waiting for build to schedule............................................................................................
**BUILD FAILED/CANCELLED**
Please see the Jenkins log for more details via 'rhc tail'
!!!!!!!!
Deployment Halted!
If the build failed before the deploy step, your previous
build is still running. Otherwise, your application may be
partially deployed or inaccessible.
Fix the build and try again.
!!!!!!!!
An error occurred executing 'gear deploy' (exit code: 1)
Error message: CLIENT_ERROR: Failed to execute: 'control post-receive' for /var/lib/openshift/581e42c10c1e6666270001d8/jenkins-client
While Waiting for build to schedule... line is displayed in console, I can see build being queued in Jenkins UI, but since no builder nodes are available, it doesn't get picked up.
I'm guessing the issue is related to some timeout setting somewhere, but I can't tell for sure which one and whether I have the ability to tweak it.
I found this bug reported linking to the following pull request but I don't know if this is related and how to check if my app has the above config change applied to it.
I'm using "old" console (v2, not "NextGen" v3) with Jenkins ver. 1.642.2
Related
Before installing Git plugin in my Jenkins all my jobs were working properly. After installing the Git plugin, my Jenkin get restart and after that my jobs are not displaying in dashboard. When I check in system log, I found issue stating "Failed to load struct, Failed to load x job, Failed to load Y job..... And so on".
How can I resolve this?
You need to upgrade Jenkins to the latest version. This will solve the problem.
In my Jenkins pipeline I do a checkout, after that checkout something happens that causes the build to fail. The changes/commits stay attached to that failed build. The next build doesn't show the changes that were reported on the failed build. From the below I would like to see the 3 commits to show on build #76.
My team and I are currently building a project with Travis CI, which initiates a script on remote server. When we click to cancel builds in the Travis UI, the Travis build stops but the script on the remote server continues to run.
Is it possible to automatically run a command after cancelling builds, so that we can tell the remote server to stop executing the script?
Thank you to Travis CI support for this email response:
When a build or job is manually cancelled (or terminated by one of our
workers for a different reason) it is killed without any chance of
cleanup. So no, there is no special after_cancelled hook and
after_failure as well as after_script are not executed when
manually cancelling. This has to do with the way our build lifecycle
is implemented and making an after_cancel possible requires quite
some changes.
We are aware of this issue. It has been raised in our public tracker
https://github.com/travis-ci/travis-ci/issues/4221 and is also being
discussed internally. Unfortunately I cannot give you any time frame
when we will address this issue but we will update the public ticket
once there is progress.
I'd like to use an other project to promote my builds.
I am using this plugin https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin
But I have the following error message when I am linking a project
This is working but not really properly.
Promotion logs:
Started by user admin
Building in workspace /var/lib/jenkins/workspace/generator-api
Promoting generator-api #86
build hudson.plugins.parameterizedtrigger.BuildTrigger#36339454 SUCCESS
Warning: this build has no associated authentication, so build permissions may be lacking, and downstream projects which cannot even be seen by an anonymous user will be silently skipped
Finished: SUCCESS
I should have the deploy build there as well.
I can't find how to give permission to my project to build deploy when promoting.
From what I can see the downstream project should have Run as User who Triggered Build options selected in Configure Build Authorization section.
In my case that options is missing. To enable that see following Jenkins plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Authorize+Project+plugin
EDIT
I solved the problem in different way. I had this code in execute shell of promote section:
git tag -d DEVENV
git tag DEVENV ${PROMOTED_GIT_COMMIT}
git push origin --tags —force
Problem was that the tag didn't exist and the script was failing on the first line trying to delete it.
It is very likely that the auth warning message is vague and hides different problems.
I was having similar issue when trying to add new trigger for building another project, and this seems to resolve it:
With the Authorize Project plugin, you should go to "Access Control for Builds" section, in the Global Security athttps://{your-jenkins-domain}/configureSecurity/:
Adding a new strategy "Run as SYSTEM", allowed the Jenkins Cron scheduler to trigger build on another project.
Note however, that the red warning "You have no permission to build" did not disappeared, although it did not prevent the triggered build to be launched by the scheduler.
In the jenkins applications ,I accidentally clicked on the " Build Now " instead of "Build with Parameters" link while trying to Build the application and now its stuck . I am unable to cancel this Build. I tried building the application again however I am unable to promote my new build because the previous Build is still not complete. Is there any way I can abort the previous build ?
in Jenkins Script console (/jenkins/script) try:
Jenkins.getInstance().getItemByFullName(jobName,Job.class).getBuildByNumber(jobNumber).doStop()
Check if you are logged in and you have permissions for aborting the build (should be at job's configuration page)
Jenkins could need some time to process the abortion request.
If you notice that Jenkins is definitely stacked, check the reason.
It could be memory, CPU or space issue.
These Linux commands are highly recommended:
top
df -h
The last and the most unpleasant way is rebooting Jenkins and starting the new job. NEVER try that on production machine :)