

# Amazon ECS ResourceNotFoundException エラーのトラブルシューティング
<a name="resource-not-found-error"></a>

以下に、` ResourceNotFoundException` エラーメッセージおよび、そのエラーを修正するために取れる措置を示します。

停止したタスクのエラーメッセージを AWS マネジメントコンソール で確認する方法については、「[Amazon ECS の停止したタスクのエラーを表示する](stopped-task-errors.md)」を参照してください。

## The task can't retrieve the secret with ARN '*sercretARN*' from AWS Secrets Manager. Check whether the secret exists in the specified Region.
<a name="unable-to-pull-secrets-ecr"></a>

このエラーは、タスクが Secrets Manager からシークレットを取得できない場合に発生します。つまり、タスク定義で指定されたシークレット (およびエラーメッセージに含まれるシークレット) は Secrets Manager に存在しないということです。

リージョンはエラーメッセージに含まれています。

Fetching secret data from AWS Secrets Manager in region *region*: secret *sercretARN*: ResourceNotFoundException: Secrets Manager can't find the specified secret.

シークレットの検索方法については、「*AWS Secrets Manager ユーザーガイド*」の「[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/ja_jp/AmazonECS/latest/developerguide/resource-not-found-error.html) | 
| タスク定義に誤ったシークレット ARN が存在します。正しいシークレットは Secrets Manager に存在します。 | 正しいシークレットでタスク定義を更新します。詳細については、「Amazon Elastic Container Service API リファレンス」の「[コンソールを使用した Amazon ECS タスク定義の更新](update-task-definition-console-v2.md)」または「[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/ja_jp/AmazonECS/latest/developerguide/resource-not-found-error.html)  | 