Container is waiting jenkins-slave [jnlp]: error creating volume path '/var/lib/docker/volumes/8db permission denied

9/13/2018

I have a jenkins instance created using docker run -d -v /Users/dlovison/Documents/DockerVolumes/jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts deployed only on my local environment

I would like to connect in my remote openshift instance (openshift.com)

I followed the tutorial http://v1.uncontained.io/playbooks/continuous_delivery/external-jenkins-integration.html and all steps are working except when my local jenkins try to connect via jnlp

The errors are:

Waiting for Pod to be scheduled (65/100): jenkins-slave-j8gmr-28v7x
Container is waiting jenkins-slave-j8gmr-28v7x [jnlp]: ContainerStateWaiting(message=Error response from daemon: create 110861e4dd42a6343dbd584f09a7967e714feb0155cf070aff167495c01ada39: error while creating volume path '/var/lib/docker/volumes/110861e4dd42a6343dbd584f09a7967e714feb0155cf070aff167495c01ada39/_data': mkdir /var/lib/docker/volumes/110861e4dd42a6343dbd584f09a7967e714feb0155cf070aff167495c01ada39: permission denied, reason=CreateContainerError, additionalProperties={})
Waiting for Pod to be scheduled (66/100): jenkins-slave-j8gmr-28v7x
Container is waiting jenkins-slave-j8gmr-28v7x [jnlp]: ContainerStateWaiting(message=Error response from daemon: create 110861e4dd42a6343dbd584f09a7967e714feb0155cf070aff167495c01ada39: error while creating volume path '/var/lib/docker/volumes/110861e4dd42a6343dbd584f09a7967e714feb0155cf070aff167495c01ada39/_data': mkdir /var/lib/docker/volumes/110861e4dd42a6343dbd584f09a7967e714feb0155cf070aff167495c01ada39: permission denied, reason=CreateContainerError, additionalProperties={})

My service account contains the role: 'admin' and 'edit'

Here is my pipeline

apiVersion: v1
kind: BuildConfig
metadata:
  name: sample-pipeline-v4
  labels:
    name: sample-pipeline-v4
spec:
  strategy:
    type: JenkinsPipeline
    jenkinsPipelineStrategy:
      env:
      - name: "FOO"
        value: "BAR"
      jenkinsfile: |-

        def label = "diego-pod-${UUID.randomUUID().toString()}"

        podTemplate(label: label, containers: [
          containerTemplate(name: 'maven', image: 'registry.access.redhat.com/openshift3/jenkins-slave-maven-rhel7', ttyEnabled: true, command: 'cat')
          ]) {

          node(label) {
            stage('Build a Maven project') {
              git 'https://github.com/jenkinsci/kubernetes-plugin.git'
              container('maven') {
                  sh 'mvn -B clean package'
              }
            }
          }
        }

I have the plugin https://github.com/openshift/jenkins-sync-plugin/ that do all the hard work

-- Diego
docker
jenkins
jenkins-plugins
kubernetes
openshift

1 Answer

9/13/2018

Basically, it cannot create a volume on your Kubernetes/Openshift cluster. It's unclear from the question where your Openshift cluster is running, so creating a volume will depend on your cloud/StorageClass. Can you Try these commands?

oc get pvc
oc get pv

With the output

oc describe pvc <name-from-previous-step>
oc describe pv <name-from-previous-step>
-- Rico
Source: StackOverflow