跳至內容

如何對 Patch Manager (Linux) 的操作失敗問題進行疑難排解?

2 分的閱讀內容
0

我想要疑難排解 AWS Systems Manager (Linux) 功能 Patch Manager 的操作失敗問題。

簡短說明

若要疑難排解失敗的 Patch Manager 操作,請在 AWS 管理主控台或 API 回應中尋找相關錯誤訊息。接著,執行 AWSSupport-TroubleshootPatchManagerLinux 執行手冊,或手動疑難排解您看到的錯誤訊息。

如需更多資訊,請參閱疑難排解 Patch Manager。

解決方法

識別相關錯誤訊息

以下訊息是您在主控台中找到的錯誤訊息範例:

「failed to run commands: exit status 1」

主控台會將輸出截斷為 24,000 個字元。若要檢閱儲存在受管節點上的完整輸出,請前往以下位置:

/var/lib/amazon/ssm/example-instance-id/document/orchestration/example-command-id/awsrunShellScript/PatchLinux/stdout

注意: 將 example-instance-id 替換為您的 Systems Manager 執行個體 ID,並將 example-command-id 替換為您的命令 ID。

如果先前的位置不包含 AWS Systems Manager 功能 Run Command 的輸出,請在 Amazon Simple Storage Service (Amazon S3) 或 Amazon CloudWatch 中尋找輸出。使用者可以設定操作,將 Run Command 輸出傳送至 Amazon S3 或 CloudWatch。

使用 AWSSupport-TroubleshootPatchManagerLinux 執行手冊

使用 AWSSupport-TroubleshootPatchManagerLinux 執行手冊疑難排解 Linux 型受管節點的修補失敗問題。如需更多資訊,請參閱 AWSSupport-TroubleshootPatchManagerLinux。

手動疑難排解 Patch Manager 錯誤

根據您的錯誤訊息完成以下疑難排解動作,以解決 Patch Manager 問題。

「Cannot acquire lock.Another patching operation is in progress」

當多個修補操作同時在同一個受管節點上執行時,您會收到以下錯誤:

「[ERROR]: Cannot acquire lock on /var/log/amazon/ssm/patch-baseline-concurrent.lock.Another patching operation is in progress.」

重要: 最佳實務是僅在沒有排定的修補操作正在進行時,才手動啟動 Patch now 操作。

若要確保您未排定多個修補操作同時在同一個受管節點上執行,請完成以下檢查:

  • 檢查 AWS Systems Manager 功能快速設定的修補政策組態,並確認其未與其他修補排程重疊。
  • 檢閱您的維護時段關聯,並確認每次只有一個時段以各受管節點為修補任務目標。
  • 排定的修補正在進行時,請勿手動啟動「Patch now」操作。

「Permission denied」

如果您使用 noexec 權限掛載 /var/lib/amazon,則會收到以下錯誤訊息:

「/var/lib/amazon/ssm/example-instance-id/document/orchestration/example-command-id/PatchLinux/_script.sh: Permission denied failed to run commands: exit status 126」

若要解決此問題,請為 /var/log/amazon 和 /var/lib/amazon 設定專用分區,並使用 exec 權限掛載這些分區。

「Unable to download payload」

如果受管節點沒有存取指定 S3 儲存貯體所需的權限,則會收到以下錯誤訊息:

「Unable to download payload: https://s3.doc-example-bucket.region.amazonaws.com/aws-ssm-region/patchbaselineoperations/linux/payloads/patch-baseline-operations-1.23.tar.gz.failed to run commands: exit status 156」

若要解決此問題,請更新您的網路組態,並確定可以連線至區域端點。如需更多資訊,請參閱 AWS Systems Manager Agent (SSM Agent) 與 AWS 管理的 S3 儲存貯體進行通訊。

「No such file or directory」

如果 /var 目錄沒有可用的磁碟空間,則會收到以下錯誤訊息:

「IOError: [Errno 2] No such file or directory: 'patch-baseline-operations-1.23.tar.gz' Unable to extract tar file: /var/log/amazon/ssm/patch-baseline-operations/patch-baseline-operations-1.75.tar.gz. failed to run commands: exit status 155 Unable to load and extract the content of payload, abort. failed to run commands: exit status 152」

若要解決此問題,請在 /var 目錄下提供更多可用磁碟空間。

「Another process has acquired yum lock」

如果 AWS-RunPatchBaseline 在已執行 yum 且另一個程序已鎖定資料庫的受管節點上執行,則會收到以下錯誤訊息:

「11/22/3333 44:55:66 root [INFO]: another process has acquired yum lock, waiting 2 s and retry.」

若要解決此問題,請完成以下檢查:

  • 確定沒有 State Manager 關聯、維護時段任務或其他依排程執行 AWS-RunPatchBaseline 的組態,同時以相同受管節點為目標。
  • 確定沒有手動 yum 操作同時執行。

「An unsupported package manager and python version combination was found」

對於 Red Hat Enterprise Linux (RHEL)、Debian Server、Raspberry Pi 或 Ubuntu Server 執行個體,請確定您已安裝支援的 Python 3 版本。如果您未安裝支援的版本,則會收到以下錯誤訊息:

「An unsupported package manager and python version combination was found.Dnf requires Python 2 or Python 3 to be installed.」

若要解決此問題,請在所需的伺服器上安裝 Python 3.0 至 3.9 版。

「UnsupportedOperatingSystem」

如果您的作業系統 (OS) 不支援 Patch Manager,則會收到以下錯誤訊息:

「An error occurred (UnsupportedOperatingSystem) when calling the GetDeployablePatchSnapshotForInstance operation: patch_common.exceptions.PatchManagerError: ('Unsupported Operating System', 146)」

若要解決此問題,請使用支援 Patch Manager 的 OS。

AWS 官方已更新 7 個月前