> For the complete documentation index, see [llms.txt](https://help.cloudstoragesec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.cloudstoragesec.com/trouble-shooting/my-scanning-agents-keep-starting-up-and-immediately-shutting-down.md).

# My scanning agents keep starting up and immediately shutting down

The main reason we see this happening is the agent does not have a route (outbound over internet or through VPC Endpoint) path to Amazon ECR.

This scenario is where the Fargate Service Task cannot reach out to the ECR to get the task image itself to properly load it. What you'll find here is you'll get the following message:

> STOPPED (ResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve ecr registry auth: service call has been retried 1 time(s): RequestError: send request failed caused by: Post <https://api.ecr>....)

The agent service just needs to gain access to the ECR. There are two main ways to accomplish this:

* Ensure your VPC is attached to an Internet Gateway with outbound access
* Leverage VPC Endpoints to get you to ECR and API calls internally through AWS' network

<figure><img src="https://905555942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlGcQw8I2CHyi1loKBlfi%2Fuploads%2FFvOALxPb2CY8e4fZtW96%2Fimage.png?alt=media&amp;token=64ecded0-5eb0-4447-a3ab-c49305e39ab7" alt=""><figcaption><p><strong>This the Default Public Deployment from AWS VPC</strong><br>You can take an easier a look at the subnets involved and Network connections. Check that the Security Group has outbound access allowed as well</p></figcaption></figure>

{% hint style="warning" %}
Both the console and the scanning agents can run in private subnets and do not require public IPs as long as they can communicate outbound and you can still get to the console.
{% endhint %}

Don't forget about **Security Groups**. We have seen customers be tricked (really just forgotten about the rules they had in place) on gaining access to the console because of the SG that was in place.

{% hint style="danger" %}
Security Groups can also have outbound restrictions. By default they are wide open, but that does not mean yours are. If the steps above do not fix this issue, double check your Security Group settings (outbound rules).
{% endhint %}

If taking these steps does not resolve the problem, please [Contact Us](/contact-us.md). We are here to help!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.cloudstoragesec.com/trouble-shooting/my-scanning-agents-keep-starting-up-and-immediately-shutting-down.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
