yet-another-docker-plugin icon indicating copy to clipboard operation
yet-another-docker-plugin copied to clipboard

{"message":"No such image: jenkins_slave_1:latest"}

Open SalahAdDin opened this issue 8 years ago • 39 comments

I have this error:

Sep 28, 2016 7:07:57 AM INFO com.github.kostyasha.yad.DockerCloud provision

Asked to provision load: '1', for: 'docker-slave' label

Sep 28, 2016 7:07:57 AM INFO com.github.kostyasha.yad.DockerCloud provision

Will provision 'jenkins_slave_1', for label: 'docker-slave', in cloud: 'Local DockerHost'

Sep 28, 2016 7:07:57 AM INFO com.github.kostyasha.yad.DockerCloud addProvisionedSlave

Provisioning 'jenkins_slave_1' number '0' on 'Local DockerHost'; Total containers: '0'

Sep 28, 2016 7:07:57 AM INFO com.github.kostyasha.yad.DockerCloud provisionWithWait

Trying to run container for jenkins_slave_1

Sep 28, 2016 7:07:57 AM SEVERE com.github.kostyasha.yad_docker_java.com.github.dockerjava.core.async.ResultCallbackTemplate onError

Error during callback
com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: jenkins_slave_1:latest"}

I don't know why, but Yer another Docker Plugin can provide the slave container.

I have this in settings: seleccion_276 seleccion_277

As you can see i put the same docker image than i have in my terminal: seleccion_278 jenkins_slave_1.

I tried with jenkins_slave but doesn't works.

I don't know what have i wrong.

I'm using docker 1.12.1 and jenkins 2.23, with lastest Yer another Docker Plugin.

And not, isn't connection problem, see: seleccion_279

I have this Dockerfile for jenkins-slave image:

FROM debian:jessie
MAINTAINER José L. Sandoval A.

# Install all dependencies
RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/jessie-backports.list

ENV JAVA_VERSION 8u102
ENV JAVA_DEBIAN_VERSION 8u102-b14.1-1~bpo8+1

# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
ENV CA_CERTIFICATES_JAVA_VERSION 20140324

# Install Essentials and Packages
RUN apt-get update \
    && apt-get install -y gettext git wget \
    openssh-server openjdk-8-jdk="$JAVA_DEBIAN_VERSION"\
    ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
    sudo \
    && apt-get autoremove -y --purge \
    && rm -rf /var/lib/apt/lists/*

RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure

# Create Jenkins User
RUN useradd jenkins -m -s /bin/bash

RUN chown -R jenkins /home/jenkins
RUN chgrp -R jenkins /home/jenkins

# Add the jenkins user to sudoers
RUN echo "jenkins    ALL=(ALL)    ALL" >> etc/sudoers

# Set Name Servers
COPY /files/resolv.conf /etc/resolv.conf

Thanks!

SalahAdDin avatar Sep 28 '16 08:09 SalahAdDin

com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: jenkins_slave_1:latest"}

That's mean that daemon doesn't see this image. If you are making slave from compose, then it probably expected to be a static slave (not for dynamic provisioning via yad-plugin).

KostyaSha avatar Sep 28 '16 09:09 KostyaSha

Try replace image with kostyasha/jenkins-slave:full For JNLP launcher you should alse ensure that jenkins hostname will be accessible from container.

KostyaSha avatar Sep 28 '16 10:09 KostyaSha

Ok:

Error during callback
com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"Error parsing reference: \"kostyasha:jenkins-slave:full \" is not a valid repository/tag"}

Now i have this.

SalahAdDin avatar Sep 28 '16 19:09 SalahAdDin

kostyasha/jenkins-slave:full

KostyaSha avatar Sep 28 '16 19:09 KostyaSha

Wait a minut com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: kostyasha/jenkins-slave:latest"}.

SalahAdDin avatar Sep 28 '16 19:09 SalahAdDin

Why latest? You didn't set tag.

KostyaSha avatar Sep 28 '16 19:09 KostyaSha

Wow, this is bad, very bad:

com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: kostyasha/jenkins-slave:full"}

SalahAdDin avatar Sep 28 '16 20:09 SalahAdDin

https://hub.docker.com/r/kostyasha/jenkins-slave/tags/

KostyaSha avatar Sep 28 '16 20:09 KostyaSha

So it seems that your docker-engin is bad and has no network (either wrong dns) and can't download image. But initially your issue was because of missing image. Are you trying to follow some docs?

KostyaSha avatar Sep 28 '16 20:09 KostyaSha

But, i don't understand why do you say that hasn't network, you can see that test connections are good, none errors.

Which docs say you? I follow this tutorial: https://engineering.riotgames.com/news/jenkins-ephemeral-docker-tutorial But only the part for create a new job.

And i follow this tutorial: https://github.com/maxfields2000/dockerjenkins_tutorial/tree/master/jenkins2 This for this plugin, because official docker-plugin doesn't works with Docker 1.12.1.

SalahAdDin avatar Sep 28 '16 23:09 SalahAdDin

Where is your compose file? Didn't you change jenkins-slave to jenkins_slave naming?

KostyaSha avatar Sep 28 '16 23:09 KostyaSha

Oh man, you don't sleep? Me too,

Thanks for your help!

Here my compose file:

data:
 build: jenkins-data
master:
 build: jenkins-master
 volumes_from:
  - data
 ports:
  - "50000:50000"
nginx:
 build: jenkins-nginx
 ports:
  - "80:80"
 links:
  - master:jenkins-master
slave:
 build: jenkins-slave

SalahAdDin avatar Sep 29 '16 00:09 SalahAdDin

@SalahAdDin 1) referenced doc suggests to use "pull never" so when you placed my dockerhub image it probably didn't try download it. So maybe your docker daemon is fine. Try set "pull once" strategy in slave template settings. 2) To ensure that you really has your custom image jenkins_slave_1 run docker images command

KostyaSha avatar Sep 29 '16 00:09 KostyaSha

Oh man, you don't sleep? Me too,

Thanks for your help!

Here my compose file:

data:
 build: jenkins-data
master:
 build: jenkins-master
 volumes_from:
  - data
 ports:
  - "50000:50000"
nginx:
 build: jenkins-nginx
 ports:
  - "80:80"
 links:
  - master:jenkins-master
slave:
 build: jenkins-slave

SalahAdDin avatar Sep 29 '16 01:09 SalahAdDin

And, well, i don't know but now i have and advance, i have serious problems with my custom jenkins image.

I have this in bash:

docker images                                                                                   ✓  4041  00:50:07 
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
jenkins_master      latest              c0d0eb11f770        About an hour ago   543.8 MB
jenkins_nginx       latest              81e888c9f7ee        4 days ago          356.3 MB
jenkins_data        latest              639e8d5d99e4        4 days ago          123.3 MB
jenkins_slave       latest              66196e8bcfab        4 days ago          626.5 MB
pritunl/archlinux   latest              5cac5ae9cf9e        6 days ago          350.4 MB
jenkins             latest              865c4db528ff        7 days ago          712.3 MB
openjdk             8-jdk               96cddf5ae9f1        7 days ago          640.9 MB
debian              jessie              ddf73f48a05d        7 days ago          123 MB
centos              7                   980e0e4c79ec        3 weeks ago         196.7 MB
 salahaddin@TulipanROG  ~/Proyectos/uzmantech/jenkins   rework ● ?  docker-compose ps                                                                               ✓  4051  00:50:27 
      Name                    Command               State                  Ports                
-----------------------------------------------------------------------------------------------
jenkins_data_1     echo Data container for Je ...   Exit 0                                      
jenkins_master_1   /bin/tini -- /usr/local/bi ...   Up       0.0.0.0:50000->50000/tcp, 8080/tcp 
jenkins_nginx_1    nginx                            Up       443/tcp, 0.0.0.0:80->80/tcp        
jenkins_slave_1    /bin/bash                        Exit 0                                      
 salahaddin@TulipanROG  ~/Proyectos/uzmantech/jenkins   rework ● ?         

And here my configuration: seleccion_282

Good, my advances are this: Yes, i have a new node, but, he doesn't connect. seleccion_280

Trying search in log files, i haven't found any report, and in log within new node i have this: seleccion_281

Starting connection command for 605f28691ad4a5631a56a89576a2243d39a2a5bf83762c64e399c0ee3dee241d






HTTP ERROR 404

Problem accessing /computer/Local%20Docker%20Host%20Machine-605f28691ad4/logText/progressiveHtml. Reason:

    Not Found

Powered by Jetty://

What is my error now?

SalahAdDin avatar Oct 01 '16 07:10 SalahAdDin

Maybe doesn't works because in testing in local environment, right?

SalahAdDin avatar Oct 01 '16 07:10 SalahAdDin

As super stupid question, could you remove spaces from cloud name?

KostyaSha avatar Oct 02 '16 20:10 KostyaSha

No, had i? Have i put a cloud name without spaces?

SalahAdDin avatar Oct 03 '16 02:10 SalahAdDin

Well, i change Cloud Name to DockerHost and relaunching the slave node i get this:

ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins
java.lang.RuntimeException: Docker template DockerSlaveTemplate[id=b0c337e4-d767-427b-a67b-f454c44415d0,labelString=docker-slave,launcher=com.github.kostyasha.yad.launcher.DockerComputerJNLPLauncher@29263773,remoteFs=/home/jenkins,maxCapacity=10,mode=EXCLUSIVE,retentionStrategy=com.github.kostyasha.yad.strategy.DockerOnceRetentionStrategy@27f,numExecutors=1,dockerContainerLifecycle=com.github.kostyasha.yad.DockerContainerLifecycle@35526c25[image=jenkins_slave,pullImage=com.github.kostyasha.yad.commons.DockerPullImage@6248c5ca,createContainer=DockerCreateContainer[command=,hostname=,dnsHosts=[],volumes=[],volumesFrom=[],environment=[],bindPorts=,bindAllPorts=false,memoryLimit=0,cpuShares=<null>,privileged=false,tty=false,macAddress=<null>,extraHosts=[],networkMode=<null>,devices=[],cpusetCpus=,cpusetMems=,links=<null>],stopContainer=com.github.kostyasha.yad.commons.DockerStopContainer@27f,removeContainer=com.github.kostyasha.yad.commons.DockerRemoveContainer@5aea],nodeProperties=[]] has no assigned Cloud.
    at com.github.kostyasha.yad.DockerSlave.getCloud(DockerSlave.java:95)
    at com.github.kostyasha.yad.DockerComputer.getCloud(DockerComputer.java:40)
    at com.github.kostyasha.yad.launcher.DockerComputerJNLPLauncher.launch(DockerComputerJNLPLauncher.java:118)
    at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:262)
    at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

It creates other node that have the same performance: seleccion_286 I see this in node page: seleccion_287 And see this when i tried relaunch again. seleccion_288 And see this when i see logs: seleccion_289

Until now, doesn't works.

SalahAdDin avatar Oct 08 '16 06:10 SalahAdDin

Did you resolve this issue?

joeybdub avatar Apr 20 '17 09:04 joeybdub

Not yet.

SalahAdDin avatar Apr 21 '17 12:04 SalahAdDin

Mine was the expose port and the command to start the connection were not installed on docker image I was using. I resolved these and its working for me but not sure you have the same issue. Sorry if this doesnt help!

joeybdub avatar Apr 21 '17 13:04 joeybdub

Can you provide me more information about your problem and your solution? please.

SalahAdDin avatar Apr 22 '17 00:04 SalahAdDin

I had a similar issue to you: ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins.

So while googling I seen this issue. The problem I had was related 2 missing configs in my image.

  1. The docker image wasnt starting with sshd. This was required in the dockerfile at build time but you can add to a container and commit also. /usr/sbin/sshd -D

The second issue I had was that my images were not exposing port 22 when the containers started. Again at build time was missing... EXPOSE 22 You can check this with docker inspect command.

joeybdub avatar Apr 22 '17 11:04 joeybdub

Or use docker JNLP launcher instead of ssh with right configured jenkins master hostname/address it should work without image modifications for images that has java and curl/wget.

KostyaSha avatar Apr 24 '17 01:04 KostyaSha

docker JNLP launcher doesnt work for me... I think its due to "COMMAND" "/bin/bash -cxe 'cat " but I havent had time to spend debugging!

joeybdub avatar Apr 24 '17 09:04 joeybdub

it was relaxed to sh in latest versions.

KostyaSha avatar Apr 24 '17 12:04 KostyaSha

Thanks. This on path to production I dont want the latest and greatest yet! But appreciate the info!

joeybdub avatar Apr 24 '17 12:04 joeybdub

I'm waiting for riot games Jenkins docker tutorial update, his author said that he will update it and change ssh by JNLP.

SalahAdDin avatar Apr 25 '17 10:04 SalahAdDin

@SalahAdDin, I was waiting for an updated tutorial as well. Instead of waiting, I decided to create one myself: https://github.com/GetchaDEAGLE/jenkins-ephemeral-cicd. Hopefully this is of use to you.

danieleagle avatar Apr 25 '17 15:04 danieleagle