Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Server error when using a p4 repository with stream and scripted client name #4208

kururin ·

Hello

QB: 8.0.20

We have the following perforce repository definition:

  • Client Name = "Use specified client name"

${groovy:
def date = new Date();
def formattedDate = date.format("yyMMddHHmmss");
return "Client_" + formattedDate;
}

  • Client Specification = "Create client based on specified stream" = "//tgt-streams/main"
    There's no error in this client specification. We use the same at many places in QB and it never raised any issue.

When launching the build using this repository, the workspace is created as expected BUT the build does not start and the server returns this error:"Error executing check condition job. Caused by: The validated object is null"

Callstack:

2020-03-02 14:59:30,819 [pool-1-thread-136895] ERROR com.pmease.quickbuild.DefaultBuildEngine - Error processing build request.
java.lang.RuntimeException: Error executing check condition job.
    at com.pmease.quickbuild.CheckConditionTask.reduce(CheckConditionTask.java:39)
    at com.pmease.quickbuild.CheckConditionTask.reduce(CheckConditionTask.java:16)
    at com.pmease.quickbuild.grid.GridTaskFuture.get(GridTaskFuture.java:155)
    at com.pmease.quickbuild.DefaultBuildEngine.process(DefaultBuildEngine.java:395)
    at com.pmease.quickbuild.DefaultBuildEngine.access$000(DefaultBuildEngine.java:143)
    at com.pmease.quickbuild.DefaultBuildEngine$2.run(DefaultBuildEngine.java:1233)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: The validated object is null
    at org.apache.commons.lang.Validate.notNull(Validate.java:222)
    at com.pmease.quickbuild.plugin.scm.perforce.Mapping.parseView(Mapping.java:73)

Workaround: it works if we switch the "Client Specification" to "Input client specification" with the view: "//tgt-streams/main/... //client/..."
But it makes no sense because //tgt-streams/main is a stream so the result will be a perforce client not fully funcitonal.

Do you have any idea of what's going on?

Thank you!
Mathieu

  • solved #4
  • replies 4
  • views 72
  • stars 0
robinshen ADMIN ·

Using client name with this script is problematic as:

  1. QB gets a different client name each time evaluating it even inside same build
  2. There is a possibility of using same client name (although rare, but possible) on different client for concurrent build steps
  3. More and more perforce clients will be leave behind uncleaned as builds runs

Any particular reason you want to use this timestamped client name instead of the default root directory and node based client name

kururin ·

I'm well aware of risks but that's what I want to do: being sure that a new client is created each time this configuration is launched.
I'll have another process in charge of cleaning old clients.

I could probably find another way to achieve that but I don't think the behavior I described above is normal. It looks like a bug.

robinshen ADMIN ·

QB expects client name to remain unchanged across the build, but now it is changing every time QB accesses it. So the error checking code crashes notifying of the problem, as otherwise other odd issues will occur. If you want to use different client name for each run of a configuration, do it this way:

  1. In pre-queue script of the configuration, generate the clientName one time like below:
    groovy:
    def date = new Date();
    def formattedDate = date.format("yyMMddHHmmss");
    request.variables["clientName"] = "Client_" + formattedDate;
  2. Configure client name of the repository to use specified client name as below:
    ${vars.getValue("clientName")}
kururin ·

Actually it's exactly what I did yesterday but I didn't switch back to "Client Specification = Create client based on specified stream" in the repo configuration.
Indeed it works even with the stream configuration.

Thanks Robin.