

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

# 對 Amazon ECS ResourceNotFoundException 錯誤進行疑難排解
<a name="resource-not-found-error"></a>

以下是部分 ` ResourceNotFoundException` 錯誤訊息以及可採取的錯誤修正動作。

若要使用 檢查已停止的任務是否有錯誤訊息 AWS 管理主控台，請參閱 [檢視 Amazon ECS 已停止任務錯誤](stopped-task-errors.md)。

## 任務無法從中擷取具有 ARN '*sercretARN*' 的秘密 AWS Secrets Manager。Check whether the secret exists in the specified Region.
<a name="unable-to-pull-secrets-ecr"></a>

當任務無法從 Secrets Manager 擷取秘密時，就會發生此錯誤。這表示在任務定義中指定 (並且在錯誤訊息中包含) 的秘密不存在於 Secrets Manager 中。

區域資訊包含在錯誤訊息中。

從 AWS Secrets Manager *區域*擷取秘密資料：秘密 *sercretARN*：ResourceNotFoundException：Secrets Manager 找不到指定的秘密。

如需有關尋找秘密的資訊，請參閱 *AWS Secrets Manager User Guide* 中的 [Find secrets in AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html)。

使用下表來判斷並解決錯誤。


| 問題 | 動作 | 
| --- | --- | 
| 秘密位於與任務定義不同的區域。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonECS/latest/developerguide/resource-not-found-error.html) | 
| 任務定義的秘密 ARN 不正確。Secrets Manager 中存在正確的秘密。 | 使用正確的秘密更新任務定義。如需詳細資訊，請參閱[使用主控台更新 Amazon ECS 任務定義](update-task-definition-console-v2.md)，或 Amazon Elastic Container Service API Reference 中的 [RegisterTaskDefinition](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html)。 | 
| 秘密不再存在。 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonECS/latest/developerguide/resource-not-found-error.html)  | 