簡體   English   中英

Jenkins奴隸無法安裝jdk

[英]Jenkins slave cannot install jdk

我正在嘗試從Windows奴隸上的Jenkins作業運行一些基本的批處理命令,但似乎Jenkins無法安裝jdk。

由於它表示CreateProcess error=740, The requested operation requires elevation我嘗試運行以管理員身份登錄的從屬設備並在Windows中完全禁用UAC而沒有成功。

讓這個工作的任何線索? 我正在運行Windows 8。

編輯:我嘗試將C:\\Jenkins\\tools\\hudson.model.JDK\\Java_SE_Development_Kit_8u60\\jdk為始終以管理員身份運行所有用戶。 這沒有用。 當我嘗試在cmd.exe中本地運行jdk時,它確實運行沒有錯誤。

這是完整的堆棧跟蹤:

Installing C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60\jdk.exe
[Java_SE_Development_Kit_8u60] $ C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60\jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60 /L C:\Jenkins\tools\hudson.model.JDK\install4140010637459422013log
Unknown error (0x2e4)
FATAL: command execution failed
java.io.IOException: Cannot run program "C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60\jdk.exe" (in directory "C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60"): CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:69)
    at java.lang.Thread.run(Unknown Source)
    at ......remote call to ToonBed(Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1413)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
    at hudson.remoting.Channel.call(Channel.java:778)
    at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$ProcStarter.join(Launcher.java:389)
    at hudson.tools.JDKInstaller.install(JDKInstaller.java:268)
    at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:141)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
    at hudson.model.JDK.forNode(JDK.java:132)
    at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:359)
    at hudson.model.Run.getEnvironment(Run.java:2234)
    at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:935)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:90)
    at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.Build$BuildExecution.build(Build.java:205)
    at hudson.model.Build$BuildExecution.doRun(Build.java:162)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:69)
    at java.lang.Thread.run(Unknown Source)
Build step 'Execute Windows batch command' marked build as failure
Robot results publisher started...
-Parsing output xml:
Installing C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60\jdk.exe
[Java_SE_Development_Kit_8u60] $ C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60\jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60 /L C:\Jenkins\tools\hudson.model.JDK\install2992849421630137437log
Failed!
java.io.IOException: Cannot run program "C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60\jdk.exe" (in directory "C:\Jenkins\tools\hudson.model.JDK\Java_SE_Development_Kit_8u60"): CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:69)
    at java.lang.Thread.run(Unknown Source)
    at ......remote call to ToonBed(Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1413)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
    at hudson.remoting.Channel.call(Channel.java:778)
    at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$ProcStarter.join(Launcher.java:389)
    at hudson.tools.JDKInstaller.install(JDKInstaller.java:268)
    at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:141)
    at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
    at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
    at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
    at hudson.model.JDK.forNode(JDK.java:132)
    at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:359)
    at hudson.model.Run.getEnvironment(Run.java:2234)
    at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:935)
    at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:234)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    at hudson.Launcher$ProcStarter.start(Launcher.java:382)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at hudson.remoting.Engine$1$1.run(Engine.java:69)
    at java.lang.Thread.run(Unknown Source)
Finished: FAILURE

好像您無法訪問這些文件。 也許作為管理員或更改所有者運行?

在某些情況下,我知道可能的解決方案是通過以下方式啟用管理員權限:創建可執行文件的快捷方式,然后右鍵單擊快捷方式 - >屬性 - >高級 - >選中“以管理員身份運行”。 然后只需在腳本中定位快捷方式,交叉手指並在椅子上旋轉3次。

(由於可怕的語法而編輯。)

可能有幾種方法可以解決這個問題。
詹金斯論壇中提到過
https://wiki.jenkins.io/display/JENKINS/Windows+slaves+fail+to+start+via+DCOM

最終對我有用的是
Jenkins需要完全訪問WBEM腳本定位器(HKEY_CLASSES_ROOT \\ CLSID {76A64158-CB41-11D1-8B02-00600806D9B6})。
管理員組的默認值只是讀取。
因此,我們需要將管理員組的權限更改為“完全控制”。
1.將'regedit.exe'作為'Administrator'啟動
2.找到以下注冊表項:HKEY_CLASSES_ROOT \\ CLSID \\ {76A64158-CB41-11D1-8B02-00600806D9B6}
3.右鍵單擊並選擇“權限”
4.將所有者更改為管理員組。
5.更改管理員組的權限 - >授予完全控制權限。
6.將所有者更改回TrustedInstaller(用戶是“NT Service \\ TrustedInstaller”)
7.重新啟動Remote Registry Service
8.從http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5582在奴隸上安裝vcredist 2008
9.確保在PATH中設置了java可執行文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM