哈德森未能开始

时间:2014-03-13 13:52:00

标签: java ant hudson hudson-plugins hudson-api

我已经成功地在Windows服务器上运行了hudson。需要重启哈德森服务。重启后我得到以下错误。任何想法,或者是否有人遇到过这个问题。

org.jvnet.hudson.reactor.ReactorException:     com.google.common.util.concurrent.UncheckedExecutionException:     java.lang.NullPointerException
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246)
    at hudson.model.Hudson.executeReactor(Hudson.java:719)
    at hudson.model.Hudson.<init>(Hudson.java:616)
    at org.eclipse.hudson.init.InitialRunnable.run(InitialRunnable.java:51)
    at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.common.util.concurrent.UncheckedExecutionException:     java.lang.NullPointerException
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2263)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874)
    at hudson.model.TopLevelItemsCache.get(TopLevelItemsCache.java:78)
    at hudson.model.LazyTopLevelItem.item(LazyTopLevelItem.java:144)
    at hudson.model.LazyTopLevelItem.hasPermission(LazyTopLevelItem.java:271)
    at hudson.model.Hudson.getItems(Hudson.java:1303)
    at hudson.model.Hudson.getItems(Hudson.java:223)
    at hudson.model.Hudson.getAllItems(Hudson.java:1367)
    at hudson.model.DependencyGraph.<init>(DependencyGraph.java:78)
    at hudson.model.Hudson.rebuildDependencyGraph(Hudson.java:3626)
    at hudson.model.Hudson$12.run(Hudson.java:2415)
    at     org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
    at hudson.model.Hudson$4.runTask(Hudson.java:699)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
    at     java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    ... 1 more
Caused by: java.lang.NullPointerException
    at hudson.model.RunMap.recalcLastStable(RunMap.java:469)
    at hudson.model.RunMap.recalcMarkers(RunMap.java:209)
    at hudson.model.RunMap.setBuilds(RunMap.java:199)
    at hudson.model.RunMap.putAllRunValues(RunMap.java:225)
    at hudson.model.RunMap.reset(RunMap.java:292)
    at hudson.model.RunMap.load(RunMap.java:640)
    at hudson.model.AbstractProject.onLoad(AbstractProject.java:329)
    at hudson.model.BaseBuildableProject.onLoad(BaseBuildableProject.java:91)
    at hudson.model.TopLevelItemsCache$1.load(TopLevelItemsCache.java:64)
    at hudson.model.TopLevelItemsCache$1.load(TopLevelItemsCache.java:57)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
    ... 20 more

非常感谢帮助!!

3 个答案:

答案 0 :(得分:1)

我有类似的问题。电力中断,一些文件被破坏。可以在没有任何工作的情况下启动Hudson(我将所有工作都移到了不同​​的目录中)。

所以我在$ HUDSON_HOME / jobs中查看了最新修改的作业并删除了

  • 清空nextBuildNumber文件
  • empty builds / _runmap.xml文件
  • 使用空build.xml和/或changelog.xml文件进行整个构建(builds / yyyy-MM-ss_HH-mm-ss目录和builds / xxx链接)

答案 1 :(得分:0)

这是我们在遇到相同情况时使用的快速黑客攻击:

#!/usr/bin/env python
"""Remove references from missing builds from all _runmap.xml files"""
from xml.dom.minidom import parse, parseString
import os
import glob

for buildRoot in glob.glob("/var/lib/hudson/jobs/*/builds/"):
    runmapFilename = buildRoot + "/_runmap.xml"
    if not os.path.exists(runmapFilename):
        continue

    dom = parse(runmapFilename)
    builds = dom.getElementsByTagName("builds")[0]
    changed = False
    for build in builds.getElementsByTagName("build"):
        buildDir = build.getElementsByTagName("buildDir")[0].childNodes[0].data
        if not os.path.exists(buildRoot + "/" + buildDir + "/build.xml"):
            changed = True
            print "missing", buildRoot, buildDir
            builds.removeChild(build)

    if changed:
        os.rename(runmapFilename, runmapFilename + ".org")
        f = open(runmapFilename, "w")
        f.write(dom.toxml())
        f.close()

答案 2 :(得分:0)

不幸的是,对于已经损坏的工作,似乎失去了历史。

为了恢复在线哈德森,我做了以下事情:

  • 完全删除了构建文件夹
  • 删除了指向lastS *
  • 的链接
  • 将nextBuildNumber设置为1

我希望这有帮助。