gpt4 book ai didi

java - Jenkins启动错误: jenkins. model.InvalidBuildsDir : does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR},无法区分项目

转载 作者:行者123 更新时间:2023-12-01 16:23:46 30 4
gpt4 key购买 nike

请帮忙。在我们的工作流程中,我们仅使用预打包的离线部署,我们没有 root 访问权限,因此使用supervisord 来停止启动所有包。我们在用户帐户下部署所有包。我创建了一个自定义 Jenkins 包。它基本上是一个文件夹,其中包含 Jenkins war 文件和我使用普通初始设置时的配置。

到目前为止我的安装已经成功。似乎第一次尝试让事情运行起来似乎很不稳定。一旦运行 Jenkins 就可以了。这次我尝试部署包(它们没有改变),但是我无法启动 Jenkins 并出现错误:

jenkins.model.InvalidBuildsDir:不包含${ITEM_FULL_NAME}或${ITEM_ROOTDIR},无法区分项目

所以我所做的就是运行全新安装并将其打包。基本上我解压 jenkins 目录,然后使用supervisord 来控制启动/停止。

Supervisord 配置:

[program:jenkins]
autorestart = true
autostart = true
command = /bin/bash -c "set JENKINS_HOME=/opt/home/svc_user/opskit/jenkins; /opt/home/svc_user/opskit/jdk/bin/java -Djava.awt.headless=true -Djenkins.model.Jenkins.buildsDir=/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME} -Djenkins.model.Jenkins.workspacesDir=/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME} -jar /opt/home/svc_user/opskit/jenkins/bin/jenkins.war -path=/opt/home/svc_user/opskit/jenkins"
directory = /opt/home/svc_user/opskit/jenkins
redirect_stderr = true
stdout_logfile = /opt/home/svc_user/opskit/log/jenkins.log
stdout_logfile_backups = 5
stdout_logfile_maxbytes = 10MB
stopwaitsecs = 300

完整错误:

jenkins.model.InvalidBuildsDir: /opt/home/svc_user/data/jenkins/builds does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects
at jenkins.model.Jenkins.checkRawBuildsDir(Jenkins.java:3179)
at jenkins.model.Jenkins.setBuildsAndWorkspacesDir(Jenkins.java:3135)
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3123)
Caused: java.io.IOException
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3125)
at jenkins.model.Jenkins.access$1200(Jenkins.java:320)
at jenkins.model.Jenkins$13.run(Jenkins.java:3219)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1133)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused: org.jvnet.hudson.reactor.ReactorException
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1166)
at jenkins.model.Jenkins.<init>(Jenkins.java:966)
at hudson.model.Hudson.<init>(Hudson.java:85)
at hudson.model.Hudson.<init>(Hudson.java:81)
at hudson.WebAppMain$3.run(WebAppMain.java:233)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:250)

Jenkins config.xml:

<workspaceDir>/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME}</workspaceDir>
<buildsDir>/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME}</buildsDir>

文件夹权限(安装目录):

lrwxrwxrwx  1 svc_user svc_user   39 Jun  4 02:51 jenkins -> /opt/home/svc_user/opskit/jenkins-2.222.3
drwxr-xr-x 13 svc_user svc_user 4096 May 1 05:07 jenkins-2.222.3

文件夹权限(构建和工作区的自定义目录):

lrwxrwxrwx 1 svc_user svc_user 37 Jun  4 02:51 jenkins -> /opt/home/svc_user/data/jenkins-2.222.3
drwxr-xr-x 4 svc_user svc_user 37 Jun 4 16:39 jenkins-2.222.3

|-nginx-1.16.1
|-jdk-8u91
|-jenkins-2.222.3
| |-builds
| |-workspace

帮助将不胜感激。预先感谢您。

最佳答案

修改此:

command = /bin/bash -c "JENKINS_HOME=/opt/home/svc_user/opskit/jenkins /opt/home/svc_user/opskit/jdk/bin/java...

^^与修复无关,只是启动 1 个 java 进程而不是 2 个。

已删除:

-Djenkins.model.Jenkins.buildsDir=/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME} 

-Djenkins.model.Jenkins.workspacesDir=/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME}

^^修复了我的启动问题。不确定为什么这些对以前的安装没有负面影响。

同时删除:

path=/opt/home/svc_user/opskit/jenkins

似乎没有必要。

́_(ツ)_/́

关于java - Jenkins启动错误: jenkins. model.InvalidBuildsDir : does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR},无法区分项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62202315/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com