1

我在主机(Windows)上安装了 Jenkins,并与 Ubuntu 机器(Ubuntu 12.04)上的节点连接。它们已经一起运行了好几个月,但是几周前我开始遇到特定 Rails 项目的问题,这些项目应该在 Ubuntu 机器上运行测试。尽管已经安装了它,但它开始需要一些 rb-readline gem。

所以我决定将 /var/lib/jenkins/.rvm 目录移动到其他位置以强制重新安装 RVM。然后我从 Jenkins 中删除了 RVM 插件并再次添加它。毕竟,我让它重新安装了 RVM,但现在它无法在 RVM 环境中执行任何任务。如果我取消选中“在 RVM 管理的环境中运行构建”选项,则可以完成任务而不会出现错误(如果我删除了特定的构建步骤),但是如果设置了此选项,它甚至无法运行简单的echo test命令。

我将移动的 .rvm 目录返回到 /var/lib/jenkins/,但这无助于恢复所有内容。

这是错误消息(您可能会询问/var/lib/jenkins/workspace/my-project目录 - 是的,它存在):

Started by user Name Name
Building remotely on Web tests in workspace /var/lib/jenkins/workspace/my-project
Checkout:my-project / /var/lib/jenkins/workspace/my-project - hudson.remoting.Channel@299bf5:Web tests
Using strategy: Default
Last Built Revision: Revision c595dcs8fthse8tw985t80wt5bst6volw8ebtt9g (origin/master)
Checkout:my-project / /var/lib/jenkins/workspace/my-project - hudson.remoting.LocalChannel@48283482
Fetching changes from 1 remote Git repository
Fetching upstream changes from https://TheUser:ThePassword@github.com/MyFirm/my-project.git
Commencing build of Revision c595dcs8fthse8tw985t80wt5bst6volw8ebtt9g (origin/master)
Checking out Revision c595dcs8fthse8tw985t80wt5bst6volw8ebtt9g (origin/master)
Capturing environment variables produced by 'rvm use 1.9.3'
$ bash -c export
$ bash -c "test ! -f ~/.rvm/scripts/rvm"
[my-project] $ bash -c "source ~/.rvm/scripts/rvm && rvm_install_on_use_flag=1 && rvm use --create 1.9.3 && export > rvm.env"
FATAL: Native Exception: 'class java.io.IOException'; Message: Cannot run program "bash" (in directory "\var\lib\jenkins\workspace\my-project"): java.io.IOException: error=2, No such file or directory; StackTrace: java.io.IOException: Cannot run program "bash" (in directory "\var\lib\jenkins\workspace\my-project"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:932)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:899)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:287)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

org.jruby.exceptions.RaiseException: Native Exception: 'class java.io.IOException'; Message: Cannot run program "bash" (in directory "\var\lib\jenkins\workspace\my-project"): java.io.IOException: error=2, No such file or directory; StackTrace: java.io.IOException: Cannot run program "bash" (in directory "\var\lib\jenkins\workspace\my-project"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:932)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:899)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:287)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
Caused by: java.io.IOException: Cannot run program "bash" (in directory "\var\lib\jenkins\workspace\my-project"): java.io.IOException: error=2, No such file or directory
    ... 5 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:932)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:899)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:287)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

在这台 Ubuntu 机器上直接安装了另一个 Jenkins 实例,如果我运行这个项目的构建,它会给我一个输出,就像之前损坏的 Jenkins 实例一样:Please 'gem install rb-readline' or recompile ruby --with-readline但不会抱怨 Java。因此,在 Ubuntu 网站上,一切似乎都没有损坏。

4

0 回答 0