Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57129

java.io.IOException: Unexpected cgroup syntax (docker+jenkins+systemd)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Trivial
    • Resolution: Unresolved
    • Component/s: docker-workflow-plugin
    • Environment:
      RHEL 8 beta
      Jenkins 2.173
      - rpm based Installation
      - started as Service
      - running in docker container
      docker 18.09.2
      Jenkins container/Docker host on same machine - using shared binary, socket via bind mounts
    • Similar Issues:

      Description

      Hi,

      following behaviour is very similar to JENKINS-56888, with another cgroup pattern. Change https://github.com/jenkinsci/docker-workflow-plugin/pull/169 might be too restrictive.

      Szenario, cf. Field Environment with the following configuration in Jenkins:

      - pipeline script (tried both with groovy sandbox unchecked and checked):

      pipeline {
          agent {
              docker {
                  image 'xxx'
              }
          }
          stages {
              stage('Build') { 
                  steps {
                      sh 'echo "abc"' 
                  }
              }
          }
      }
      • console output of a build:
      Started by user yyy
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] Start of Pipeline
      [Pipeline] node
      Running on Jenkins in /var/lib/jenkins/workspace/abcd
      [Pipeline] {
      [Pipeline] sh
      + docker inspect -f . xxx
      .
      [Pipeline] withDockerContainer
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      java.io.IOException: Unexpected cgroup syntax /docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383/system.slice/jenkins.service
      	at org.jenkinsci.plugins.docker.workflow.client.ControlGroup.getContainerId(ControlGroup.java:60)
      	at org.jenkinsci.plugins.docker.workflow.client.ControlGroup.getContainerId(ControlGroup.java:45)
      	at org.jenkinsci.plugins.docker.workflow.client.ControlGroup.getContainerId(ControlGroup.java:37)
      	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.getContainerIdIfContainerized(DockerClient.java:336)
      	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:159)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:268)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:176)
      ...
      

      Does jenkins check its own cgroup?

      ps -xp 1310:
      1310 ?        Ssl    2:12 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /usr/lib...
      
      cat /proc/1310/cgroup
      12:memory:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383/system.slice/jenkins.service
      11:pids:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383/system.slice/jenkins.service
      10:rdma:/
      9:hugetlb:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      8:blkio:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      7:perf_event:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      6:freezer:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      5:cpuset:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      4:cpu,cpuacct:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      3:devices:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383/system.slice/jenkins.service
      2:net_cls,net_prio:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383
      1:name=systemd:/docker/f334457e283784c7aac6cbf6245c135037a0c1cd36fd983a285f67ac7d1e0383/system.slice/jenkins.service
      

      Seems that systemd adds some harm. Running Jenkins in a container without systemd is fine: without any cgroup having a suffix '/system.slice/jenkins.service'.

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                whans werner hans
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: