12

I am running a Travis build and it fails when building the mysql:5.7.27 docker image. The Dockerfile runs apt-get update and then I get an error W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found.

Using curl I can see it is redirecting, but the redirect-to URL results in a 404. Has anyone seen this sort of behaviour and have a remedy? Is it basically unfixable until debian makes changes?

➜  ms git:(develop) curl --head http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
HTTP/1.1 302 Found
Date: Tue, 26 Mar 2019 16:03:04 GMT
Server: Apache
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Referrer-Policy: no-referrer
X-Xss-Protection: 1
Location: http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
Content-Type: text/html; charset=iso-8859-1

➜  ms git:(develop) curl --head http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
HTTP/1.1 404 Not Found
Server: Apache
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Referrer-Policy: no-referrer
X-Xss-Protection: 1
Content-Type: text/html; charset=iso-8859-1
Via: 1.1 varnish
Content-Length: 316
Accept-Ranges: bytes
Date: Tue, 26 Mar 2019 16:03:17 GMT
Via: 1.1 varnish
Age: 45
Connection: keep-alive
X-Served-By: cache-ams21028-AMS, cache-cdg20741-CDG
X-Cache: HIT, HIT
X-Cache-Hits: 6, 2
X-Timer: S1553616198.734091,VS0,VE0
mort
  • 162
  • 1
  • 7
  • 1
    Welcome , see this post on U&L : https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository – GAD3R Mar 27 '19 at 10:42

1 Answers1

34

This is due to the fact that

as Wheezy and Jessie have been integrated into the archive.debian.org structure recently, we are now removing all of Wheezy and all non-LTS architectures of Jessie from the mirror network starting today.

(As you can read here)

A solution (according to https://github.com/debuerreotype/docker-debian-artifacts/issues/66#issuecomment-476616579) is to add this line:

RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived

into your Dockerfile before calling any apt-get update when using debian:jessie. This will remove the jessie-updates repository (which now causes the 404) from sources.list.

So while the following doesn't work:

FROM debian:jessie
RUN apt-get update
CMD /bin/sh

It works like:

FROM debian:jessie
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived
RUN apt-get update
CMD /bin/sh
codinghaus
  • 1,734
  • 1
  • 10
  • 19
  • Works like a charm. Thanks! – MFrazier May 16 '19 at 16:32
  • 2
    How does this happen? It looks like thousands of people are having this issue from other forums and Git issue trackers. I had a very innocuous Dockerfile that just stopped working. Is there something we were supposed to know about to prevent the error? Or did the Debian people just knowingly break everyone's containers and then hope they'd figure it out? – Neil Jul 14 '19 at 14:22