It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

Thank you. Updating the image version worked for me.

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

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

@Rob'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

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
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

4,409 views 4 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you