falldamagestudio / UE-Jenkins-BuildSystem

Build Unreal Engine & games with Jenkins on GKE/GCE
MIT License
46 stars 11 forks source link

Dynamic agent operation tracking error: `java.lang.IllegalArgumentException: Parameter zone must conform to the pattern [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` #50

Closed Kalmalyzer closed 3 years ago

Kalmalyzer commented 3 years ago

This happens after starting a linux non-docker dynamic VM job (waiting for a node to get provisioned - it fails with #49 - a second node gets provisioned successfully). The second time I'm triggering the same job, Jenkins spits out these when trying to provision:

Aug 29, 2021 9:12:40 PM INFO com.google.jenkins.plugins.computeengine.ComputeEngineCloud provision
Provisioning node from configs [com.google.jenkins.plugins.computeengine.InstanceConfiguration@f42b4cf] for excess workload of 1 units of label 'build-game-linux-git-dynamic'
Aug 29, 2021 9:12:40 PM INFO com.google.jenkins.plugins.computeengine.ComputeEngineCloud availableNodeCapacity
Found capacity for 10 nodes in cloud GCE
Aug 29, 2021 9:12:40 PM SEVERE hudson.triggers.SafeTimerTask run
Timer task hudson.slaves.NodeProvisioner$NodeProvisionerInvoker@55e6c0cc failed
java.lang.IllegalArgumentException: Parameter zone must conform to the pattern [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?
    at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:125)
    at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:49)
    at com.google.api.services.compute.Compute$ZoneOperations$Get.<init>(Compute.java)
    at com.google.api.services.compute.Compute$ZoneOperations.get(Compute.java)
    at com.google.jenkins.plugins.computeengine.client.ComputeClient2.getZoneOperation(ComputeClient2.java:33)
    at com.google.jenkins.plugins.computeengine.InstanceOperationTracker.isZoneOperationDone(InstanceOperationTracker.java:118)
    at com.google.jenkins.plugins.computeengine.InstanceOperationTracker.lambda$removeCompletedOperations$0(InstanceOperationTracker.java:142)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
    at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1603)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at com.google.jenkins.plugins.computeengine.InstanceOperationTracker.removeCompletedOperations(InstanceOperationTracker.java:144)
    at com.google.jenkins.plugins.computeengine.InstanceOperationTracker.removeCompleted(InstanceOperationTracker.java:155)
    at com.google.jenkins.plugins.computeengine.ComputeEngineCloud.provision(ComputeEngineCloud.java:407)
    at com.google.jenkins.plugins.computeengine.NoDelayProvisionerStrategy.apply(NoDelayProvisionerStrategy.java:85)
    at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:335)
    at hudson.slaves.NodeProvisioner.access$900(NodeProvisioner.java:65)
    at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:826)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:91)
    at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

What's going on? Why does the zone field no longer contain a sensible string? Should this prevent the provisioning from proceeding, or should the plugin catch these errors, print them to the log, and carry on?

Kalmalyzer commented 3 years ago

This is likely a cascade effect; #49 occurred for an instance, then that instance is not completely initialized, then this occurs.

Kalmalyzer commented 3 years ago

It was a separate bug; fixed in https://github.com/falldamagestudio/UE-Jenkins-Images/commit/b76a6cbebc5ceed082fc21bd89ab0d292b7b4e88.