<p>If HTTP/2 is not working try forcing HTTP 1.1:</p>
<pre><code>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 &lt; /usr/share/jenkins/ref/plugins.txt
</code></pre>

CC BY-SA 4.0
2020-08-28T21:27:14.880Z
2020-08-28T21:27:14.880Z
Konrad Botor
<p>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</p>
<pre><code>COPY plugins.txt /usr/share/jenkins/ref/

ENV CURL_CONNECTION_TIMEOUT=60
RUN /usr/local/bin/install-plugins.sh &lt; /usr/share/jenkins/ref/plugins.txt
</code></pre>
<p>My plugins.txt looks like this -</p>
<pre><code>configuration-as-code

</code></pre>
<p>I had more plugins in the list but seems like I am unable to install even if there is only one.</p>
<p>The full error message that I receive is -</p>
<pre><code>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...
 &gt; 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 &lt; /usr/share/jenkins/ref/plugins.txt' returned a non-zero code: 1
</code></pre>
<p>Curl tries to download <code>snakeyaml-api-plugin</code> when <code>snakeyaml-api</code> fails. The latter is not being downloaded due to the error <code>curl: (16) Error in the HTTP2 framing layer</code></p>
<p>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</p>
<p>You can look into the shell script <code>install-plugins.sh</code> <a href="https://github.com/jenkinsci/docker/blob/master/install-plugins.sh" rel="nofollow noreferrer">here</a></p>
<p>Tested on Windows 10 as well as MacOS Mojave
Docker version -  19.03.12</p>

<docker><jenkins><curl>
Curl Error in HTTP2 framing layer when trying to install Jenkins plugin
Dhiraj Barnwal
# Curl Error in HTTP2 framing layer when trying to install Jenkins plugin

(Asked by: username_0 on 2020-08-28)

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

**Tags:** docker, jenkins, curl


---

## 1 answers

### Answer by username_1 on 2020-08-28. Score: 1 | Accepted answer

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


---

