Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket Pipelines: Apt-get update returning 404

Recently, there were some changes to the apt mirrors that has affected several Docker images, which you may be running in Bitbucket Pipelines. Most reports of this issue started on the 26th of March. But it’s possible to have occurred since March 20th.

If you’re seeing an error message like this, when running "apt-get update", you are likely affected by this issue:

Err http://httpredir.debian.org jessie-updates/main amd64 Packages
404 Not Found
Get:4 http://security.debian.org jessie/updates/main amd64 Packages [822 kB]
Get:5 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB]
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Fetched 10.1 MB in 6s (1486 kB/s)

You may also encounter this with “wheezy” instead of “jessie”.

Details of why this is occurring are noted here: https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html

In order to fix this issue, you will need to update the Docker image you are using in your build.

For example, if you are using Python:3.5.1, you now need to use a currently supported tag such as 3.5.7 or 3.7.2.

image: python:3.5.7 # This line has been updated to a working version
pipelines:
default:
- step:
script:
- apt-get update # This should now work properly

If you are using another public Docker image, search for it on Dockerhub and either try a newer tag, or see if there is a “-stretch” tag suffix available to use.

Once you’ve updated the image, your “apt-get update” command should resume working again.

5 comments

Alex Charlton
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2019

Thank you. Updating the image version worked for me.

Ajitesh Ojha
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2019

Hi, I changed the image in bitbucket-pipelines.yml from -image: node:10.6.0 TO image: node:10.15.3

But still i get same issue. Is it because it is still referring to cache from - step: >> caches: >> - node

My bitbucket-pipelines.yml looks like below now : 

image: node:10.15.3

pipelines:
  custom:
    Api:
      - step:
          caches:
            - node
          script:
            - bash test.sh testApi

Robert
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2019

Hi Ajitesh, I think node:10.15.3 is still using 'jessie' . 

Have a look at https://github.com/nodejs/docker-node/issues/1013
you may want to use a `stretch` version.  I ended up using `node:11.12.0-stretch` and before apt-get install I had to run : 

echo "deb http://deb.debian.org/debian jessie main\ndeb http://security.debian.org jessie/updates main" > /etc/apt/sources.list


 and then had to run 

- npm rebuild node-sass 

 

Like # people like this
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 27, 2019

@Robert's approach looks fine here. (FYI: The GitHub issue URL is linking to a search query, not the URL you intended: https://github.com/nodejs/docker-node/issues/1013)

There's a PR currently open which means you won't need that workaround for too long.

If you need to keep using Jessie repositories, then there's some guidance in this StackExchange answer: https://unix.stackexchange.com/a/508728

Key quote here though:

Since you’re building a container image, I highly recommend basing it on Debian 9 instead.

Like # people like this
Adriana Carmina Ciobotaru
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 6, 2019

Very big issue here with this outdated python image! I lost more than 10 hours trying to figure out why the bitbucket pipeline failed! :(

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events