"JWM is terminating, shutting down Jetty" in Jenkins Server running in Kubernetes

Viewed 272

I have a Jenkins Server running in my Kubernetes Cluster, And I've also has setup Persistent Volume for it, to store the configuration....

apiVersion: v1 
kind: PersistentVolume 
metadata:
  name: jenkins-server-persistent-volume 
  namespace: jenkins-namespace 
  labels:
    type: local 
spec:
  claimRef:
    name: jenkins-server-claim 
    namespace: jenkins-namespace 

  storageClassName: manual 
  accessModes:
    - ReadWriteOnce
  capacity:
    storage: 5Gi
  hostPath:
    path: "/mnt/data/"
  persistentVolumeReclaimPolicy: Retain

  # gcePersistentDisk:                           
  #   pgName: Jenkins-Disk   
  #   fsType: ext4


--- 


apiVersion: v1 
kind: PersistentVolumeClaim 
metadata: 
  name: jenkins-server-claim 
  namespace: jenkins-namespace 
spec:
  storageClassName: manual 
  accessModes:
    - ReadWriteOnce 
  resources:
    requests:
      storage: "4Gi"

--- 

apiVersion: v1  # Service For handling Connection to the Jenkins Server...
kind: Service
metadata:
  name: jenkins-application-service 
  namespace: jenkins-namespace 
spec:
  selector:
    app: jenkins-internal-service 
  type: ClusterIP 
  ports:
    - name: httpport 
      port: 8080 
      targetPort: 8080

    - name: jnlpport 
      port: 50000 
      targetPort: 50000 

--- 

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: jenkins-server  
  namespace: jenkins-namespace 
spec:
  serviceName: jenkins-internal-service 
  selector:
    matchLabels:
      app: jenkins-internal-service 
  template:
    metadata:
      labels:
        app: jenkins-internal-service 
    spec:
      securityContext:
        fsGroup: 1000 
        runAsUser: 1000 

      terminationGracePeriodSeconds: 60 
      containers:
        - name: jenkins-server 
          image: crazycoderrr/jenkins_base # Custom Image That is already pre-configured.
          ports:
            - name: httpport
              containerPort: 8080 
              protocol: TCP

            - name: jnlpport 
              containerPort: 50000 
              protocol: TCP 

          imagePullPolicy: Always 
          
          volumeMounts:
            - name: jenkins-config-storage  
              mountPath: /var 
              subPath: jenkins_home 

            - name: docker-socket-volume  
              mountPath: /var/run/docker.sock # for accessing via docker Socket...

      volumes:
        - name: jenkins-config-storage 
          persistentVolumeClaim:
            claimName: jenkins-server-claim 

        - name: docker-socket-volume
          hostPath:
            path: /var/run/docker.sock 

So the Problem is that, after the server has been successfully run, and I access Jenkins UI and Pressed Button to Install Initial Plugins for the server, it immediately got shut down and the logs responded with:

(If there is some similar issues related to Jenkins, please share with it)

 % kubectl logs jenkins-server-0 --namespace=jenkins-namespace                  
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2022-07-27 17:50:05.352+0000 [id=1] INFO    org.eclipse.jetty.util.log.Log#initialized: Logging initialized @309ms to org.eclipse.jetty.util.log.JavaUtilLog
2022-07-27 17:50:05.390+0000 [id=1] INFO    winstone.Logger#logInternal: Beginning extraction from war file
2022-07-27 17:50:05.955+0000 [id=1] WARNING o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath
2022-07-27 17:50:05.984+0000 [id=1] INFO    org.eclipse.jetty.server.Server#doStart: jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 11.0.15+10
2022-07-27 17:50:06.148+0000 [id=1] INFO    o.e.j.w.StandardDescriptorProcessor#visitServlet: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2022-07-27 17:50:06.167+0000 [id=1] INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: DefaultSessionIdManager workerName=node0
2022-07-27 17:50:06.167+0000 [id=1] INFO    o.e.j.s.s.DefaultSessionIdManager#doStart: No SessionScavenger set, using defaults
2022-07-27 17:50:06.167+0000 [id=1] INFO    o.e.j.server.session.HouseKeeper#startScavenging: node0 Scavenging every 600000ms
2022-07-27 17:50:06.559+0000 [id=1] INFO    hudson.WebAppMain#contextInitialized: Jenkins home directory: /var/jenkins_home found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
2022-07-27 17:50:06.769+0000 [id=1] INFO    o.e.j.s.handler.ContextHandler#doStart: Started w.@64693226{Jenkins v2.346.2,/,file:///var/jenkins_home/war/,AVAILABLE}{/var/jenkins_home/war}
2022-07-27 17:50:06.829+0000 [id=1] INFO    o.e.j.server.AbstractConnector#doStart: Started ServerConnector@72c28d64{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2022-07-27 17:50:06.830+0000 [id=1] INFO    org.eclipse.jetty.server.Server#doStart: Started @1787ms
2022-07-27 17:50:06.833+0000 [id=24]    INFO    winstone.Logger#logInternal: Winstone Servlet Engine running: controlPort=disabled
2022-07-27 17:50:07.024+0000 [id=31]    INFO    jenkins.InitReactorRunner$1#onAttained: Started initialization
2022-07-27 17:50:07.037+0000 [id=36]    INFO    jenkins.InitReactorRunner$1#onAttained: Listed all plugins
2022-07-27 17:50:07.559+0000 [id=30]    INFO    jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
2022-07-27 17:50:07.563+0000 [id=32]    INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins
2022-07-27 17:50:07.573+0000 [id=34]    INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
2022-07-27 17:50:08.042+0000 [id=33]    INFO    jenkins.InitReactorRunner$1#onAttained: System config loaded
2022-07-27 17:50:08.042+0000 [id=33]    INFO    jenkins.InitReactorRunner$1#onAttained: System config adapted
2022-07-27 17:50:08.042+0000 [id=33]    INFO    jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
2022-07-27 17:50:08.043+0000 [id=33]    INFO    jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
2022-07-27 17:50:08.066+0000 [id=49]    INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$1: Started Download metadata
2022-07-27 17:50:08.127+0000 [id=49]    INFO    hudson.util.Retrier#start: Attempt #1 to do the action check updates server

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/var/jenkins_home/war/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

2022-07-27 17:50:08.663+0000 [id=36]    INFO    jenkins.install.SetupWizard#init: 


2022-07-27 18:12:31.738+0000 [id=32]    INFO    jenkins.InitReactorRunner$1#onAttained: Completed initialization
2022-07-27 18:12:31.748+0000 [id=23]    INFO    hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running
2022-07-27 18:12:32.321+0000 [id=49]    INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2022-07-27 18:12:32.321+0000 [id=49]    INFO    hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
2022-07-27 18:12:32.324+0000 [id=49]    INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$1: Finished Download metadata. 9,647 ms
2022-07-27 18:13:17.837+0000 [id=25]    INFO    winstone.Logger#logInternal: JVM is terminating. Shutting down Jetty


So is there any suggestions how to fix this issue?

0 Answers
Related