0

I am trying to create a custom Jenkins docker image. For that I need to install certain plugins in Jenkins. I am doing so by adding the below lines to the Dockerfile

COPY plugins.txt /usr/share/jenkins/ref/

ENV CURL_CONNECTION_TIMEOUT=60
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

My plugins.txt looks like this -

configuration-as-code

I had more plugins in the list but seems like I am unable to install even if there is only one.

The full error message that I receive is -

Creating initial locks...
Analyzing war /usr/share/jenkins/jenkins.war...
Registering preinstalled plugins...
Using version-specific update center: https://updates.jenkins.io/2.235...
Downloading plugins...
Downloading plugin: configuration-as-code from https://updates.jenkins.io/2.235/latest/configuration-as-code.hpi
curl: (16) Error in the HTTP2 framing layer
15:34:43 Failure (16) Retrying in 1 seconds...
 > configuration-as-code depends on snakeyaml-api:1.26.3
Downloading plugin: snakeyaml-api from https://updates.jenkins.io/2.235/latest/snakeyaml-api.hpi
curl: (16) Error in the HTTP2 framing layer
15:35:39 Failure (16) Retrying in 1 seconds...
curl: (16) Error in the HTTP2 framing layer
15:35:52 Failure (16) Retrying in 1 seconds...
curl: (16) Error in the HTTP2 framing layer
15:36:05 Failure (16) Retrying in 1 seconds...
15:36:06 Failed in the last attempt (curl -sSfL --connect-timeout 60 --retry 3 --retry-delay 0 --retry-max-time 60 https://updates.jenkins.io/2.235/latest/snakeyaml-api.hpi -o /usr/share/jenkins/ref/plugins/snakeyaml-api.jpi)
Downloading plugin: snakeyaml-api-plugin from https://updates.jenkins.io/2.235/latest/snakeyaml-api-plugin.hpi
curl: (22) The requested URL returned error: 404 Not Found
15:36:08 Failure (22) Retrying in 1 seconds...
curl: (22) The requested URL returned error: 404 Not Found
15:36:11 Failure (22) Retrying in 1 seconds...
curl: (22) The requested URL returned error: 404 Not Found
15:36:14 Failure (22) Retrying in 1 seconds...
15:36:15 Failed in the last attempt (curl -sSfL --connect-timeout 60 --retry 3 --retry-delay 0 --retry-max-time 60 https://updates.jenkins.io/2.235/latest/snakeyaml-api-plugin.hpi -o /usr/share/jenkins/ref/plugins/snakeyaml-api-plugin.jpi)
Failed to download plugin: snakeyaml-api or snakeyaml-api-plugin

WAR bundled plugins:


Installed plugins:
configuration-as-code:1.43
snakeyaml-api:1.26.4
Some plugins failed to download! Not downloaded: snakeyaml-api
The command '/bin/sh -c /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt' returned a non-zero code: 1

Curl tries to download snakeyaml-api-plugin when snakeyaml-api fails. The latter is not being downloaded due to the error curl: (16) Error in the HTTP2 framing layer

For multiple plugins, I get the HTTP2 framing layer error multiple times. Many a times, the installation gets stuck at a point without any progress

You can look into the shell script install-plugins.sh here

Tested on Windows 10 as well as MacOS Mojave Docker version - 19.03.12

1

If HTTP/2 is not working try forcing HTTP 1.1:

COPY plugins.txt /usr/share/jenkins/ref/

ENV CURL_OPTIONS -sSfL --http1.1
ENV CURL_CONNECTION_TIMEOUT 60
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.