Amazon-Web-Services
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®ion=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®ion=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®ion=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®ion=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®ion=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®ion=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®ion=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®ion=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®ion=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®ion=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®ion=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.
更新
根據大衛關於“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
我在舊的 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®ion=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®ion=ap-southeast-2: [Errno 14] HTTP Error 403 - Forbidden ] 0.0 B/s | 0 B --:--:-- ETA Trying other mirror. ...
我非常有信心這是 AWS 包儲存庫的間歇性問題。它應該很快就會消失。我希望 :)
順便說一句,您可以對您的實例進行快照並使用支持計劃將其恢復到一個帳戶中,以便於測試,如果它在幾個小時內沒有恢復,您可以提出支持請求。
希望有幫助:)