我正在尝试从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
答案 0 :(得分:0)
好像您无法访问这些文件。也许以管理员身份运营或更改所有者?
答案 1 :(得分:0)
我知道在某些情况下需要的可能解决方案是通过以下方式启用管理员权限:创建可执行文件的快捷方式,然后右键单击快捷方式 - &gt;属性 - &gt;高级 - &gt;检查&#34;以管理员身份运行&#34;。然后只需在脚本中定位快捷方式,交叉手指并在椅子上旋转3次。
(由于可怕的语法而编辑。)
答案 2 :(得分:0)
可能有几种方法可以解决这个问题
詹金斯论坛中提到的
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”作为“管理员”启动
2.找到以下注册表项:HKEY_CLASSES_ROOT \ CLSID \ {76A64158-CB41-11D1-8B02-00600806D9B6}
3.右键单击并选择“权限”
4.将所有者更改为管理员组
5.更改管理员组的权限 - &gt;授予完全控制权
6.将所有者更改回TrustedInstaller(用户是“NT Service \ TrustedInstaller”)
7.重新启动远程注册表服务
8.从http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5582在从站上安装vcredist 2008
9.确保在PATH中设置了java可执行文件。