apt update: Cannot initiate the connection to repo.mongodb.org:443

0

My goal was to update the community server mongodb on an EC2 Ubuntu 20.04.3 LTS. There seems to be a network connectivity problem though. I can't quite believe that this is a problem in software, since it appears as though the ec2 instaance isn't configured correctly to make/sustain the connection for updates. What would be the place to start in understanding and correcting where the to change or report configuration data?

ubuntu@ip-172-31-76-213:~$ lsb_release -dc
Description:    Ubuntu 20.04.3 LTS
Codename:       focal
ubuntu@ip-172-31-76-213:~$ sudo apt update
Err:1 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 InRelease                                                                                                                           
  Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:c600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ba00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:a400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:e200:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ca00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Could not connect to repo.mongodb.org:443 (13.32.151.96), connection timed out Could not connect to repo.mongodb.org:443 (13.32.151.61), connection timed out Could not connect to repo.mongodb.org:443 (13.32.151.30), connection timed out Could not connect to repo.mongodb.org:443 (13.32.151.5), connection timed out
Err:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease                                                                                                                          
  Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:c600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ba00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:a400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:e200:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ca00:0:bd83:86c0:93a1). - connect (101: Network is unreachable)
Err:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 InRelease                                                  
  Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:c600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ba00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:a400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:e200:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ca00:0:bd83:86c0:93a1). - connect (101: Network is unreachable)
Err:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                           
  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.36), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
Err:5 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal InRelease                                                       
  Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (18.232.150.247), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (34.201.250.36), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (34.237.137.22), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (52.73.36.184), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (52.91.65.63), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (52.207.133.243), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (54.87.19.168), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (54.165.17.230), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (3.87.126.146), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (3.209.10.109), connection timed out
Err:6 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease
  Unable to connect to us-east-1.ec2.archive.ubuntu.com:http:
Err:7 http://us-east-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease
  Unable to connect to us-east-1.ec2.archive.ubuntu.com:http:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
72 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/dists/focal/InRelease  Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (18.232.150.247), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (34.201.250.36), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (34.237.137.22), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (52.73.36.184), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (52.91.65.63), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (52.207.133.243), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (54.87.19.168), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (54.165.17.230), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (3.87.126.146), connection timed out Could not connect to us-east-1.ec2.archive.ubuntu.com:80 (3.209.10.109), connection timed out
W: Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Unable to connect to us-east-1.ec2.archive.ubuntu.com:http:
W: Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Unable to connect to us-east-1.ec2.archive.ubuntu.com:http:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.36), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out
W: Failed to fetch https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.2/InRelease  Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:c600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ba00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:a400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:e200:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ca00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Could not connect to repo.mongodb.org:443 (13.32.151.96), connection timed out Could not connect to repo.mongodb.org:443 (13.32.151.61), connection timed out Could not connect to repo.mongodb.org:443 (13.32.151.30), connection timed out Could not connect to repo.mongodb.org:443 (13.32.151.5), connection timed out
W: Failed to fetch https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/5.0/InRelease  Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:c600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ba00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:a400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:e200:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ca00:0:bd83:86c0:93a1). - connect (101: Network is unreachable)
W: Failed to fetch https://repo.mongodb.org/apt/ubuntu/dists/focal/mongodb-org/6.0/InRelease  Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:c600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ba00:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:a400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:4400:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:600:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:e200:0:bd83:86c0:93a1). - connect (101: Network is unreachable) Cannot initiate the connection to repo.mongodb.org:443 (2600:9000:2009:ca00:0:bd83:86c0:93a1). - connect (101: Network is unreachable)
W: Some index files failed to download. They have been ignored, or old ones used instead.
ubuntu@ip-172-31-76-213:~$ 
asked 2 years ago251 views
1 Answer
0

I agree this seems like a networking issue. Here are some places to start:

Make sure your EC2 instance has a route to the internet

There are a couple ways to do this -- both require a VPC with an attached Internet Gateway. A public subnet is a subnet that has a route in the route table to the Internet gateway.

  1. If you put your EC2 instance in a public subnet then you should have a route to the internet. I can't tell what type of subnet you're deployed in based on your terminal prompt since it looks like you connected to the EC2 instance via a private IP within the AWS network.
  2. If you don't want to put your EC2 instance in a public subnet, you need to put a route to a public subnet with a deployed NAT gateway from your private subnet.

Check your EC2 Security Group doesn't block outbound access on port 443

If you're using the default security group then this should not be the case but if you've edited them at all they could be blocking access on port 443. Keep in mind that the default behavior for a security group is to block -- so unless there's a specific rule for allowing outbound 443 then you'll need to configure this.

Check your Network Access Control List (ACL) and make sure it is allowing outbound traffic on 443 and inbound traffic on ephemeral ports

Again, if you are using the default NACLs they allow all traffic. If not, you'll need to make sure this traffic is specifically allowed. You'll need to allow outbound on 443 and inbound on ephemeral ports.

profile pictureAWS
answered 2 years ago
  • I hadn't changed the ACL at all from the normal outbound rules default (all traffic/all ports). Logging in via ssh doesn't change the situation Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.15.0-1015-aws x86_64)

    System information as of Tue Oct 18 14:45:23 UTC 2022

    System load: 0.0 Processes: 121 Usage of /: 25.4% of 29.01GB Users logged in: 0 Memory usage: 1% IPv4 address for eth0: xxx.31.76.xxx Swap usage: 0%

    79 updates can be applied immediately. To see these additional updates run: apt list --upgradable

    The list of available updates is more than a week old. To check for new updates run: sudo apt update Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings

    Last login: Tue Oct 18 13:39:58 2022 from xxx.65.111.41

    route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default ip-172-31-xxx-1. 0.0.0.0 UG 100 0 0 eth0 172.31.xxx.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0 ip-172-31-xxx-1. 0.0.0.0 255.255.255.255 UH 100 0 0 eth0

  • Is the mongo repo the only one that's reporting as unreachable? Are you able to install and/or update other packages? It looks like your EC2 instance is also having trouble connecting to east-1.ec2.archive.ubuntu.com:80.

  • Also -- have you edited the iptables at all?

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