agent (ubuntu-latest) errors failing to fetch packages

Mike Navin 30 Reputation points
2025-05-29T21:53:07.5433333+00:00

Using a hosted pipeline agent with Image: ubuntu-latest we are receiving errors retrieving packages when the agent runs the task: Docker@2 with command: buildAndPush. This affects multiple agents but not all and differs between builds. We have multiple jobs running at the same time that build different container images with the Docker@2 task. This only started as an issue today with no changes to our build definition.

Please see some of the errors below. Full log also attached.errors.txt


2025-05-29T20:44:23.0907226Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0908180Z ##[error]#10 3.569 Err:53 http://archive.ubuntu.com/ubuntu noble/main amd64 libgraphite2-3 amd64 1.3.14-2build1
2025-05-29T20:44:23.0909091Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0910037Z ##[error]#10 3.569 Err:54 http://archive.ubuntu.com/ubuntu noble/main amd64 libharfbuzz0b amd64 8.3.0-2build2
2025-05-29T20:44:23.0910955Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0911886Z ##[error]#10 3.569 Err:55 http://archive.ubuntu.com/ubuntu noble/main amd64 libthai-data all 0.1.29-2build1
2025-05-29T20:44:23.0913031Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0913990Z ##[error]#10 3.569 Err:56 http://archive.ubuntu.com/ubuntu noble/main amd64 libthai0 amd64 0.1.29-2build1
2025-05-29T20:44:23.0914894Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0915865Z ##[error]#10 3.569 Err:57 http://archive.ubuntu.com/ubuntu noble/main amd64 libpango-1.0-0 amd64 1.52.1+ds-1build1
2025-05-29T20:44:23.0916776Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0917732Z ##[error]#10 3.569 Err:58 http://archive.ubuntu.com/ubuntu noble/main amd64 libpangoft2-1.0-0 amd64 1.52.1+ds-1build1
2025-05-29T20:44:23.0918805Z ##[error]#10 3.569   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0922535Z ##[error]#10 3.573 Err:59 http://archive.ubuntu.com/ubuntu noble/main amd64 libpangocairo-1.0-0 amd64 1.52.1+ds-1build1
2025-05-29T20:44:23.0923785Z ##[error]#10 3.573   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0924800Z ##[error]#10 3.573 Err:60 http://archive.ubuntu.com/ubuntu noble/universe amd64 libgdiplus amd64 6.1+dfsg-1build3
2025-05-29T20:44:23.0925718Z ##[error]#10 3.573   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0928256Z ##[error]#10 3.573 Ign:61 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libheif-plugin-aomenc amd64 1.17.6-1ubuntu4.1
2025-05-29T20:44:23.0929300Z ##[error]#10 3.589 Err:62 http://archive.ubuntu.com/ubuntu noble/main amd64 manpages-dev all 6.7-2
2025-05-29T20:44:23.0930187Z ##[error]#10 3.589   403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0931154Z ##[error]#10 3.601 Get:61 http://security.ubuntu.com/ubuntu noble-updates/main amd64 libheif-plugin-aomenc amd64 1.17.6-1ubuntu4.1 [14.7 kB]
2025-05-29T20:44:23.0932067Z ##[error]#10 3.619 Fetched 16.5 MB in 0s (35.9 MB/s)
2025-05-29T20:44:23.0933317Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/giflib/libgif7_5.2.2-1ubuntu1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0934390Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/graphite2/libgraphite2-3_1.3.14-2build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0935635Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/h/harfbuzz/libharfbuzz0b_8.3.0-2build2_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0937299Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libt/libthai/libthai-data_0.1.29-2build1_all.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0938406Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libt/libthai/libthai0_0.1.29-2build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0939518Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpango-1.0-0_1.52.1%2bds-1build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0940628Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpangoft2-1.0-0_1.52.1%2bds-1build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0941721Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpangocairo-1.0-0_1.52.1%2bds-1build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0943587Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/libg/libgdiplus/libgdiplus_6.1%2bdfsg-1build3_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0944842Z ##[error]#10 3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/manpages/manpages-dev_6.7-2_all.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0946879Z ##[error]#10 3.619 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
2025-05-29T20:44:23.0948268Z ##[error]#10 ERROR: process "/bin/sh -c apt-get install -y libgdiplus libc6-dev" did not complete successfully: exit code: 100
2025-05-29T20:44:23.0951303Z ##[error]#5 [build  1/14] FROM mcr.microsoft.com/dotnet/sdk:8.0-noble@sha256:65b1e74faf14ae8dba77f48407fa7f7934f911ebef63cb5e04c5003d8e533f5d
2025-05-29T20:44:23.0953194Z ##[error]#5 extracting sha256:1d03b3362d69555ea8a8c7e95b1033030c45ff206ac486ff3ef6819583ca4462 7.4s done
2025-05-29T20:44:23.0954420Z ##[error]#5 extracting sha256:62476e7eaa8d63e51650705f2704914d2786977612fbe8a5271d4086b2498cc1 5.1s
2025-05-29T20:44:23.0955904Z ##[error]#5 CANCELED
2025-05-29T20:44:23.0959270Z ##[error]#9 [internal] load build context
2025-05-29T20:44:23.0960377Z ##[error]#9 transferring context: 176.82MB 13.7s done
2025-05-29T20:44:23.0961875Z ##[error]#9 CANCELED
2025-05-29T20:44:23.0963161Z ##[error]------
2025-05-29T20:44:23.0964315Z ##[error] > [base  4/13] RUN apt-get install -y libgdiplus libc6-dev:
2025-05-29T20:44:23.0965524Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/graphite2/libgraphite2-3_1.3.14-2build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0966879Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/h/harfbuzz/libharfbuzz0b_8.3.0-2build2_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0968320Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libt/libthai/libthai-data_0.1.29-2build1_all.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0969570Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libt/libthai/libthai0_0.1.29-2build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0971011Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpango-1.0-0_1.52.1%2bds-1build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0972568Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpangoft2-1.0-0_1.52.1%2bds-1build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0974055Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpangocairo-1.0-0_1.52.1%2bds-1build1_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0975837Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/libg/libgdiplus/libgdiplus_6.1%2bdfsg-1build3_amd64.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0977248Z ##[error]3.619 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/manpages/manpages-dev_6.7-2_all.deb  403  Forbidden [IP: 185.125.190.83 80]
2025-05-29T20:44:23.0978636Z ##[error]3.619 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
2025-05-29T20:44:23.0979683Z ##[error]------
2025-05-29T20:44:23.0980848Z ##[error]Dockerfile:6
2025-05-29T20:44:23.0981909Z ##[error]--------------------
2025-05-29T20:44:23.0983197Z ##[error]   4 |     RUN apt-get update -y
2025-05-29T20:44:23.0984154Z ##[error]   5 |     RUN apt-get upgrade -y
2025-05-29T20:44:23.0985141Z ##[error]   6 | >>> RUN apt-get install -y libgdiplus libc6-dev
2025-05-29T20:44:23.0986255Z ##[error]   7 |     RUN apt-get install -y libicu-dev libharfbuzz0b libfontconfig1 libfreetype6
2025-05-29T20:44:23.0987368Z ##[error]   8 |     RUN apt-get install -y fontconfig
2025-05-29T20:44:23.0988406Z ##[error]--------------------
2025-05-29T20:44:23.0989479Z ##[error]ERROR: failed to solve: process "/bin/sh -c apt-get install -y libgdiplus libc6-dev" did not complete successfully: exit code: 100
2025-05-29T20:44:23.0994448Z ##[error]The process '/usr/bin/docker' failed with exit code 1
2025-05-29T20:44:23.1000977Z ##[section]Finishing: Build and push SdsPosWeb to container registry
Azure DevOps
0 comments No comments
{count} vote

Accepted answer
  1. Alex Burlachenko 10,335 Reputation points
    2025-05-30T08:45:03.6433333+00:00

    Hi Mike Navin that's a classic ubuntu package mirror hiccup )) happens to the best of us. any way, thanks for posting this with all the deets makes it way easier to help u out, really, u cant imagine how many ppl review each issue...

    any way lets back to u situation, those 403 forbidden errors from archive.ubuntu.com usually mean the mirror u're hitting is either overloaded or temporarily down. good news is, microsoft's hosted agents already have a fix for this baked in, u just gotta tweak ur dockerfile a bit. Aha.

    what we wanna do with it, lets switch to security.ubuntu.com it's way more reliable for package fetching. add this line before any apt-get installs in ur dockerfile

    RUN sed -i 's|http://archive.ubuntu.com|http://security.ubuntu.com|g' /etc/apt/sources.list
    
    

    this swaps out the flaky mirror for the more stable one. microsoft docs actually recommend this for hosted agents when ubuntu mirrors act up (source). always run apt-get update first even if u already have it (I do it :))) , sometimes cache gets weird. do this right after the sed command

    RUN apt-get update -y --fix-missing
    

    the --fix-missing flag helps if some packages failed earlier. retry logic if u wanna go extra safe, wrap the install in a retry loop. like this

    RUN for i in {1..3}; do apt-get install -y libgdiplus libc6-dev && break || sleep 15; done
    

    this tries 3 times with 15-second breaks between fails. saved my builds more than once ))

    also if u're using mcr.microsoft.com/dotnet/sdk:8.0-noble, check if u can use a tagged version instead of sha256 hash. time to time the hash points to an image that’s mid-update and causes these issues. give this a shot and lemme know if the errors stick around.

    microsoft’s ubuntu agents are usually solid, but mirrors gonna mirror )))

    btw, if u still hit snags, u can force-clear the docker build cache in azure pipelines by adding a "docker system prune -af" step just sayin’ :)))) dont give up )))

    Best regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    PPS That is my Answer and not a Comment
    

    https://ctrlaltdel.blog/

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.