We are running SonarQube from TFS CI task.
Before some time SonarQube analysis was getting success when I trigger build manually but the same build is giving an error and now this is not working from my user with manual trigger also.
[error]ERROR: GC overhead limit exceeded
While Auto trigger as we have configured Nightly scheduled build with the different TFS user.
This is how I configured System variable for SONAR_SCANNER_OPTS which is working fine with manual trigger
I have checked this document as it seems user permission issue.
User Permissions:
And, according to this TFS User have this access of Build Administrator and Project Administrator to access Variable SONAR_SCANNER_OPTS I've defined.
Just set a variable in the VSTS build called SONAR_SCANNER_OPTS with a value of -Xmx8192m, then try it again.
See Dinesh's comments in this similar issue: GC overhead limit exceeded using the VSTS task
Try to give more memory to the Run Code Analysis task rather than
the Prepare analysis on SonarQube task.
Also both sonar.web.javaOpts and sonar.ce.javaOpts are server-side
options for SonarQube operation. You do not need to worry about those
as you are relying on SonarCloud. Setting those for an analysis during
a build will have no effect. Just set SONAR_SCANNER_OPTS which as you
saw in your deleted post does have an effect (i.e. setting it to 4096
bytes did lead to an immediate failure of the JVM)
Related
We detached one of our main collections and it failed to detach so we restarted it and everything appeared to be fine. But we found this morning that the Build pipelines are not picking up new builds. The build servers are communicating and showing online but nothing is queuing. Anyone ever experience this during a detach/reattach process?
Update
Customer quiesced and unquiesced TFS and that fixed the pipeline issues.
Detach/reattach collection usually will not effect build related.
First, suggest you to take a look at Event View if there are some useful logs for troubleshooting.
If you are using vNext build, check the agent pool and agents which should all be green.
Make sure in your build definition, you have selected the right agent queue. Also try to create an empty build definition with no build task to see if the issue is related to the definition. And also restart your agent service on your TFS server.
Also check if the service Visual Studio Team Foundation Background Job Agent is running. If not, start it manually and try the build again.
Note: The service is running in TFS server, not build server.
For logs to troubleshooting , check the event view and the log in \agent_diag on build agent to see whether there are some useful information.
If you still get this issue, then deploy and configure a totally new build agent. This will help to narrow down the issue.
Exploring upgrade to on premise TFS 2017.3
We have a large project that takes about 20-30 minutes to compile. I'm planning on setting up multiple build agents on different servers to handle compilations on every check-in.
I enabled Continues Integration trigger and can run builds on all 10 agents in parallel (triggered by check-in). When I continue to check in files, the builds just put in queue waiting for agents to complete previous builds.
Selecting "Batch changes while a build is in progress" checkbox allows only one build to run even if I have 9 more agents ready for work.
How can I use all 10 agents and butch changes only when all of them are being used?
thanks.
This is the expected behavior, take a look at the behavior of "Batch changes" of Continuous Integration
Batch changes
Select this check box if you have a lot of team members uploading
changes often and you want to reduce the number of builds you are
running. If you select this option, when a build is running, the
system waits until the build is completed and then queues another
build of all changes that have not yet been built.
You can batch changes when your code is in Git in the project or on
GitHub. This option is not available if your code is in a remote Git
repo or in Subversion.
If you selected this option, then you will have to wait the build completed and queue another build. More details please take a look at the official link.
When I do some code changes and push the code to Gerrit. Jenkins build gets triggered and we usually get verified voting +1 or -1 depending on the result on to the Gerrit UI for that change.
Currently, we observed that for any of the compilation errors it is not reporting on to the Gerrit. And this happens only for compilation errors, not for failing tests, failing git checkouts or other reasons that make a build fail.
Below I've mentioned the version details. Any suggestions will be highly appreciated.
Gerrit Version: 2.14.2
Jenkins Version: 1.642.3
Gerrit-Trigger plugin: 2.18.3
Project: Java project
Build Tool: Maven
Regards
Sharieff.
That's intended for an "Unstable build" (i.e. compile/build errors but not a test error) in the default Gerrit-trigger configuration.
Take a look at your "Gerrit Reporting Values" for the project/default configuration.
If you want to use the "verify" label for unstable (i.e. compile errors) and failed (test errors) builds, configure the verify values like seen below.
(iirc the default configuration uses code-review = -1 for unstable, for this the used gerrit account needs the permission to submit a code-review label)
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.
There are two machines with Jenkins: one for building, second for testing. If some job is successful on 1st machine, it triggers testing job on 2nd machine via http request. For example:
http://<2nd_jenkins_ip>:8080/job/<job_name>/buildWithParameters?BUILD_NUMBER=167
The problem: It seems that there is something, which launches some of the testing jobs automatically, but it shouldn't. I have deactivated nightly builds, but it happened again. And I can't find out the reason.
Question: Is there any possibility to display the IP/url of the machine, which started the build (e.g. into console output)? If not, can I find this information elsewhere (e.g. jenkins/linux logs)?
EDIT1:
Console shows:
Started by user anonymous
Building on master in workspace <my_workspace>
Cleaning local Directory ./test_data
Checking out ...
Following svn checkout and other build steps.
In the Jenkins_HOME directory on the server, look under jobs/<jobname>/builds/<select the last build you want by date>
In there, open log file (no extension) with any text editor. It will usually provide a more detailed cause at the top of the file.
There are many ways you can prevent unwanted builds. One way is to configure Authentication Token under Job's configuration -> Build Triggers -> Trigger builds remotely. Once a token a set, other (rogue/old) scripts could not trigger the job without providing this token.
This however does not prevent manual triggering through the UI or other projects triggering through Jenkins' methods (not URL).
I've also had some inconsistent issues regarding jobs that were configured on a schedule/timer to the effect that changes wouldn't take effect until Jenkins restart.