Facing issue with jenkins: label name not recognized by sync command

478 views Asked by At

I am trying to run a Jenkins job sequentially using the curl command. And facing some odd issue. Where in only the last mentioned job is executing and others are failing with below exception.

My Problem is,

Let's say I have two CLs to create an RPM Run a curl command with First CL and build parameters in Jenkins server. It will fail for the first CL.

Run a curl command with second CL and build parameters in Jenkins server, it will go fine and create an RPM.

And below is the exception I will get,

Caught exception communicating with perforce. Errors encountered while force syncing: error: Invalid changelist/client/label/date '@cobrands.razor12.FIS.prod.20150609_build_01
com.tek42.perforce.PerforceException: Errors encountered while force syncing: error: Invalid changelist/client/label/date '@cobrands.razor12.FIS.prod.20150609_build_01

    at com.tek42.perforce.parse.Workspaces.syncTo(Workspaces.java:167)
    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:1001)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1369)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
    at hudson.model.Run.execute(Run.java:1575)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:241)

But with the same set of parameters, I run manually the Jenkins job. It will go fine.

Can anyone please help here?

1

There are 1 answers

3
Bryan Pendleton On

It's interesting that only the final sync command is working, and the earlier one isn't.

I think the best step is to contact your Perforce server administrator, and gain access to the Perforce server log, which can be used to capture the exact commands you are running against the server, in what order, and with what arguments and configuration settings. (Ask your administrator to make sure P4LOG is set, and that the 'server' log setting is at least at level 1.)

Some possibilities that occur to me, with the limited information currently available, are:

  1. Perhaps the label in question (cobrands.razor12.FIS.prod.20150609_build_01) is created mid-way through the job, and so it is available near the end of the Jenkins job, but not earlier in the job.
  2. Perhaps the different steps in the jobs are using different arguments and configuration settings (P4USER, P4CLIENT, etc.) and so the earlier command is invalid but subsequent commands are correct.

Since the label in question is available now, but apparently was not available when the 'sync -f @cobrands.razor12.FIS.prod.20150609_build_01' command failed, the label was probably created after that command was issued. Your server log (and your spec depot, if your server administrator has enabled it) will allow you to figure out when the label was created and why it wasn't available to the first 'sync -f' command that you issued.