Error 404 - Failed to fetch Debian packages in Pipelines build

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Purpose

When fetching packages from Debian inside of Bitbucket Pipelines, users may come across "404 Not Found" error messages. The purpose of this KB article is to provide context as to why these error messages may occur and how to address them.

Environment

  • This issue can occur when you are executing Pipelines builds, this includes builds that execute on self-hosted runners

Diagnosis

You are running a build and attempting to run the apt-get update command when all of a sudden the build fails and reports some variant of the following error message in the build log:

1 2 Failed to fetch http://security.debian.org/ 404 Not Found [IP: 151.101.2.132 80] Failed to fetch http://deb.debian.org/debian/ 404 Not Found [IP: 146.75.34.132 80]

Causes

1. Debian update server is down

Starting with the basics - the easiest way to verify if the server is down is by simply performing a ping test against the IP addresses that are reported in the error message, for example:

1 2 ping 151.101.2.132 ping 146.75.34.132
  • If you do not receive a ping response back from the server, usually the destination update server is facing downtime and you will need to wait for this to be resolved

  • We have a network troubleshooting article that may prove useful in locating exactly where the issue is present between pipelines and the destination server, otherwise, if you are still unsure you may raise a support ticket or a community support ticket for further assistance.

2. Debian update package path is incorrect/outdated

If the IP address receives a ping response back - try to navigate to the full URL path reported in the error message within a browser.

Oftentimes, older versions of Debian will have their package locations moved periodically or removed entirely. When an old build image is used, the package locations configured in the /etc/apt/sources.list file are not up-to-date and therefore the build fails as the location is incorrect.

As a first step, you will need to check your version of Debian. The easiest way to determine the current version of Debian included in the image you are using is by executing the following command:

1 >cat /etc/debian_version

If the Debian version is 9.13 or older

  1. You will need to update your version of Debian as security updates are no longer supported for Debian Stretch and older

  2. You can do this by updating Debian manually or by simply using a later build image version that includes a later version of Debian

If the Debian version is 9.13 or newer

  1. Once you have confirmed that the version is newer than 9.13, take a look at the package URL path that is reported in the error message

  2. Open the root of the package location in a browser, for example:

    http://security.debian.org/dists/

    http://deb.debian.org/debian/dists/

  3. You will likely notice that the exact path for the package cannot be found here when browsing it manually and instead, it returns a 404 when trying to navigate to the exact URL path reported in the error message

  4. You will therefore need to locate it manually by navigating through its source, making sure to note down the correct folder path for the version of Debian that you are using

  5. Once you have found the URL path, you can then update its location in the /etc/apt/sources.list file and attempt to execute the apt-get update command again

Solution

As per the above, the reason behind this error is usually because the server that is hosting the packages is down or the URL path for the updates is incorrect.

We strongly recommend that you use the latest version of any Docker image by configuring your YML configuration to specify this in the image tag as recent images should contain up-to-date versions of Debian that are natively supported without any other configuration changes necessary.

Example:

1 image: node:latest

If you are unable to execute your build after following the steps contained within this knowledge article - please feel free to raise a support ticket or raise a community support ticket for further assistance. 

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.