Amazon Linux - yum 更新失败,出现 HTTP 错误 403 - 禁止访问

Amazon Linux - yum 更新失败,出现 HTTP 错误 403 - 禁止访问

我在 us-west-2(俄勒冈州)有一个 Amazon Linux v1 实例,yum 更新失败,如下所示。这是一个运行良好的旧实例,几个月前更新为 t3a.nano。它在 VPC 中有一个 S3 网关。

我在同一区域创建了一个 m3.large 实例,更新时没有遇到任何问题。

有什么办法可以解决这个问题吗?我没有 AWS 支持,所以我无法询问他们,但如果问题仍然存在,我会再次尝试在有支持的帐户中重现此问题。

sudo yum update  amazon-ssm-agent
Loaded plugins: update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package amazon-ssm-agent.x86_64 0:2.3.662.0-1.amzn1 will be updated
---> Package amazon-ssm-agent.x86_64 0:2.3.714.0-1.amzn1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================
 Package                      Arch               Version                        Repository                Size
===============================================================================================================
Updating:
 amazon-ssm-agent             x86_64             2.3.714.0-1.amzn1              amzn-updates              25 M

Transaction Summary
===============================================================================================================
Upgrade  1 Package

Total download size: 25 M
Is this ok [y/d/N]: y
Downloading packages:
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.us-east-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/solutions/69319

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.ap-northeast-2.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.ap-east-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.eu-central-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.sa-east-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.ap-southeast-2.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.us-west-2.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.us-west-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.ap-southeast-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.ap-northeast-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.
amazon-ssm-agent-2.3.714.0-1.a FAILED
http://packages.eu-west-1.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64.rpm?instance_id=i-863eaf5c&region=us-west-2: [Errno 14] HTTP Error 403 - Forbidden
Trying other mirror.


Error downloading packages:
  amazon-ssm-agent-2.3.714.0-1.amzn1.x86_64: [Errno 256] No more mirrors to try.

更新

根据 David 的建议“yum clean all”,我登录并尝试了。执行此操作后,yum no 提示没有可用更新 - 尽管 Amazon Linux 告诉我通过 SSH 登录时有三个可用更新。

笔记:

  • 当前 amazon-ssm-agent 是 2.3.662.0
  • 之前 yum 说将从 0:2.3.662.0 更新到 0:2.3.714.0-1

以下是 SSH 会话

Last login: Thu Dec 19 09:28:01 2019 from (IP address removed)
3 package(s) needed for security, out of 8 available <-- ***
Run "sudo yum update" to apply all updates.
sudo yum clean all
Loaded plugins: update-motd, upgrade-helper
Cleaning repos: amzn-main amzn-updates epel-debuginfo epel-source
Cleaning up everything


sudo yum update -y
Loaded plugins: update-motd, upgrade-helper
amzn-main                                                | 2.1 kB     00:00
amzn-updates                                             | 2.5 kB     00:00
epel-debuginfo/x86_64/metalink                           |  17 kB     00:00
epel-debuginfo                                           | 3.0 kB     00:00
epel-source/x86_64/metalink                              |  17 kB     00:00
epel-source                                              | 4.1 kB     00:00
(1/8): amzn-main/latest/group_gz                           | 4.4 kB   00:00
(2/8): amzn-updates/latest/group_gz                        | 4.4 kB   00:00
(3/8): epel-source/x86_64/updateinfo                       | 792 kB   00:00
(4/8): amzn-updates/latest/updateinfo                      | 615 kB   00:00
(5/8): epel-source/x86_64/primary_db                       | 1.9 MB   00:00
(6/8): epel-debuginfo/x86_64/primary_db                    | 831 kB   00:00
(7/8): amzn-main/latest/primary_db                         | 4.0 MB   00:01
(8/8): amzn-updates/latest/primary_db                      | 2.5 MB   00:01
No packages marked for update

答案1

我在旧的 Amazon Linux 实例上也遇到了同样的问题:

$ sudo yum upgrade xz
[...]
Downloading packages:
xz-5.2.2-1.13.amzn1.x86_64.rpm FAILED                                          
http://packages.ap-southeast-2.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/xz-5.2.2-1.13.amzn1.x86_64.rpm?instance_id=i-abcdefgh&region=ap-southeast-2: [Errno 14] HTTP Error 403 - Forbidden]  0.0 B/s |    0 B  --:--:-- ETA 
Trying other mirror.
xz-5.2.2-1.13.amzn1.x86_64.rpm FAILED                                          
http://packages.us-west-2.amazonaws.com/2018.03/updates/5444ecdf4764/x86_64/Packages/xz-5.2.2-1.13.amzn1.x86_64.rpm?instance_id=i-abcdefgh&region=ap-southeast-2: [Errno 14] HTTP Error 403 - Forbidden     ]  0.0 B/s |    0 B  --:--:-- ETA 
Trying other mirror.
...

我确信这是 AWS 软件包存储库的一个间歇性问题。它应该很快就会消失。我希望 :)

顺便说一句,您可以对您的实例进行快照并在具有支持计划的帐户中恢复它以方便测试,如果它在几个小时内没有恢复,您可以提出支持请求。

希望有帮助:)

相关内容