Jsystem test unknown failure using Spirent Test Center - jenkins

I have some weird problem and don't have a clue about how to solve it.
I run automation tests using the Spirent Test Center API on win slave (64 bit 8GB RAM).
As far as I know test center support only 32bit compilation therefore some of my prerequisites is to get 32Bit java from nexus to slave and point my JAVA_HOME to this directory.
when I start my test and get to the init function of TC I don't get any error and Jenkins skip all other stages and finish the job.
when I connect to the slave via RDP and disconnect the test run as it should.
this is the failure:
11:20:07 [system]
11:20:07 [jsystem] 08:20:07: Initializing STC object (Chassis IP: XXXXXXX)
[Pipeline] unit
11:20:09 Recording test results
11:20:09 No test report files were found. Configuration error?
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // ansiColor
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: No test report files were found. Configuration error?
Finished: FAILURE
and after connect and disconnect I get this:
<pre>
[jsystem] 08:12:58: Initializing STC object (Chassis IP: XXXXX)
11:13:37 [jsystem] STC init pass.
11:13:37 [jsystem] 08:13:35: Init cli, host: XXXXX
11:13:37 [jsystem] The supported auth Methods are:
11:13:37 [jsystem] publickey
11:13:37 [jsystem] gssapi-keyex
UPDATE:
I manage to find the error:
11:54:58 An unrecoverable stack overflow has occurred.
11:54:58 #
11:54:58 # A fatal error has been detected by the Java Runtime Environment:
11:54:58 #
11:54:58 # EXCEPTION_STACK_OVERFLOW (0xc00000fd) at pc=0x74ca5b9b, pid=4356, tid=0x00000ecc
11:54:58 #
11:54:58 # JRE version: Java(TM) SE Runtime Environment (8.0_151-b12) (build 1.8.0_151-b12)
11:54:58 # Java VM: Java HotSpot(TM) Client VM (25.151-b12 mixed mode windows-x86 )
11:54:58 # Problematic frame:
11:54:59 # C [ucrtbase.dll+0x25b9b]
I try to google it and play with the java heap size but it doesn't help.
I don't see any errors in the reports.
Please assist

I think that the problem occurred because I need that user should be login to the agent.
My solution was to set the following registry keys in order to assure this.
https://support.microsoft.com/en-us/help/324737/how-to-turn-on-automatic-logon-in-windows
or by the script:
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d domainname /f
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Administrator /f
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d Pa$$w0rd /f

Related

Why does my Jenkins pipeline fail with Error code 24

I'm running a basic pipeline that executes pylint on my repository code.
My Jenkins runs on Debian etch, the Jenkins version is 2.231.
At the end of the pipeline, I'm getting the following error :
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 24
Finished: FAILURE
As this page https://wiki.jenkins.io/display/JENKINS/Job+Exit+Status explains, the error code 24 refers to a "too many open files" error.
If I remove the pylint part of the job, the pipelines executes smoothly.
Il tried to configure the limit in /etc/security/limits.conf
jenkins soft nofile 64000
jenkins hard nofile 64000
and in the Jenkins config file /etc/default/jenkins :
MAXOPENFILES=64000
If I put "ulimit -n" in the pipeline, the configured value is displayed but it has no effect on the result that remains : ERROR: script returned exit code 24.
The problem comes from pylint that doesn't return a 0 code even if it ran successfully.
The solution is to use the --exit-zero option when running pylint.
pylint --exit-zero src
Jenkins with pylint gives build failure

jenkins pipleline build error:Cannot open assembly 'MSBuild.exe': No such file or directory

I want to use jenkins pipeline and sonarqube to analysis code. Both jenkins and sonarqube are running in docker.I followed manual:https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-jenkins to create a pipeline job:
node {
stage('SCM') {
checkout(XXXX)
}
stage('Build + SonarQube analysis') {
def sqScannerMsBuildHome = tool 'msbuild'
withSonarQubeEnv('sonar') {
sh "mono ${sqScannerMsBuildHome}/SonarScanner.MSBuild.exe begin /k:myKey"
sh 'mono MSBuild.exe /t:Rebuild'
sh "mono ${sqScannerMsBuildHome}/SonarScanner.MSBuild.exe end"
}
}
}
when I built this pipeline,I got an error like this:
Cannot open assembly 'MSBuild.exe': No such file or directory.
Here is the build log:
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build + SonarQube analysis)
[Pipeline] tool
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: sonar
[Pipeline] {
[Pipeline] sh
+ mono /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/msbuild/SonarScanner.MSBuild.exe begin /k:myKey
SonarScanner for MSBuild 5.0.4
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
07:36:24.082 Updating build integration targets...
07:36:24.993 Fetching analysis configuration settings...
07:36:25.387 Provisioning analyzer assemblies for cs...
07:36:25.388 Installing required Roslyn analyzers...
07:36:25.592 Provisioning analyzer assemblies for vbnet...
07:36:25.592 Installing required Roslyn analyzers...
07:36:25.655 Pre-processing succeeded.
[Pipeline] sh
+ mono MSBuild.exe /t:Rebuild
Cannot open assembly 'MSBuild.exe': No such file or directory.
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 2
Finished: FAILURE
I checked /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/msbuild directory and can't find MSBuild.exe file.
[file in directory][1]
[1]: https://i.stack.imgur.com/2UcdK.png
How can I solve this problem or How can I use jenkins and sonarqube to analysis C# project

Problem with Connecting Jenkins to SonarQube

I have a Jenkins pipeline that periodically pull from gitlab and build different repos, build a multi-component platform, run and test it. Now I installed a sonarqube server on the same machine (Ubuntu 18.04) and I want to connect my Jenkins to sonarqube.
In Jenkins:
I set up the sonarqube scanner at Global Tool Configuration as below:
I generated a token in sonarqube and in Jenkins at configuration I set up the server as below BUT I couldn't find any place to insert the token (and I think this is the problem):
In the jenkins pipeline this is how I added a stage for sonarqube:
stage('SonarQube analysis') {
steps{
script {
scannerHome = tool 'SonarQube';
}
withSonarQubeEnv('SonarQube') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
But this fails with below logs and ERROR: script returned exit code 127:
[Pipeline] { (SonarQube analysis)
[Pipeline] script
[Pipeline] {
[Pipeline] tool
Invalid tool ID
[Pipeline] }
[Pipeline] // script
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: SonarQube
[Pipeline] {
[Pipeline] sh
+ /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube/bin/sonar-scanner
/var/lib/jenkins/workspace/wws-full-test#tmp/durable-2c68acd1/script.sh: 1: /var/lib/jenkins/workspace/wws-full-test#tmp/durable-2c68acd1/script.sh: /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube/bin/sonar-scanner: not found
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // stage
And when I check my jenkinstools on the disk sonnar plugin is not there:
$ ls /var/lib/jenkins/tools/
jenkins.plugins.nodejs.tools.NodeJSInstallation
Can someone please let me know how I can connect Jenkins to sonarqube?
Create and add token to be able to connect to SonarQube.
You have create project in SonarQube and use it as a parameter:
sh """
${scannerHome}/bin/sonar-scanner \
-Dsonar.projectKey=your_project_key_created_in_sonarqube_as_project \
-Dsonar.sources=. \
"""

sfdx error while running in Jenkins pipeline

Can anyone help me this issue in sfdx. I was able to execute scratch org and package version creation using Jenkinsfile. But getting an error while installing metadata on scratch org and sandbox.
[Pipeline] sh
[SFDX_SFDX_Package_Installation] Running shell script
+ sfdx force:package:install --wait 10 --publishwait 10 --package sfdx_naresh#0.1.0-1 -k nar123 -r -u scratchorg#so7.org
autoupdate:: /root/.cache/sfdx/update.lock is locked with an active
writer
ERROR: INVALID_HEADER_TYPE.
[Pipeline] error
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Package Installing Failed
Finished: FAILURE

OKD 3.9 jenkins slave Permission denied

I have strange problem when I run a build in container in openshift/OKD i get a strange problem:
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Still waiting to schedule task
‘Jenkins’ doesn’t have label ‘slave’
Agent slave-8n2r5 is provisioned from template Kubernetes Pod Template
Agent specification [Kubernetes Pod Template] (slave):
* [jnlp] docker-registry.default.svc:5000/openshift/jenkins-slave-base- centos7:v3.9
Running on slave-8n2r5 in /tmp/workspace/test_job
[Pipeline] {
[Pipeline] stage (hello)
Using the ‘stage’ step without a block argument is deprecated
Entering stage hello
Proceeding
[Pipeline] echo
dupa
[Pipeline] sh
[test_job] Running shell script
sh: /tmp/workspace/test_job#tmp/durable-bda908b8/script.sh: Permission denied
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 126
Finished: FAILURE
Pipeline:
node('slave') {
stage 'hello'
println('dupa')
sh 'git clone http://pac-app-test-01.raiffeisen.pl:8081/a/cm-devops-okd-example-python'
}
Slave container config:
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate>
<inheritFrom></inheritFrom>
<name>slave</name>
<namespace></namespace>
<privileged>false</privileged>
<capOnlyOnAlivePods>false</capOnlyOnAlivePods>
<alwaysPullImage>false</alwaysPullImage>
<instanceCap>2147483647</instanceCap>
<slaveConnectTimeout>100</slaveConnectTimeout>
<idleMinutes>0</idleMinutes>
<activeDeadlineSeconds>0</activeDeadlineSeconds>
<label>slave</label>
<serviceAccount>jenkins</serviceAccount>
<nodeSelector></nodeSelector>
<nodeUsageMode>NORMAL</nodeUsageMode>
<customWorkspaceVolumeEnabled>false</customWorkspaceVolumeEnabled>
<workspaceVolume class="org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.EmptyDirWorkspaceVolume">
<memory>false</memory>
</workspaceVolume>
<volumes/>
<containers>
<org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
<name>jnlp</name>
<image>docker-registry.default.svc:5000/openshift/jenkins-slave-base-centos7:v3.9</image>
<privileged>false</privileged>
<alwaysPullImage>true</alwaysPullImage>
<workingDir>/tmp</workingDir>
<command></command>
<args>${computer.jnlpmac} ${computer.name}</args>
<ttyEnabled>false</ttyEnabled>
<resourceRequestCpu></resourceRequestCpu>
<resourceRequestMemory></resourceRequestMemory>
<resourceLimitCpu></resourceLimitCpu>
<resourceLimitMemory></resourceLimitMemory>
<envVars/>
<ports/>
<livenessProbe>
<execArgs></execArgs>
<timeoutSeconds>0</timeoutSeconds>
<initialDelaySeconds>0</initialDelaySeconds>
<failureThreshold>0</failureThreshold>
<periodSeconds>0</periodSeconds>
<successThreshold>0</successThreshold>
</livenessProbe>
</org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate>
Both master jenkins container and slave run in the same name space.
I can log to the container and there is no problem with rights. I think is a silly mistake but I cannot find it on my own. Could you help me with this I'm tatally confused?
As my openshift mount volumes emptyDir() with option noexec I found a workaround for this problem in pipeline I'm changing workspace:
node('slave') {
ws('/tmp/test/' + env.JOB_NAME){
println('dupa')
sh 'git clone http://xxxx:8081/a/cm-devops-okd-example-python'
}

Resources