Danylo Volokh
Danylo Volokh

Reputation: 4285

Bitbucket Pipelines apt-get stopped working

My Bitbucket Pipelines is configured for some time but today my builds started to fail on apt-get command:

I use java 8 docker image:

 image: java:8

And I need to install python

 # Install python
 - echo "Install python"
 - apt-get update
 - apt-get install python-pip -q -y

And the build started to fail on "apt-get" command:

+ apt-get update
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Ign http://deb.debian.org jessie-updates InRelease
Ign http://deb.debian.org jessie-backports InRelease
Get:2 http://deb.debian.org jessie Release.gpg [2420 B]
Ign http://deb.debian.org jessie-updates Release.gpg
Ign http://deb.debian.org jessie-backports Release.gpg
Get:3 http://deb.debian.org jessie Release [148 kB]
Ign http://deb.debian.org jessie-updates Release
Ign http://deb.debian.org jessie-backports Release
Err http://deb.debian.org jessie-backports/main amd64 Packages

Get:4 http://security.debian.org jessie/updates/main amd64 Packages [822 kB]
Get:5 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Err http://deb.debian.org jessie-updates/main amd64 Packages
404  Not Found
Err http://deb.debian.org jessie-backports/main amd64 Packages
404  Not Found
Fetched 10.1 MB in 7s (1395 kB/s)
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
Skipping cache upload for failed step
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.

Has something changed? Do I need to adjust my configuration?

Upvotes: 3

Views: 2735

Answers (5)

k_o_
k_o_

Reputation: 6298

I was using the maven:3.6.3 Docker image and also run into this issue. The Docker image seems to be Red Hat based now, but yum is not included. Only rpm can be used, so the options are to download manually rpm packages and use rpm or use a different Docker image as base.

Upvotes: 0

CodyBugstein
CodyBugstein

Reputation: 23352

The solution for me was to change

image: python:3.5.1

to

image: python:3.5.7

Upvotes: 0

phod
phod

Reputation: 536

As the other answers referenced, Jessie and Wheezy repositories have been removed from their normal locations. This will cause 404 errors when trying to run apt-get update on certain Docker images.

Unless you have something very specific you need from your Docker image, I suggest you change it to one that uses the Debian Stretch repositories.

In your case, with the java:8 image, this has been deprecated in favour of the openjdk image. I've tested openjdk:8 and see that it uses Stretch and runs apt-get update fine.

I've also written an official post on Atlassian Community with similar details. We'll update this article if we discover anything else that may be relevant for working around this issue.

Upvotes: 3

clay
clay

Reputation: 6017

Ran into this as well (since it's on the Pipeline's machine, not even my own).

I ran this before apt-get update: sed -i '/jessie-updates/d' /etc/apt/sources.list

This portion of my pipelines.yml looks like this:

   - sed -i '/jessie-updates/d' /etc/apt/sources.list # Debian mirror-network drops Jessie, so don't use it
   - apt-get update # required to install zip
   - apt-get install -y zip # required for packaging up the application

Full answer here (which references another)

Upvotes: 0

Matthew
Matthew

Reputation: 21

Jessie and Wheezy have been removed from their normal repo locations due to age.

See this question for the solution: https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository

Upvotes: 1

Related Questions