When running apt-get on an Ubuntu 20.04 LTS AWS EC2 instance in ap-southeast-2, the apt repo is sometimes failing with 503 service unavailable.

1

When running apt-get on an Ubuntu 20.04 LTS EC2 instance in ap-southeast-2, the apt repo is sometimes failing with 503 service unavailable. The instance is using the default apt repo config provided with the Ubuntu image "amazon/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20230616", owned by 099720109477. Found from the Ubuntu image locator: https://cloud-images.ubuntu.com/locator/

For example (run via an ansible task):

/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install

Some of the packages sometimes fail to be fetched with this error. The specific packages and IP addresses might vary, the error is the same Failed to fetch ... 503 Service Unavailable [IP: 3.26.8.197 80].

failed: E: Failed to fetch http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu/pool/main/[...]_amd64.deb  503  Service Unavailable [IP: 3.26.8.197 80]
E: Failed to fetch http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu/pool/main/[...]_amd64.deb  503  Service Unavailable [IP: 3.26.8.197 80]

Is this an issue with the apt repo at http://ap-southeast-2.ec2.archive.ubuntu.com or is there something I need to change on the EC2 instance?

Mark
asked 10 months ago1077 views
1 Answer
0

The repos are hosted on ubuntu.com so it's an Ubuntu issue and not AWS.

I get similar problems on a sandpit EC2 in ap-southeast-2 I just spun up to test:

root@ip-172-31-16-75:~# apt-get update
Err:1 http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu focal InRelease
  503  Service Unavailable [IP: 13.210.201.60 80]
Err:2 http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease
  503  Service Unavailable [IP: 13.210.201.60 80]
Err:3 http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease
  503  Service Unavailable [IP: 13.210.201.60 80]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2294 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [365 kB]                                                       
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [13.0 kB]                                                
Get:8 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1937 kB]                                                
Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [271 kB]                                                 
Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [640 B]                                           
Get:11 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [851 kB]                                                  
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [176 kB]                                                  
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [18.6 kB]                                           
Get:14 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.9 kB]                                               
Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5488 B]                                                
Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]                                           
Fetched 6069 kB in 13s (482 kB/s)                                                                                                         
Reading package lists... Done
W: Failed to fetch http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu/dists/focal/InRelease  503  Service Unavailable [IP: 13.210.201.60 80]
W: Failed to fetch http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  503  Service Unavailable [IP: 13.210.201.60 80]
W: Failed to fetch http://ap-southeast-2.ec2.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  503  Service Unavailable [IP: 13.210.201.60 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@ip-172-31-16-75:~# 

ap-southeast-4 (Melbourne) is fine just now though, so looks like it may be local to Sydney:

root@ip-172-31-32-118:~# apt-get update
Hit:1 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal InRelease                                    
Get:2 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                   
Get:3 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:6 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Get:7 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:8 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:9 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:10 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:11 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2678 kB]
Get:12 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [447 kB]
Get:13 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.9 kB]
Get:14 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [2045 kB]
Get:15 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [286 kB]
Get:16 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [636 B]
Get:17 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1079 kB]
Get:18 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [257 kB]
Get:19 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [25.1 kB]
Get:20 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [25.2 kB]
Get:21 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7408 B]
Get:22 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [612 B]
Get:23 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
Get:24 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
Get:25 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
Get:26 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:27 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [25.0 kB]
Get:28 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
Get:29 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
Get:30 http://ap-southeast-4.ec2.archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Get:31 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2294 kB]      
Get:32 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [365 kB]                                                      
Get:33 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [13.0 kB]                                               
Get:34 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1937 kB]                                               
Get:35 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [271 kB]                                                
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [640 B]                                           
Get:37 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [851 kB]                                                  
Get:38 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [176 kB]                                                  
Get:39 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [18.6 kB]                                           
Get:40 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.9 kB]                                               
Get:41 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5488 B]                                                
Get:42 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]                                           
Fetched 27.5 MB in 15s (1785 kB/s)                                                                                                        
Reading package lists... Done
root@ip-172-31-32-118:~# 
profile picture
EXPERT
Steve_M
answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions