Jenkins Perforce Plugin Exception - jenkins

I set up a Jenkins job to poll Perforce for changes in the depot every 15 minutes, however I am seeing the following error in the polling log:
Caught Exception communicating with perforce.P4 Where Parsing Error: //... and //some_depot/... filespecs are not allowed.
FATAL: Unable to communicate with perforce. Check log file for: P4 Where Parsing Error: //... and //some_depot/... filespecs are not allowed.
java.io.IOException: Unable to communicate with perforce. Check log file for: P4 Where Parsing Error: //... and //some_depot/... filespecs are not allowed.
at hudson.plugins.perforce.PerforceSCM.compareRemoteRevisionWith(PerforceSCM.java:1296)
at hudson.scm.SCM.poll(SCM.java:397)
at hudson.model.AbstractProject._poll(AbstractProject.java:1435)
at hudson.model.AbstractProject.poll(AbstractProject.java:1338)
at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:119)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:515)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:544)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Done. Took 5.4 sec
No changes
Has anyone seen this before? Polling seemed to work perfectly a few hours ago, but now this error is appearing with each poll.

Perhaps your Perforce administrator just installed a new trigger, one which
generates the error message
//... and //some_depot/... filespecs are not allowed.
if it sees a client workspace spec with an unacceptable view map.
If that's indeed your problem, then you either have to specify a narrower (more precise) view map for the client workspace that your Jenkins build is using, or get your administrator to give you an exception in the trigger.

Related

Jenkins Agent JNLP4 Connection Issue

I am having an issue with a Jenkins agent not being able to connect with the Controller when a specific job ends. All other jobs are completed without any issues.
Basically, the job runs on the agent without any issues and gives out the expected result but, fails when it is time to hand over the job to the Jenkins master.
Both Controller and Agent are windows server VMs.
I saw multiple questions about this issue in multiple forums and Jenkins support but none of the suggested solutions is able to solve my issue.
The error message is:
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection to hostname/IP:16076
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1797)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.FilePath.act(FilePath.java:1166)
at hudson.FilePath.act(FilePath.java:1155)
at hudson.FilePath.copyTo(FilePath.java:2493)
at hudson.FilePath.copyTo(FilePath.java:2448)
at hudson.plugins.logparser.LogParserStatusComputer.computeStatusMatches(LogParserStatusComputer.java:88)
at hudson.plugins.logparser.LogParserStatusComputer.access$000(LogParserStatusComputer.java:22)
at hudson.plugins.logparser.LogParserStatusComputer$1.call(LogParserStatusComputer.java:54)
at hudson.plugins.logparser.LogParserStatusComputer$1.call(LogParserStatusComputer.java:47)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from hostname/IP:50925
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1797)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.plugins.logparser.LogParserStatusComputer.computeStatusMatches(LogParserStatusComputer.java:47)
at hudson.plugins.logparser.LogParserStatusComputer.<init>(LogParserStatusComputer.java:36)
at hudson.plugins.logparser.LogParserParser.parseLogBody(LogParserParser.java:355)
at hudson.plugins.logparser.LogParserParser.parseLog(LogParserParser.java:165)
at hudson.plugins.logparser.LogParserPublisher.perform(LogParserPublisher.java:119)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:755)
at hudson.model.Build$BuildExecution.post2(Build.java:178)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:699)
at hudson.model.Run.execute(Run.java:1913)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:99)
at hudson.model.Executor.run(Executor.java:431)
java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 3
e:\jenkbuilds\(.+)\builds/[0-9]+(/.*)?
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.escape(Unknown Source)
at java.util.regex.Pattern.atom(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at jenkins.security.s2m.RunningBuildFilePathFilter.op(RunningBuildFilePathFilter.java:91)
at jenkins.ReflectiveFilePathFilter.read(ReflectiveFilePathFilter.java:21)
at jenkins.FilePathFilterAggregator.read(FilePathFilterAggregator.java:75)
at jenkins.SoloFilePathFilter.read(SoloFilePathFilter.java:66)
at hudson.FilePath.reading(FilePath.java:3497)
at hudson.FilePath.access$300(FilePath.java:213)
at hudson.FilePath$CopyTo.invoke(FilePath.java:2507)
at hudson.FilePath$CopyTo.invoke(FilePath.java:2499)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3338)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:18)
at hudson.remoting.CallableDecoratorList.lambda$applyDecorator$0(CallableDecoratorList.java:19)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Build step 'Console output (build log) parsing' marked build as failure
Archiving artifacts
Recording test results
Finished: FAILURE```
Please let me know if you would like to have more information.
Any help will be greatly appriciated.
Illegal/unsupported escape sequence near index 3 e:\jenkbuilds\(.+)\builds/[0-9]+(/.*)?
Build step 'Console output (build log) parsing' marked build as failure
Archiving artifacts
It would seem it's interpreting your path regex as an escape character "\j*". Wherever that regex is, try double slash, "e:\\jenbuilds", or try chage to unix style "/".
It's either the ArchiveArtifacts step or right before that. Show your config steps?
I managed to resolve the issue using #Ian W comment. When diving into the 'Log Parser' plugin's settings, I found that my last update to Jenkins plugins reset its settings.
I wasn't aware that there is a modified rule in Jenkins for this plugin.
To be more specific:
To find the list of rules:
Manage Jenkins - > Configure System -> Multi-job Retry Rule -> Log Parser Rules
To update the job:
Job -> Configure -> Post-Build Actions -> Use Project Rule -> paste rule
I hope this will turn to be useful for someone as this was quite of a challenge to find and fix.

Jenkins multijob show failed when all sub jobs succeed

I have a multijob which has 6 child job. During test, I found that the multijob always show failed even all sub jobs succeed. The error message is:
Finished Build : 1.0.0.1 of Job : Sub_Job_6 with status : SUCCESS
FATAL: Channel "unknown": Remote call on JNLP4-connect connection from build_machine/10.224.113.202:51903 failed. The channel is closing down or has closed down
java.nio.channels.ClosedChannelException
at org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:789)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on JNLP4-connect connection from build_machine/10.224.113.202:51903 failed. The channel is closing down or has closed down
at hudson.remoting.Channel.call(Channel.java:945)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:148)
at hudson.model.Run.execute(Run.java:1727)
at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:76)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
I found the root cause. One of my sub job is to power off, power on the build machine( a reboot actually). After reboot, Jenkins client will re-connect to Jenkins server. The server may think it's a new conversation, the old one has stopped with some exception. So the final result will show failed.
After I removed this sub job, the multijob showed success finally.

Jenkins JNLP4-connect connection from xxx.xxx.xxx.xxx failed after the success of build procedure

I got a failure after all the build procedure were finished without any errors.
And I don't know why below error has occurred.
This error has marked the status of a job as a failure even all the tests were successfully finished.
FATAL: Remote call on JNLP4-connect connection from socautovm1.xxx.local/192.168.114.144:65033 failed
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from socautovm1.xxx.local/192.168.114.144:65033
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
at hudson.remoting.Channel.call(Channel.java:955)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1815)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
java.lang.NoClassDefFoundError: Could not initialize class hudson.slaves.SlaveComputer
at hudson.util.ProcessTree.get(ProcessTree.java:399)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1090)
at hudson.Launcher$RemoteLauncher$KillTask.call(Launcher.java:1081)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
at java.lang.Thread.run(Unknown Source)
Caused: java.io.IOException: Remote call on JNLP4-connect connection from socautovm1.xxx.local/192.168.114.144:65033 failed
at hudson.remoting.Channel.call(Channel.java:961)
at hudson.Launcher$RemoteLauncher.kill(Launcher.java:1078)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1815)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
It seems that the agent is down. Check in which node the job runs and check its status. You may need to restart the node or even free some space in order to get it back online if the current status is offline.
I restarted the jenkins agent service and it resolved the issue. (/service/jenkins-agent)
I was having a similar issue when trying to run a Job on Jenkins that fetches the list of containers on a Slave node.
Whenever I run the job I get the error below:
ERROR: Issue with creating launcher for agent Linux1(Docker). The agent is being disconnected
[EnvInject] - Loading node environment variables.
ERROR: SEVERE ERROR occurs
org.jenkinsci.lib.envinject.EnvInjectException: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on Linux1(Docker) failed. The channel is closing down or has closed down
Here's how I fixed it:
I simply restarted the Jenkins service on the main/master node.
For Windows servers:
Search for Services and then locate the Jenkins service and restart it.
For Linux servers:
You might need to use Systemd (sudo systemctl restart jenkins)
That's all.
I hope this helps

Sonar + Jenkins job execution error

It's been a week since I tried to deploy this solution locally on my machine and then deploy it to a production server.
However, I faced many difficulties and incomprehension, that is what I did:
Sonar installation via apt-get and launch of it on port 9000 of localhost.
Installation of Jenkins via apt-get and launch of it on port 8080 of localhost.
Download the Sonar plugin for Jenkins.
After trying to running a job, it failed because :
ERROR: Error during SonarQube Scanner execution org.sonarqube.ws.client.HttpException:
The full error stack is:
ERROR: Error during SonarQube Scanner execution
org.sonarqube.ws.client.HttpException: Error 500 on http:/localhost:9000/api/ce/submit?projectKey=sonar.org:projectname&projectName=devops : {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:36)
at org.sonar.scanner.bootstrap.ScannerWsClient.failIfUnauthorized(ScannerWsClient.java:106)
at org.sonar.scanner.bootstrap.ScannerWsClient.call(ScannerWsClient.java:75)
at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:177)
at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:131)
at org.sonar.scanner.phases.PublishPhaseExecutor.publishReportJob(PublishPhaseExecutor.java:72)
at org.sonar.scanner.phases.PublishPhaseExecutor.executeOnRoot(PublishPhaseExecutor.java:54)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:262)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:247)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
http://localhost:9000/api/ce/submit?projectKey=sonar.org:projectname&projectName=devops
: {"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}
When I searched on the SonarQube logs I saw that :
2017.05.02 23:35:25 ERROR web[AVvKZ3JA+DB4lMWaAACV][o.s.s.w.WebServiceEngine] Fail to process
request http:/localhost:9000/api/qualityprofiles/restore
java.lang.IllegalStateException: Can't read file part at
org.sonar.server.ws.ServletRequest.readPart(ServletRequest.java:102)
...
Caused by: java.io.IOException: The temporary upload location [/root/Documents/sonarqube-6.3.1/temp/tc/work/Tomcat/localhost/ROOT] is not valid
As seen in "The temporary upload location is not valid", make sure that the folder /root/Documents/sonarqube-6.3.1/temp/tc/work/Tomcat/localhost/ROOT
does exist
is 775 by the user running Sonar.
Or (as seen here) you can define the temporary folder to another location
JVM_OPTIONS="-Xrs -Xms256m -Xmx512m -Djava.io.tmpdir=/opt/another/tmp"
See this thread and this thread as examples.

How to prevent Jenkins from resuming an aborted job

I had aborted a job by clicking the [x] button next to it's name in the Build Executor Status panel of Jenkins, yet the job is still present and waiting.
Even when I restart Jenkins it will resume building. When I take a look at the console I see:
Sending interrupt signal to process Click here to forcibly terminate
running steps java.io.IOException: Aborting build at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at Script1.run(Script1.groovy:1) at
groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) [SNIP]
Finished: ABORTED Resuming build at Tue Oct 25 14:56:36 CDT 2016 after
Jenkins restart
I believe this version of my Pipeline script also included an "Input" block, it's possible the job was aborted as it was waiting for Input if that makes a difference
I clean these up by going Manage Jenkins -> Script Console and then putting in code like this:
Jenkins.instance.getItemByFullName(
"tpr-ereg")
.getBuildByNumber(24).
finish(hudson.model.Result.ABORTED,
new java.io.IOException("Aborting build"));
NOTE: the above may need to be all on one line in the Script Console

Resources