Amir Khan
Amir Khan

Reputation: 31

pending jenkins doesn't have label docker-slave

I am trying to configure jenkins slave as docker container, have enabled docker API and connections works fine to the API

Have added the configuration for docker template and docker cloud but it seems that my job does not starts

I can see container getting created on my docker node but the job does not start

Docker cloud configuration image

docker template image

One thing to note is that when i run the container specifically on the docker node and then try to ssh using the same credentials that i am using in jenkins i can ssh into the container.

Upvotes: 3

Views: 13648

Answers (2)

Enfield Li
Enfield Li

Reputation: 2530

For me, "Jenkins doesn't have label XXXX" is because the connection with docker is lost due to url change and thus the docker plugin cannot establish connection, and forward traffic from Jenkins to Docker Desktop:

See relavent question

enter image description here

As the picture shows, hitting "Test Connection" button, and it went through.

Upvotes: 0

Fernando Castilla
Fernando Castilla

Reputation: 709

This message of "Jenkins doesn't have label XXXX" is rather misleading and unhelpful.

You think the problem is something you did wrong in your configuration and when you find out what happen it is nothing to do with jenkins or how you set up the docker plugin. I run into the same problem than you, and the problem was the docker installation I was using.

The steps I followed to fix it were: (I was using CENTOS7,jenkins 2.1.38, docker version 1.13.1)

1) Go to the logs of your jenkins (centos logs are /var/log/jenkins.log)

2) Looking into the logs you are going to find out the problem. For instance for me was this:

com.github.dockerjava.api.exception.NotFoundException: {"message":"driver failed programming external connectivity on endpoint happy_heyrovsky (cbfa0d43f8c89d2531323249468503be11e9dd603597a870530d28540c662695): exec: \"docker-proxy\": executable file not found in $PATH"}

As you see the problem is that docker it is not able to find docker-proxy ¿how to fix this?

Go to /usr/libexec/docker and you will see docker-proxy-current. so what you have to do is create a link:

                  sudo ln -s docker-proxy-current docker-proxy

Tha´s all. After doing this change I execute my build on jenkins and it works.

Upvotes: 5

Related Questions