Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins Server Fails to Start or Displays Error #14

Closed
pcorliss opened this issue Apr 11, 2022 · 7 comments
Closed

Jenkins Server Fails to Start or Displays Error #14

pcorliss opened this issue Apr 11, 2022 · 7 comments

Comments

@pcorliss
Copy link

pcorliss commented Apr 11, 2022

M1 Mac running OS X 12.3.1. Tried with both docker experimental features off and on.

In some cases requests just hang. In other cases Jenkins starts but displays the error below. The Jenkins server appears to get further on the second boot after running docker-compose up jenkins_server jenkins_agent.

➜  cicd-goat docker --version
Docker version 20.10.14, build a224086
➜  cicd-goat docker-compose --version
Docker Compose version v2.4.1

Jenkins Server Logs:

Hangs:

jenkins-server  | [WARN  tini (10)] Tini is not running as PID 1 and isn't registered as a child subreaper.
jenkins-server  | Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
jenkins-server  | To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
jenkins-server  | Running from: /usr/share/jenkins/jenkins.war
jenkins-server  | webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")

Starts but displays error:

java.io.FileNotFoundException: /var/jenkins_home/jobdsl/white-rabbit.groovy (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:2388)
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:2506)
	at javaposse.jobdsl.plugin.casc.FromFileScriptSource.getScript(FromFileScriptSource.java:23)
	at javaposse.jobdsl.plugin.casc.SeedJobConfigurator.lambda$getScriptFromSource$becf3cba$1(SeedJobConfigurator.java:125)
	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
	at javaposse.jobdsl.plugin.casc.SeedJobConfigurator.getScriptFromSource(SeedJobConfigurator.java:125)
	at javaposse.jobdsl.plugin.casc.SeedJobConfigurator.lambda$configure$2(SeedJobConfigurator.java:69)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:550)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:517)
	at javaposse.jobdsl.plugin.casc.SeedJobConfigurator.configure(SeedJobConfigurator.java:71)
	at javaposse.jobdsl.plugin.casc.SeedJobConfigurator.configure(SeedJobConfigurator.java:32)
	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$configureWith$6(ConfigurationAsCode.java:768)
	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:712)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:768)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:637)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:306)
	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:298)
Caused: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109)
Caused: java.lang.Error
	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:115)
	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1156)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused: org.jvnet.hudson.reactor.ReactorException
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:291)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1191)
	at jenkins.model.Jenkins.<init>(Jenkins.java:981)
	at hudson.model.Hudson.<init>(Hudson.java:86)
	at hudson.model.Hudson.<init>(Hudson.java:82)
	at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused: hudson.util.HudsonFailedToLoad
	at hudson.WebAppMain$3.run(WebAppMain.java:264)
@pcorliss
Copy link
Author

After a few more attempts I added platform: "linux/amd64" to the jenkins_server section. Removed all volumes via docker-compose down && docker volume ls -q | xargs docker volume rm and then started just the jenkins server via docker-compose up jenkins_server and waited for it to full boot and begin scanning for repositories.

Then I started the rest of the services with docker-compose up

@TupleType
Copy link
Collaborator

Thank you for your feedback. I've checked your solution on another Mac with M1 and it did work. I'll update the readme temporarily and i'll try to issue a fix soon so it could boot up along side the other services.

@adirisrael
Copy link

Hi im running the containers on debian
and got this error also

Screen Shot 2022-04-13 at 11 58 23

@TupleType
Copy link
Collaborator

TupleType commented Apr 13, 2022

If the method above didn't work you can try as a temporary fix to replace sleep 120 with something longer here: https://github.com/cider-security-research/cicd-goat/blob/main/jenkins-server/cleanup and rebuild the project according to the instructions in the development section. Another possible way is to delete the whole line and just don't look into those files because they contain spoilers.
Increasing the docker resources might also solve this problem.

@TupleType
Copy link
Collaborator

Hey @pcorliss @adirisrael,
I've released a fix for these issues. According to my tests it works on Mac m1 and Debian, please let me know if the fix also works for you.

@pcorliss
Copy link
Author

pcorliss commented Apr 26, 2022

@asi-cider thanks for releasing the update but unfortunately I'm still seeing bad results. However what is working for me is disabling AppNap on my machine. I use the following aliases. When AppNap is disabled it seems to work reliably. Likely some sort of lower level issue not specific to this project.

alias appnapoff="defaults write NSGlobalDomain NSAppSleepDisabled -bool YES"
alias appnapon="defaults write NSGlobalDomain NSAppSleepDisabled -bool NO"

@huornlmj
Copy link

I'm getting the same issue on a number of different Ubuntu 20.04 and 22.04's (jenkins-server | [WARN tini (10)] Tini is not running as PID 1 and isn't registered as a child subreaper.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants