Jenkins does not show some builds log and failed builds in history - continuous-integration

We have updated our Jenkins CI tool to updated version number is: 1.596.1. The problem is, for some projects, we cannot see the build console log. When we try to see the log, Jenkins responds with 404 error page.
Also, when this problem occurs in a particular job, we have examined that, failed builds are not be shown in the build history list in the job page. Even though we see that there is build from the gerrit history, when I click on the job with the specified ID, I again get the 404 error.
We are using Jenkins with Git/Gerrit, and most builds are triggered from the Gerrit review system.
New information: Jobs that have this problem have also the inconsistent timestamp problem.
It seems that this problem also occurs when Jenkins job is triggered by a patchset creation/merge in Gerrit review system.
What may be the root cause for this problem? Is it the version we're using or some other factor?

This is a persistent problem with Jenkins. A restart, which you can do from the front page when you're authenticated, is the fix. Visit
https://yoursite/jenkins/quietDown
to restart the instance.

Related

GitVersion throws authentication error in TeamCity build

I've created a build in TeamCity for a project which uses GitVersion to manage versioning. When I attempt to have TeamCity run the build it fails showing the following error in the build log:
An unexpected error occured:
LibGit2Sharp.LibGit2SharpException: authentication required but no callback set
I have tried searching google for the LibGit2Sharp error, but find only a couple of closed bug reports with no details how they were able to work around the error.
After setting up the build's artifacts to capture the log output GitVersion was generating, the following message was found:
TeamCity doesn't make the current branch available through environmental variables.
Depending on your authentication and transport setup of your git VCS root things
may work. In that case, ignore this warning.
In your TeamCity build configuration, add a parameter called `env.Git_Branch` with
value %teamcity.build.vcs.branch.<vcsid>%
See http://gitversion.readthedocs.org/en/latest/build-server-support/build-server/teamcity
for more info
By setting the env.Git_Branch parameter to the %teamcity.build.vcs.branch.% value, GitVersion started working. This should have been a straightforward solution, but because the logs were not being captured and search results for the error message were unsuccessful, I've decided to post this answer to help others who may encounter this problem.

Jenkins failure cause message not part of Gerrit trigger response

I have some Jenkins pipelines, and on failure they send a -1 Verified response back to the gerrit review that triggered it. I also have the Build Failure Analyzer plugin, which I used to scan the console log for failure causes when the job fails.
On an older Jenkins installation (that I didn't manage), I used to get this failure cause back in the -1 Verified response in the gerrit review if one was found. I don't have that working at the moment.
Does anyone know if there is some gerrit trigger configuration needed, or another plugin to use to enable this?

Provide log files on jenkins pipeline job result page

I have a jenkins pipeline job which runs a test. During the tests server logs are created. I can download the server logs into the workspace.
Can I somehow put these server logs into the result page of the job so that developers can analyze them?
You can use the archive basic step to archive your logs. It will show a link in the build page.
See documentation

TFS Deployment times out, when using an existing Build

I'm trying to deploy an existing build with the "LabDefaultTemplate.11.xaml".
My problem is, that the build times out, as soon as I use an existing build. Here are the last steps including details and the timeout exception:
See http://i.stack.imgur.com/po1i6.png
I have two different servers. The first has TFS 2013 with Build Service, Controller and Agent installed on it. The second is thought to be used for Testing and has a Test-Controller and Agent on it (configured as a Standard-Environment in MS Test-Manager).
Build Service Account is a Domain-Admin
Build Connection to TFS goes with a TFS-Admin
Test Controller Service Login Account is a Local-Admin (mirrored on the Build-Server) and earlier tried with the Domain-Admin
Test Controller TFS-Connection also with a TFS-Admin
Test Controller Lab Service Account is not used, earlier also tried with the Domain-Admin
When I set the build to use the latest TFS-Build it runs into the timeout.
And when i set the path to use a Build from a specific location to the Build Directory on the Build-Server it all just works fine.
The difference between a working build and the timeout described above can be seen in this picture: http://i.stack.imgur.com/gPM07.png
Has anyone an idea where I'm struggling?
The problem was, that my previous builds only "partially succeeded" because they had some failing unit tests. The setting to use the only uses fully successful builds. So the latest build which was used had no drop folder configured.
I received no info about that, until I saw it in the logs. My fault was to never check, which build really is used as the latest.

How to trigger maven specific job in Jenkins with Gerrit

I'm currently using Jenkins(1.451) and the Gerrit Trigger(2.3.1) to launch builds from Gerrit in order to verify code.
This is working fine as long as the project in Jenkins is configured as a "Free style" project. However, I'm currently setting up a new build pipeline where I'm using the "Build a maven2/3 project" option in order to take advantage of maven specific properties which I can't get from the "Free style" option. For some reason, Jenkins doesn't seem to trigger builds using this option. Nothing at all happens when I submit code to Gerrit which under normal circumstances should be picked up. I'm actually wondering if the Gerrit trigger is meant to work with Jenkins projects configured as a maven2/3 job or maybe it is the case that I can only use the Free style option in order to do this.ge
Could anyone confirm if this is the case?
Yes this will work. I suspect you might have some authentication issues that causes your jobs not to be triggered.
Check you sshd_log in the gerrit config folder to see if there are any jenkins logins that result in immediate LOGOUT. I my case I forgot to add Stream Events rights to the Non-Interactive Users under All-Projects and this caused some strange behavior.
This was the message I saw 3x per second in my sshd_log:
jenkins a/1000002 gerrit.stream-events 0ms 0ms not-admin
See here for more details

Resources