Jenkins尝试在Docker云节点上执行作业:'/'是不安全字符

cetgtptt  于 2023-08-03  发布在  Jenkins
关注(0)|答案(1)|浏览(129)

Jenkins系统日志:

Jul 14, 2023 7:56:31 AM INFO io.jenkins.docker.DockerTransientNode$2 println

Removed container 'aee593f554f96a40ac29269c6f5f80bc6368d7c6820aa899755064e485f6e41d' for node 'jenkins/agent:latest-alpine-jdk17-0000faawen3b3'.

Jul 14, 2023 7:56:38 AM SEVERE hudson.slaves.NodeProvisioner update

Unexpected uncaught exception encountered while processing agent jenkins/agent:latest-alpine-jdk17 (jenkins/agent:latest-alpine-jdk17)
hudson.model.Failure: ‘/’ is an unsafe character
    at jenkins.model.Jenkins.checkGoodName(Jenkins.java:4254)
    at jenkins.model.Nodes.addNode(Nodes.java:137)
    at jenkins.model.Jenkins.addNode(Jenkins.java:2230)
    at hudson.slaves.NodeProvisioner.update(NodeProvisioner.java:248)
    at hudson.slaves.NodeProvisioner$NodeProvisionerInvoker.doRun(NodeProvisioner.java:823)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:92)
    at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:67)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    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:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

字符串
Jenkins每X秒在Cloud Statistics中创建/删除docker容器并增加配置数量,其中X是docker云中docker代理模板的超时选项,同时尝试执行作业。
我只定义了一个示例容量为3的Docker云。
如果没有其他节点/云定义可用执行器,则作业执行状态在此期间将保持为“等待下一个可用执行器”。

ajsxfq5m

ajsxfq5m1#

在我的案例中,docker cloud中docker agent模板的Name参数包含'/',将其从名称中删除解决了问题,作业成功执行。

相关问题