I have added the build flow job with my multijob.
I faced some issues with build flow job. It always executes twice whenever I gave build.
Is there anybody faced and solved this issue previously?
Related
I have a job running on a WindowsServer2012R2 agent. The job is pausing between 2 plugins (BuildNameSetter v1.6.8 and DiscardOldBuilds v1.0.5) as you can see below:
13:05:25 Set build name.
13:05:25 New build name is '5.0.811.0'
13:20:21 Discard old builds...
I've started to notice this strange behavior after upgrading Jenkins Master from 2.89 to 2.190.3.
It's frustrating to see your job taking a 15 minutes nap!
Is this a server side issue or a agent side one?
Can someone give me some hints about how to tackle this problem?
Did you experience something similar?
you could have a look at jenkins central logs /log/all to see if there is any java stacktrace error in there
Then you should first try to isolate the issue. try deactivating the build name setter step first. then try to disable the discard old build. then enable build name setter again and keep discard old build deactivated
now you know which plugin is causing the issue try to downgrade or upgrade the plugin that makes your build hang
if the issue comes from discard old build, I would try to remove clean the job's workspace and remove builds manually
look for your issue on jenkins's jira system, upvote. create a ticket if you have not found another user experiencing the same issue
Finally you should be able to find workarounds for these plugins
Today I've upgraded Jenkins to a newer version (2.263.2) on the Jenkins server and the 15 minutes pause dissapeared.
Jenkins builds suddenly disappears from the jenkins UI for certain Jobs. The Job triggers and it can been seen in the ui but suddenly vanishes. The build is present in the master machine.
Has anyone faced this before. If so your insights will be really helpful.
We also saw some of our build history being missing when checked in the master all the builds were still present but there was a problem with symlinks being broken in the builds folder for a job
lastFailedbuild, Lastsatblebuild were reset to -1 even though there were some failed builds present.
But this got resolved once a few plugins(disk usage and metrics-diskusage) that were disabled were re-enabled and a reload configuration were done.
As a part of CI/CD activity, I am migrating a project from Build Forge to Jenkins. Since I am new to jenkins, I am confused as to how to continue execution in Jenkins from a failed step, ignoring the previously passed steps. Or is it that all the steps should rerun from the beginning? Appreciating any ideas are welcome.
I think the only way to do this is with the Cloudbees Checkpoints plugin, which is not open source. You would have to use the Cloudbees version of Jenkins:
https://go.cloudbees.com/docs/cloudbees-documentation/cje-user-guide/index.html?q=checkpoints#workflow
Is there any way in jenkins where as soon as we detect the failed build, job revert back the perforce code to the last successful build changelist and fire a build again.
Flow -
1. so as soon as we have failed build - Notifcation will be sent out to dev team with possible checkins which causing the build failure
Revert back the recent code to the last working code and submit it
Initiate a build.
It is possible, but I don't see any reasons or use case to do it as it is not a correct workflow and can be confusing.
But if you decided to do it, the next steps are required:
Example how to do it using Perforce source control.
Steps inside job settings:
Before build triggers you need to save latest changelist number $P4_CHANGELIST - 1
Perforce plugin for Jenkins: Perforce plugin for Jenkins
Build
Get last error code
Get last error code from the: batch
If code != 0 then checkout and build changelsit $P4_CHANGELIST - 1
Jenkins is not a production server. It runs tasks and do not have options that I know for that purpose.
What is your source code ? webapps ? others ?
What steps are you performing ?
Are you performing some automatic tests ?
My assumption is that you got some tests that may invalidate the build.
These tests should be runned :
* on a mock server to prevent deploying on your server
* or somewhere else
Like that, if build failed, nothing is deployed.
If build success, you can deploy your project normally.
If this not reply to your answer, please provide requested information to undestrand a bit more your job process.
If your using an artifact repository like Nexus or Artifactory to manage your project artifacts then you could always redeploy the previous working version of your application when a failure is detected.
Your not cancelling any checked in code that potentially broke the build but you are preserving your test environment. You can configure Jenkins to notify the user who checked in the latest erroneous change set and they can work on resolving the issue.
Jenkins also provides a rich API which allows you to delete a job, start a job, get information about previously run jobs. You could leverage some of these services along with your artifact repo to achieve the experience you described.
For posterity:
One of my Jenkins jobs disappeared after I upgraded some plugins.
I looked through the error log, and found that the Promoted Builds Plugin was failing while parsing the job config.
What went wrong?
It appears that the Promoted Builds Plugin release 2.9 broke in my scenario, which specified a promotion action to build a parameterized job. I removed the section of the job conf file pertaining to promoted builds, restarted Jenkins, and the job reappeared. Then I reconfigured the promotion action, and all seems fine.