Hudson CI exception after build script execution for iOS - ios

I am getting following exception during automation build execution with Hudson CI. This exception comes after build script completes the build job and because of this exception post build task does not able to get performed. I have tried with with different MAC systems.
FATAL: org.hudsonci.plugins.jna.JnaNativeMacSupport$NativeMacProcess$1StringArrayMemory.getSize()J
java.lang.NoSuchMethodError: org.hudsonci.plugins.jna.JnaNativeMacSupport$NativeMacProcess$1StringArrayMemory.getSize()J
at org.hudsonci.plugins.jna.JnaNativeMacSupport$NativeMacProcess$1StringArrayMemory.hasMore(JnaNativeMacSupport.java:199)
at org.hudsonci.plugins.jna.JnaNativeMacSupport$NativeMacProcess$1StringArrayMemory.readString(JnaNativeMacSupport.java:209)
at org.hudsonci.plugins.jna.JnaNativeMacSupport$NativeMacProcess.parse(JnaNativeMacSupport.java:258)
at org.hudsonci.plugins.jna.JnaNativeMacSupport$NativeMacProcess.getEnvironmentVariables(JnaNativeMacSupport.java:172)
at hudson.util.ProcessTree$Darwin$DarwinProcess.getEnvironmentVariables(ProcessTree.java:962)
at hudson.util.ProcessTree$OSProcess.hasMatchingEnvVars(ProcessTree.java:256)
at hudson.util.ProcessTree$Unix.killAll(ProcessTree.java:504)
at hudson.Launcher$LocalLauncher.kill(Launcher.java:670)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:549)
at hudson.model.Run.run(Run.java:1450)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:82)
at hudson.model.Executor.run(Executor.java:137)
Is there any issue with JNA native access?

Looks to me like jna (whatever that is) can't read some environment variable cause it can't figure out it's size.

Related

How to debug NUnit failing only in CI build?

I'm having trouble running my tests with NUnit in my Jenkins build. Where the tests all succeed when I run them manually (via a Cake build script) - even directly on the build server -, they fail when run during a build in Jenkins that calls that very same build script.
As output I get the following message:
An error occurred when executing task 'Test'.
Error:
NUnit3: Unrecognised error (exit code -1073740940).
When running NUnit with TraceLevel = TraceLevel.Debug, I get a trace file that looks fine until it simply stops after the same line:
15:49:14.342 Debug [ 6] Dispatcher: Using Direct strategy for <my failing test>
I'm running NUnit with InProcess and a single worker.
It's always the same test failing - but only when run in the CI build.
I get that it's nearly impossible to diagnose the exact problem from here - what I'm asking is for is if there's any way to get any more information on what exactly is failing?
Based on the error code, this seems to be a heap corruption error (C0000374). For more info see https://blogs.msdn.microsoft.com/calvin_hsia/2015/01/30/heap-corruption-exception-0xc0000374/ for some examples of how such an error is generated.
My guess is that your test is doing something bad and getting away with it in most circumstances but that running under Jenkins may change the environment enough so that it throws the exception.
This is very hard to diagnose. First thing I would want to ascertain is whether any of your test code gets executed at all. The NUnit internal trace appears to indicate that the test was dispatched (enqueued) but not actually dequeued and run. However, we sometimes lose a few events when the runner crashes.
You might try running with --workers=0 to see if the simplified execution code (no queues are used) gets you more information.

java.lang.IllegalStateException for sonarqube scanning for .Net solution

I am running Sonar-Scanner through Jenkins and unable to get the analysis successful for .Net solution. Below is the attached screenshot of the error.
enter image description here
The error shows that
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Line 295 is out of range in the file (...) (lines: 294)
But there are only 294 lines in this file.
I am using below versions:
sonar-scanner-msbuild-3.0.2.656
sonarqube-6.6
I had the same issue with bamboo and dotnet-core.
It occured with a file that went down on number of lines.
The problem seemed to be that sonar was using the cache, thats why it looked for a line out of range.
The solution in my case was,in bamboo jargon, to force a clean build, or in jenkins jargon, execute on a clean workspace .

Jenkins + Sonar: ERROR: Error during SonarQube Scanner execution java.lang.IllegalStateException: Project does not pass the quality gate

I am trying to integrate Sonar in Jenkins. Due to some bad code quality - it is giving below error.
"ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Project does not pass the quality
gate."
I do not have permission to change the quality gate right now. I want to make the build success irrespective of quality gate result. How to do it?
Seems that you have installed https://github.com/SonarQubeCommunity/sonar-build-breaker So either uninstall it, either try to set sonar.buildbreaker.skip=true. Also note that SonarQube developers do not recommend to break the build - http://www.sonarqube.org/why-you-shouldnt-use-build-breaker/
The previous answer is correct but I don't have access to the settings. Also, I didn't want to change global policies or server settings even if I had the access.
Luckily I can modify the script that runs the scanner. In the begin command (whatever method you are using to execute the begin command) add the flag to skip the build breaker.
sonar.buildbreaker.skip=true
Normally it is added in the form of:
/dLsonar.buildbreaker.skip=true

SonarRunner crashes due to Findbugs

I am doing a Sonar analysis of my project on a Jenkins Server using SonarRunner within an ant build. Unfortunately, the Analysis crashes with the following lines:
[sonar:sonar] 11:29:57.008 INFO - Execute Findbugs 2.0.3...
[sonar:sonar] 11:29:58.217 DEBUG - Release semaphore on project : org.sonar.api.resources.Project#5c1f0a26[id=3998,key=<key>,qualifier=TRK], with key batch-<key-batch>
[sonar:sonar] 11:29:58.247 DEBUG - To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
BUILD FAILED
<Path>: The following error occurred while executing this line:
<Path>: org.sonar.runner.impl.RunnerException: Unable to execute Sonar
I have other projects running on the same server, which have no problem performing this analysis (and where the analysis is triggered exactly the same way). As you can see, I changed the log level to DEBUG, but, nevertheless, I get no stack trace and I am not able to find useful information in the logs of Jenkins or Sonar.
One other thing, I tried, was to increase the Heap space (with -Xmx) for this ant task in Jenkins but that didn't help either.
Are there any other settings I can take to get useful information or does somebody know about this problem?
Thanks!
Some more information could be useful. E.g.: what SonarQube and SonarRunner versions are you running.
Findbugs is one of the few analyzing plugins that need .class data for analyzing the project. So if you have not changed the directory within your build.xml the ant task may search within the default output folder location.
Please make sure your .class files are located here. To make them appear here you have to compile them before of course

Maven plugin failed after upgrading Jenkins to 1.505

I have upgraded my Jenkins server to 1.505 but unexpectedly building with Maven plugin is not working and it throws an exception in the Jenkins logs
Error injecting constructor, java.lang.NoClassDefFoundError: hudson/ivy/AntIvyBuildWrapper
and after an hour googling this issue I found that Maven plugin guys upgrade their code base and it failed on an "optional" dependency, so I added the "optional plugin" but still it fails silently without any exception in the Jenkins logs.
the error appears on the console log is ERROR: Couldn't find Maven executable.
any hints ?!
The new maven plugin adds a new option to the Jobs I have (under the build section -> Invoke Maven 3 there is a new field called Maven version).
So what we need to do is open each job configuration page and hit the save button in order to save the default value and it will solve the problem.

Resources