一千萬個為什麽

搜索

如果在安裝slave-agent.jnlp文件時出現錯誤,Windows服務器如何能成為在Linux上運行的Jenkins的奴隸?



我想擁有一個運行在Red Hat Enterprise Linux 7.x上的主Jenkins(版本2.89.2)的Windows Server 2016從節點。我正嘗試從Windows服務器上的Jenkins Web UI安裝slave-agent.jnlp文件。我以管理員身份運行以PowerShell打開的此命令:

javaws -verbose C:\Users\Administrator\Downloads\slave-agent.jnlp

我收到此錯誤:

Error: The field  has an invalid value:

Launch File

<title>Agent for FQDNofWindowsSlave</title>Jenkins project32ba31ca5f150c2b3491802b0b60e56574d970a9e601cebad656a113fe325a85FQDNofWindowsSlave-workDir-internalDir-urlhttp://FQDNofJenkinsServer:8080/


Exception

BadFieldException[ The field  has an invalid value: ,]
    at com.sun.javaws.jnl.XMLFormat$10.visitElement(Unknown Source)
    at com.sun.javaws.jnl.XMLUtils.visitElements(Unknown Source)
    at com.sun.javaws.jnl.XMLFormat.buildApplicationDesc(Unknown Source)
    at com.sun.javaws.jnl.XMLFormat.process(Unknown Source)
    at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

我希望命令能夠奏效。我不明白錯誤消息。我該怎麽辦?

轉載註明原文: 如果在安裝slave-agent.jnlp文件時出現錯誤,Windows服務器如何能成為在Linux上運行的Jenkins的奴隸?

一共有 2 個回答:

你有兩個空的參數:


  32ba31ca5f150c2b3491802b0b60e56574d970a9e601cebad656a113fe325a85
  FQDNofWindowsSlave
  -workDir
  
  -internalDir
  
  -url
  http://FQDNofJenkinsServer:8080/

您的錯誤消息中有一個逗號:

BadFieldException [該字段有一個   無效值:,]

互聯網上的其他錯誤的參數錯誤消息有逗號分隔的錯誤參數列表:

BadFieldException [字段代碼庫有一個無效的值:   $$基本代碼,代碼庫$$]

所以我猜想這兩個空論點是問題。

Jenkins provides the agent.jar, and secret required to make a connection from the node to the master. Make sure the node is configured properly (Manage Jenkins -> Manage Nodes -> Node)

enter image description here

確保Windows代理上存在Java 1.8。在windows計算機上下載agent.jar文件,並使用Windows命令提示符運行Jenkins提供的命令。

java -jar agent.jar -jnlpUrl http://localhost:8080/computer/example/slave-agent.jnlp -secret e6073ce49423ed54df4a24f918973f50dc760dd440013d3b30403c4a2c7501fd -workDir "c:\jenkins"