

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon EBS 磁碟區連接至 Amazon ECS 任務的狀態原因
<a name="troubleshoot-ebs-volumes-scenarios"></a>

使用下列參考來修正您在設定 Amazon EBS 磁碟區以連接至 Amazon ECS 任務 AWS 管理主控台 時，在 中以狀態原因形式可能遇到的問題。如需有關在主控台中尋找這些狀態原因的詳細資訊，請參閱[檢查磁碟區連接狀態](troubleshoot-ebs-volumes.md#troubleshoot-ebs-volumes-location)。

ECS was unable to assume the configured ECS Infrastructure Role 'arn:aws:iam::*111122223333*:role/*ecsInfrastructureRole*'. Please verify that the role being passed has the proper trust relationship with Amazon ECS  
此狀態原因會出現在下列案例中。  
+  您提供的 IAM 角色未連接必要的信任政策。若角色缺少必要的信任政策，Amazon ECS 將無法存取您提供的 Amazon ECS 基礎結構 IAM 角色。任務可能會卡在 `DEPROVISIONING` 狀態。如需有關必要信任政策的詳細資訊，請參閱 [Amazon ECS 基礎結構 IAM 角色](infrastructure_IAM_role.md)。
+ 您的 IAM 使用者沒有將 Amazon ECS 基礎結構角色傳遞給 Amazon ECS 的許可。任務可能會卡在 `DEPROVISIONING` 狀態。若要避免此問題，您可以將 `PassRole` 許可連接至使用者。如需詳細資訊，請參閱[Amazon ECS 基礎結構 IAM 角色](infrastructure_IAM_role.md)。
+ 您的 IAM 角色沒有 Amazon EBS 磁碟區連接所需的必要許可。任務可能會卡在 `DEPROVISIONING` 狀態。如需有關將 Amazon EBS 磁碟區連接至任務所需特定許可的詳細資訊，請參閱 [Amazon ECS 基礎結構 IAM 角色](infrastructure_IAM_role.md)。
您也可能因角色傳播延遲而看到此錯誤訊息。若等待幾分鐘後重新嘗試使用該角色仍無法修復問題，有可能是您對該角色的信任政策設定錯誤。

ECS failed to set up the EBS volume. Encountered IdempotentParameterMismatch"; "The client token you have provided is associated with a resource that is already deleted. Please use a different client token."  
下列 AWS KMS 關鍵案例可能會導致`IdempotentParameterMismatch`訊息出現：  
+ 您指定的 KMS 金鑰 ARN、ID 或別名無效。在此案例中，任務可能看起來已成功啟動，但任務最終會失敗，因為 會以非同步方式 AWS 驗證 KMS 金鑰。如需詳細資訊，請參閱 *Amazon EC2 User Guide* 中的 [Amazon EBS encryption](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html)。
+ 您提供的客戶自管金鑰缺少必要許可，導致 Amazon ECS 基礎結構 IAM 角色無法使用該金鑰進行加密。若要避免金鑰政策許可問題，請參閱 [Amazon EBS 磁碟區資料加密](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-kms-encryption)中的範例 AWS KMS 金鑰政策。
您可以設定 Amazon EventBridge，將 Amazon EBS 磁碟區事件與 Amazon ECS 任務狀態變更事件傳送至目標，例如 Amazon CloudWatch 群組。然後，您可透過這些事件識別影響磁碟區連接的特定客戶自管金鑰相關問題。如需詳細資訊，請參閱  
+  [如何建立 CloudWatch 日誌群組，做為 re：Post 上 EventBridge 規則的目標？](https://repost.aws/knowledge-center/cloudwatch-log-group-eventbridge)。 AWS 
+ [任務狀態變更事件](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events)。
+ *Amazon EBS User Guide* 中的 [Amazon EventBridge events for Amazon EBS](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-cloud-watch-events.html)。

ECS timed out while configuring the EBS volume attachment to your Task.  
下列檔案系統格式案例會導致出現此訊息。  
+ 您在設定期間指定的檔案系統格式與[任務的作業系統](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RuntimePlatform.html)不相容。
+ 您設定要從快照建立的 Amazon EBS 磁碟區，但快照的檔案系統格式與任務的作業系統不相容。對於從快照建立的磁碟區，您必須指定與建立快照時磁碟區所使用的相同檔案系統類型。
您可利用 Amazon ECS 容器代理程式日誌，就此訊息對 EC2 任務進行疑難排解。如需詳細資訊，請參閱 [Amazon ECS 日誌檔案位置](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/logs.html)與 [Amazon ECS 日誌收集器](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-logs-collector.html)。