gmacario / easy-jenkins

Easily deploy a Jenkins CI/CD infrastructure via docker-compose
MIT License
35 stars 9 forks source link

docker-compose build: Some plugins failed to download #297

Closed gmacario closed 5 years ago

gmacario commented 5 years ago

Reproduced today on master branch

docker-compose build --pull

Result:

gpmacario@nemo:~/github/gmacario/easy-jenkins (master)*$ docker-compose build --pull
nexus uses an image, skipping
Building myjenkins
Step 1/14 : FROM jenkins/jenkins
latest: Pulling from jenkins/jenkins
Digest: sha256:4495a31e5360e64438e35d348f7a2c4a73986530faf9d9c8158c99e4821841ed
Status: Image is up to date for jenkins/jenkins:latest
 ---> 1b18d8f1e03f
Step 2/14 : USER root
 ---> Using cache
 ---> e352dd16b6d6
Step 3/14 : RUN apt-get update -qq &&     apt-cache search groovy &&     apt-get install -qqy     apt-transport-https     ca-certificates     curl     wget     lxc     iptables     dos2unix     groovy
 ---> Using cache
 ---> 6bb08dad51a2
Step 4/14 : RUN curl -o /usr/local/bin/gosu -fsSL     "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" &&     chmod +x /usr/local/bin/gosu
 ---> Using cache
 ---> ae49c109057a
Step 5/14 : RUN wget -qO- https://get.docker.com/ | sh
 ---> Using cache
 ---> 4b69450ffa48
Step 6/14 : RUN usermod -aG docker jenkins
 ---> Using cache
 ---> 38bfbea56d6f
Step 7/14 : RUN usermod -aG 100 jenkins
 ---> Using cache
 ---> 5c02b6165807
Step 8/14 : RUN curl -o /usr/local/bin/docker-compose -fsSL     "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" &&     chmod +x /usr/local/bin/docker-compose
 ---> Using cache
 ---> 191255a2e5c7
Step 9/14 : RUN mkdir -p /usr/share/jenkins/ref/plugins/tmp
 ---> Using cache
 ---> 6f5e6f01a933
Step 10/14 : ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental
 ---> Using cache
 ---> 90eb4c2f0b36
Step 11/14 : RUN install-plugins.sh     ansicolor     ant     antisamy-markup-formatter     blueocean     blueocean-pipeline-editor     build-timeout     command-launcher     configuration-as-code     configuration-as-code-support     delivery-pipeline-plugin     docker-build-publish     docker-custom-build-environment     docker-plugin     email-ext     ez-templates     git     git-client     github-branch-source     github-oauth     github-organization-folder     github-pullrequest     gradle     greenballs     groovy     htmlpublisher     jenkins-multijob-plugin     job-dsl     jobConfigHistory     join     kubernetes     kubernetes-cli     ldap     mailer     mapdb-api     matrix-auth     matrix-project     mercurial     mock-slave     pam-auth     pipeline-github-lib     publish-over-ssh     resource-disposer     run-condition     sectioned-view     ssh-slaves     subversion     timestamper     translation     view-job-filters     windows-slaves     workflow-aggregator     workflow-job     workflow-support     ws-cleanup
 ---> Running in 0fe0d6894beb
Creating initial locks...

...

Installed plugins:
ace-editor:1.1
ansicolor:0.6.2
ant:1.9
antisamy-markup-formatter:1.5
apache-httpcomponents-client-4-api:4.5.5-3.0
authentication-tokens:1.3
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.16.0
blueocean-commons:1.16.0
blueocean-config:1.16.0
blueocean-core-js:1.16.0
blueocean-dashboard:1.16.0
blueocean-display-url:2.2.0
blueocean-events:1.16.0
blueocean-git-pipeline:1.16.0
blueocean-github-pipeline:1.16.0
blueocean-i18n:1.16.0
blueocean-jira:1.16.0
blueocean-jwt:1.16.0
blueocean-personalization:1.16.0
blueocean-pipeline-api-impl:1.16.0
blueocean-pipeline-editor:1.16.0
blueocean-pipeline-scm-api:1.16.0
blueocean-rest-impl:1.16.0
blueocean-rest:1.16.0
blueocean-web:1.16.0
blueocean:1.16.0
bouncycastle-api:2.17
branch-api:2.4.0
build-timeout:1.19
built-on-column:1.1
cloudbees-bitbucket-branch-source:2.4.4
cloudbees-folder:6.8
command-launcher:1.3
conditional-buildstep:1.3.6
configuration-as-code-support:1.14
configuration-as-code:1.14
credentials-binding:1.18
credentials:2.1.18
delivery-pipeline-plugin:1.3.2
display-url-api:2.3.1
docker-build-publish:1.3.2
docker-commons:1.14
docker-custom-build-environment:1.7.3
docker-java-api:3.0.14
docker-plugin:1.1.6
docker-workflow:1.18
durable-task:1.29
email-ext:2.66
envinject-api:1.5
envinject:2.1.6
ez-templates:1.3.2
favorite:2.3.2
git-client:2.7.7
git-server:1.7
git:3.10.0
github-api:1.95
github-branch-source:2.5.2
github-oauth:0.32
github-organization-folder:1.6
github-pullrequest:0.2.4
github:1.29.4
gradle:1.31
greenballs:1.15
groovy:2.2
handlebars:1.1.1
handy-uri-templates-2-api:2.1.7-1.0
htmlpublisher:1.18
icon-shim:2.0.3
jackson2-api:2.9.8
javadoc:1.5
jenkins-design-language:1.16.0
jenkins-multijob-plugin:1.32
jira:3.0.7
job-dsl:1.74
jobConfigHistory:2.21
join:1.21
jquery-detached:1.2.1
jquery:1.12.4-0
jsch:0.1.55
junit:1.27
kubernetes-cli:1.6.0
kubernetes-credentials:0.4.0
ldap:1.20
lockable-resources:2.5
mailer:1.23
mapdb-api:1.0.9.0
matrix-auth:2.4.2
matrix-project:1.14
maven-plugin:3.2
mercurial:2.6
mock-slave:1.13
momentjs:1.1.1
pam-auth:1.5
parameterized-trigger:2.35.2
pipeline-build-step:2.9
pipeline-github-lib:1.0
pipeline-graph-analysis:1.9
pipeline-input-step:2.10
pipeline-milestone-step:1.3.1
pipeline-model-api:1.3.8
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:1.3.8
pipeline-model-extensions:1.3.8
pipeline-rest-api:2.11
pipeline-stage-step:2.3
pipeline-stage-tags-metadata:1.3.8
pipeline-stage-view:2.11
plain-credentials:1.5
publish-over-ssh:1.20.1
publish-over:0.22
pubsub-light:1.12
resource-disposer:0.12
run-condition:1.2
scm-api:2.4.1
script-security:1.58
sectioned-view:1.25
sse-gateway:1.17
ssh-credentials:1.16
ssh-slaves:1.29.4
structs:1.19
subversion:2.12.1
timestamper:1.9
token-macro:2.7
translation:1.16
variant:1.2
view-job-filters:2.1.1
windows-slaves:1.4
workflow-aggregator:2.6
workflow-api:2.33
workflow-basic-steps:2.15
workflow-cps-global-lib:2.13
workflow-cps:2.67
workflow-durable-task-step:2.30
workflow-job:2.32
workflow-multibranch:2.21
workflow-scm-step:2.7
workflow-step-api:2.19
workflow-support:3.3
ws-cleanup:0.37
Some plugins failed to download! Not downloaded: kubernetes
ERROR: Service 'myjenkins' failed to build: The command '/bin/sh -c install-plugins.sh     ansicolor     ant     antisamy-markup-formatter     blueocean     blueocean-pipeline-editor     build-timeout     command-launcher     configuration-as-code     configuration-as-code-support     delivery-pipeline-plugin     docker-build-publish     docker-custom-build-environment     docker-plugin     email-ext     ez-templates     git     git-client     github-branch-source     github-oauth     github-organization-folder     github-pullrequest     gradle     greenballs     groovy     htmlpublisher     jenkins-multijob-plugin     job-dsl     jobConfigHistory     join     kubernetes     kubernetes-cli     ldap     mailer     mapdb-api     matrix-auth     matrix-project     mercurial     mock-slave     pam-auth     pipeline-github-lib     publish-over-ssh     resource-disposer     run-condition     sectioned-view     ssh-slaves     subversion     timestamper     translation     view-job-filters     windows-slaves     workflow-aggregator     workflow-job     workflow-support     ws-cleanup' returned a non-zero code: 1
gpmacario@nemo:~/github/gmacario/easy-jenkins (master)*$
gmacario commented 5 years ago

Managed to build the image after applying the following change

gpmacario@nemo:~/github/gmacario/easy-jenkins (fix-297)*$ git diff
diff --git a/myjenkins/Dockerfile b/myjenkins/Dockerfile
index 0b4cfbd..e740344 100644
--- a/myjenkins/Dockerfile
+++ b/myjenkins/Dockerfile
@@ -77,7 +77,6 @@ RUN install-plugins.sh \
     job-dsl \
     jobConfigHistory \
     join \
-    kubernetes \
     kubernetes-cli \
     ldap \
     mailer \
@@ -103,6 +102,8 @@ RUN install-plugins.sh \
     workflow-support \
     ws-cleanup

+#    kubernetes \
+
 #    "workflow-support:incrementals;org.jenkins-ci.plugins.workflow;2.19-rc295.e017dc58c0a3" \

 COPY seed.groovy /usr/share/jenkins/ref/init.groovy.d/seed.groovy
gpmacario@nemo:~/github/gmacario/easy-jenkins (fix-297)*$
gmacario commented 5 years ago

After executing ./run.sh I updated the Jenkins plugins, but the kubernetes plugin still refuses to update.

Excerpt from docker-compose logs -f:

myjenkins_1  | May 09, 2019 1:45:39 PM hudson.model.UpdateCenter$DownloadJob run
myjenkins_1  | INFO: Starting the installation of Kubernetes on behalf of admin
myjenkins_1  | May 09, 2019 1:45:39 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download
myjenkins_1  | INFO: Downloading Kubernetes
myjenkins_1  | May 09, 2019 1:45:39 PM hudson.model.UpdateCenter$DownloadJob run
myjenkins_1  | SEVERE: Failed to install Kubernetes
myjenkins_1  | java.io.IOException: Failed to download from http://updates.jenkins-ci.org/download/plugins/kubernetes/1.15.4/kubernetes.hpi (redirected to: http://archives.jenkins-ci.org/plugins/kubernetes/1.15.4/kubernetes.hpi)
myjenkins_1  |  at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1215)
myjenkins_1  |  at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1752)
myjenkins_1  |  at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2015)
myjenkins_1  |  at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1726)
myjenkins_1  |  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
myjenkins_1  |  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
myjenkins_1  |  at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:112)
myjenkins_1  |  at java.lang.Thread.run(Thread.java:748)
myjenkins_1  | Caused by: java.io.IOException: Failed to load http://updates.jenkins-ci.org/download/plugins/kubernetes/1.15.4/kubernetes.hpi to /var/jenkins_home/plugins/kubernetes.jpi.tmp
myjenkins_1  |  at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1181)
myjenkins_1  |  ... 7 more
myjenkins_1  | Caused by: java.io.FileNotFoundException: http://archives.jenkins-ci.org/plugins/kubernetes/1.15.4/kubernetes.hpi
myjenkins_1  |  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
myjenkins_1  |  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
myjenkins_1  |  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
myjenkins_1  |  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
myjenkins_1  |  at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944)
myjenkins_1  |  at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939)
myjenkins_1  |  at java.security.AccessController.doPrivileged(Native Method)
myjenkins_1  |  at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938)
myjenkins_1  |  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508)
myjenkins_1  |  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
myjenkins_1  |  at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1174)
myjenkins_1  |  ... 7 more
gmacario commented 5 years ago

It looks like http://archives.jenkins-ci.org/plugins/kubernetes/1.15.4/kubernetes.hpi is temporarily missing even though Plugin Manager states that 1.15.4 is already available:

Screenshot from 2019-05-09 15-49-21

gmacario commented 5 years ago

Retried after 30 min, Jenkins plugin kubernetes has now correctly been upgraded to version 1.15.4

Screenshot from 2019-05-09 16-15-12

gmacario commented 5 years ago

Retrying docker-compose build --pull --no-cache from the clean master branch

==> The build is successful

gpmacario@nemo:~/github/gmacario/easy-jenkins (fix-297)*$ docker-compose build --pull --no-cache
nexus uses an image, skipping
Building myjenkins
Step 1/14 : FROM jenkins/jenkins
latest: Pulling from jenkins/jenkins
Digest: sha256:4495a31e5360e64438e35d348f7a2c4a73986530faf9d9c8158c99e4821841ed
Status: Image is up to date for jenkins/jenkins:latest
 ---> 1b18d8f1e03f
Step 2/14 : USER root
 ---> Running in a164a7492b97
Removing intermediate container a164a7492b97
 ---> ccee4e084224
Step 3/14 : RUN apt-get update -qq &&     apt-cache search groovy &&     apt-get install -qqy     apt-transport-https     ca-certificates     curl     wget     lxc     iptables     dos2unix     groovy
 ---> Running in a885f67abbef
...

WAR bundled plugins:

Installed plugins:
ace-editor:1.1
ansicolor:0.6.2
ant:1.9
antisamy-markup-formatter:1.5
apache-httpcomponents-client-4-api:4.5.5-3.0
authentication-tokens:1.3
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.16.0
blueocean-commons:1.16.0
blueocean-config:1.16.0
blueocean-core-js:1.16.0
blueocean-dashboard:1.16.0
blueocean-display-url:2.2.0
blueocean-events:1.16.0
blueocean-git-pipeline:1.16.0
blueocean-github-pipeline:1.16.0
blueocean-i18n:1.16.0
blueocean-jira:1.16.0
blueocean-jwt:1.16.0
blueocean-personalization:1.16.0
blueocean-pipeline-api-impl:1.16.0
blueocean-pipeline-editor:1.16.0
blueocean-pipeline-scm-api:1.16.0
blueocean-rest-impl:1.16.0
blueocean-rest:1.16.0
blueocean-web:1.16.0
blueocean:1.16.0
bouncycastle-api:2.17
branch-api:2.4.0
build-timeout:1.19
built-on-column:1.1
cloudbees-bitbucket-branch-source:2.4.4
cloudbees-folder:6.8
command-launcher:1.3
conditional-buildstep:1.3.6
configuration-as-code-support:1.14
configuration-as-code:1.14
credentials-binding:1.18
credentials:2.1.18
delivery-pipeline-plugin:1.3.2
display-url-api:2.3.1
docker-build-publish:1.3.2
docker-commons:1.14
docker-custom-build-environment:1.7.3
docker-java-api:3.0.14
docker-plugin:1.1.6
docker-workflow:1.18
durable-task:1.29
email-ext:2.66
envinject-api:1.5
envinject:2.1.6
ez-templates:1.3.2
favorite:2.3.2
git-client:2.7.7
git-server:1.7
git:3.10.0
github-api:1.95
github-branch-source:2.5.2
github-oauth:0.32
github-organization-folder:1.6
github-pullrequest:0.2.4
github:1.29.4
gradle:1.31
greenballs:1.15
groovy:2.2
handlebars:1.1.1
handy-uri-templates-2-api:2.1.7-1.0
htmlpublisher:1.18
icon-shim:2.0.3
jackson2-api:2.9.8
javadoc:1.5
jenkins-design-language:1.16.0
jenkins-multijob-plugin:1.32
jira:3.0.7
job-dsl:1.74
jobConfigHistory:2.21
join:1.21
jquery-detached:1.2.1
jquery:1.12.4-0
jsch:0.1.55
junit:1.27
kubernetes-cli:1.6.0
kubernetes-credentials:0.4.0
kubernetes:1.15.4
ldap:1.20
lockable-resources:2.5
mailer:1.23
mapdb-api:1.0.9.0
matrix-auth:2.4.2
matrix-project:1.14
maven-plugin:3.2
mercurial:2.6
mock-slave:1.13
momentjs:1.1.1
pam-auth:1.5
parameterized-trigger:2.35.2
pipeline-build-step:2.9
pipeline-github-lib:1.0
pipeline-graph-analysis:1.9
pipeline-input-step:2.10
pipeline-milestone-step:1.3.1
pipeline-model-api:1.3.8
pipeline-model-declarative-agent:1.1.1
pipeline-model-definition:1.3.8
pipeline-model-extensions:1.3.8
pipeline-rest-api:2.11
pipeline-stage-step:2.3
pipeline-stage-tags-metadata:1.3.8
pipeline-stage-view:2.11
plain-credentials:1.5
publish-over-ssh:1.20.1
publish-over:0.22
pubsub-light:1.12
resource-disposer:0.12
run-condition:1.2
scm-api:2.4.1
script-security:1.58
sectioned-view:1.25
sse-gateway:1.17
ssh-credentials:1.16
ssh-slaves:1.29.4
structs:1.19
subversion:2.12.1
timestamper:1.9
token-macro:2.7
translation:1.16
variant:1.2
view-job-filters:2.1.1
windows-slaves:1.4
workflow-aggregator:2.6
workflow-api:2.33
workflow-basic-steps:2.15
workflow-cps-global-lib:2.13
workflow-cps:2.67
workflow-durable-task-step:2.30
workflow-job:2.32
workflow-multibranch:2.21
workflow-scm-step:2.7
workflow-step-api:2.19
workflow-support:3.3
ws-cleanup:0.37
Cleaning up locks
Removing intermediate container a0c6abb0b75f
 ---> 169c40878804
Step 12/14 : COPY seed.groovy /usr/share/jenkins/ref/init.groovy.d/seed.groovy
 ---> ad66ba0fe91b
Step 13/14 : RUN touch /var/run/docker.sock
 ---> Running in 7f35314729d9
Removing intermediate container 7f35314729d9
 ---> 8fb18f3fa6da
Step 14/14 : USER jenkins
 ---> Running in 7c21601836e7
Removing intermediate container 7c21601836e7
 ---> 28f995270103

Successfully built 28f995270103
Successfully tagged easyjenkins_myjenkins:latest
gpmacario@nemo:~/github/gmacario/easy-jenkins (fix-297)*$
gmacario commented 5 years ago

Closing issue, the problem was most likely due to a temporary misalignment of http://archives.jenkins-ci.org/