containers icon indicating copy to clipboard operation
containers copied to clipboard

Jenkins I/O Exception at start

Open RobinD42 opened this issue 3 years ago • 1 comments

Name and Version

bitnami/jenkins:2.346.2

What steps will reproduce the bug?

  1. I updated from a 2.332.3 image
  2. When I bring up the new version is fails with the log contents shown below

What is the expected behavior?

I expected it to run successfully

What do you see instead?

In the docker log:

jenkins 21:29:11.27 
jenkins 21:29:11.27 Welcome to the Bitnami jenkins container
jenkins 21:29:11.27 Subscribe to project updates by watching https://github.com/bitnami/containers
jenkins 21:29:11.27 Submit issues and feature requests at https://github.com/bitnami/containers/issues
jenkins 21:29:11.27 
jenkins 21:29:11.28 INFO  ==> ** Starting Jenkins setup **
jenkins 21:29:11.32 INFO  ==> Detected data from previous deployments
find: '/docker-entrypoint-initdb.d/': No such file or directory
jenkins 21:29:11.32 INFO  ==> ** Jenkins setup finished! **

jenkins 21:29:11.33 INFO  ==> ** Starting Jenkins **
Running from: /opt/bitnami/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2022-08-04 21:29:11.713+0000 [id=1]	INFO	org.eclipse.jetty.util.log.Log#initialized: Logging initialized @354ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-08-04 21:29:11.777+0000 [id=1]	INFO	winstone.Logger#logInternal: Beginning extraction from war file
2022-08-04 21:29:17.738+0000 [id=1]	INFO	winstone.Logger#logInternal: Jetty shutdown successfully
java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
	at winstone.Launcher.spawnListener(Launcher.java:261)
	at winstone.Launcher.<init>(Launcher.java:190)
	at winstone.Launcher.main(Launcher.java:405)
	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 Main._main(Main.java:342)
	at Main.main(Main.java:117)
Caused by: winstone.WinstoneException: Please set --httpsKeyStore
	at winstone.AbstractSecuredConnectorFactory.configureSsl(AbstractSecuredConnectorFactory.java:88)
	at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:54)
	at winstone.Launcher.spawnListener(Launcher.java:255)
	... 8 more
2022-08-04 21:29:17.739+0000 [id=1]	SEVERE	winstone.Logger#logInternal: Container startup failed
winstone.WinstoneException: Please set --httpsKeyStore
	at winstone.AbstractSecuredConnectorFactory.configureSsl(AbstractSecuredConnectorFactory.java:88)
	at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:54)
	at winstone.Launcher.spawnListener(Launcher.java:255)
Caused: java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
	at winstone.Launcher.spawnListener(Launcher.java:261)
	at winstone.Launcher.<init>(Launcher.java:190)
	at winstone.Launcher.main(Launcher.java:405)
	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 Main._main(Main.java:342)
	at Main.main(Main.java:117)

Which repeats until I stop the container. (Due to my restart: unless-stopped directive in the docker-compose.yml file I suppose.)

Additional information

Where do I set --httpsKeyStore?

RobinD42 avatar Aug 04 '22 21:08 RobinD42

Could you please share with us the docker-compose.yaml you are using? What was the method used for upgrading?

carrodher avatar Aug 05 '22 06:08 carrodher

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] avatar Aug 21 '22 01:08 github-actions[bot]

Here is my docker-compose.yml file:

version: "2.1"
services:
  jenkins:
    image: custom/jenkins:$VERSION
    restart: unless-stopped
    container_name: jenkins-b
    hostname: 'jenkins-b'
    networks:
      - network1
    environment:
      - JENKINS_OPTS=--prefix=/jenkins
      - JENKINS_HOME=/bitnami/jenkins/home
      - JENKINS_HTTP_PORT_NUMBER=8080
      - JENKINS_HTTPS_PORT_NUMBER=8443
      - JENKINS_EXTERNAL_HTTP_PORT_NUMBER=8080
      - JENKINS_EXTERNAL_HTTPS_PORT_NUMBER=8443
      - JENKINS_JNLP_PORT_NUMBER=50000
      - JENKINS_FORCE_HTTPS=no
    volumes:
      - '$DATA_DIR/jenkins-b/home:/bitnami/jenkins/home'
    ports:
      - 8080:8080
      - 8443:8443
      - 50000:50000

networks:
  network1:
    external: true
    name: nginx-net

It is using an image with a couple of slight modifications. First, it adds an actual user account and group for user ID 1001. Next, it makes a slight modification to run.sh to add the JENKINS_OPTS shown above to the jenkins.war command line. I did try bringing up a new container with the same data but without my customized image, but I had the same or similar error messages.

Here is the Dockerfile with my tweaks:

ARG VERSION
FROM docker.io/bitnami/jenkins:$VERSION

# The bitnami container runs as UID 1001, but there isn't an actual user
# account, so add a user named jenkins with the $JENKINS_HOME as its home
# folder.
USER root
ENV JENKINS_HOME /bitnami/jenkins/home
RUN groupadd -g 1001 jenkins; \
    useradd -N --home-dir ${JENKINS_HOME} --uid 1001 --gid 1001 jenkins; \
    chown -R jenkins:jenkins ${JENKINS_HOME}

# Override run.sh with our slightly tweaked copy
RUN cp /opt/bitnami/scripts/jenkins/run.sh /opt/bitnami/scripts/jenkins/run.sh.orig
COPY tweaks/run.sh /opt/bitnami/scripts/jenkins/run.sh

USER jenkins
ENV HOME ${JENKINS_HOME}
RUN cd ${JENKINS_HOME}

This container is run behind an nginx-based reverse proxy set up to handle the SSL. With 2.332.3 the proxy setup works fine so I don't think it would be a contributing factor to this problem, but I mention it here just in case.

RobinD42 avatar Aug 22 '22 18:08 RobinD42

It seems it is not an issue related to the Bitnami Jenkins container image but about how the application or environment is being used/configured.

For information regarding the application itself, customization of the content within the application, or questions about the use of technology or infrastructure; we highly recommend checking forums and user guides made available by the project behind the application or the technology.

That said, we will keep this ticket open until the stale bot closes it just in case someone from the community adds some valuable info.

carrodher avatar Aug 23 '22 06:08 carrodher

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] avatar Sep 08 '22 01:09 github-actions[bot]

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

github-actions[bot] avatar Sep 13 '22 01:09 github-actions[bot]