> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/developer-tools/snyk-cli/scan-and-maintain-projects-using-the-cli/invalid-string-length-error-when-scanning-projects.md).

# Invalid string length error when scanning projects

How to resolve the invalid string length error when scanning Projects with the CLI

The invalid string length error can occur in the following situations:

* Scanning **many Projects** at once using the `--all-projects` option in combination with the `--json` or `--json-file-output=<OUTPUT_FILE_PATH>` options.
* Scanning a **large Project** using the `--json` or `--json-file-output=<OUTPUT_FILE_PATH>` options.

You can use the following workarounds to avoid the invalid string length error.

* Remove the `--json` or `--json-file-output=<OUTPUT_FILE_PATH>` option. This may not be possible in integrations using the CLI, for example, CI/CD integrations.
* If you require the JSON output, try increasing the severity threshold using the `--severity-threshold=<SEVERITY_LEVEL>` option. This is likely to reduce the number of less critical vulnerabilities reported and thus reduce the size of the JSON file output.
* If you are scanning multiple Projects using the `--all-projects` option, try removing this option and scanning Projects individually.
* Another method of reducing the JSON output is adding the `--prune-repeated-subdependencies` option. This may sufficiently reduce the size of the resulting scan so the JSON can be resolved.

For detailed information about the CLI options, see the [CLI test command help](/developer-tools/snyk-cli/commands/test.md).


---

# 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://docs.snyk.io/developer-tools/snyk-cli/scan-and-maintain-projects-using-the-cli/invalid-string-length-error-when-scanning-projects.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.
