Troubleshooting
This page details some of the common errors reported by the CLI tool and provides best practice advice to prevent these errors from occurring.
Common errorsLink copied!
The format of errors is as follows. A request may result in multiple errors:
Some of the common errors are shown below.
| Error code | Description |
|---|---|
CONTENT_TYPE_INVALID | This is a validation error. Validation errors often also include the error message: should NOT have more than [X] items or the error entity: ContentTypeValidation. |
CONTENT_ITEM_UNABLE_TO_EXECUTE_FACETS | This is a bulk action error. Bulk action errors may also include the error message: Unable to perform faceting. |
Validation errorsLink copied!
Validation errors can occur when your content is not valid according to the parameters outlined in your schema.
Ignoring schema validation
When you use the CLI tool to migrate content items, you can bypass schema validation using flag –-ignoreSchemaValidation flag. Note the destination hub must be set to Ignore schema validation.
When creating content, validation parameters are defined in the content type schema to limit the inputs of certain fields. In the title property below, we have set the minimum text length to 1 and the maximum text length to 150 characters.
If you changed the maxLength of the title property to 100 characters, any existing content with titles that exceed that length would no longer be valid. This will include content that you've already exported that was created using an earlier version of this schema.
How to check for invalid content itemsLink copied!
When running a hub clone or content item copy command, you can specify the --validate option. This will validate the content and create the folder structure but not import the content. You can then fix any validation errors and run the command without the —validate option.
Preventing validation errorsLink copied!
In order to prevent a validation issue from occurring, the best practice is to ensure all the content in your hub follows the parameters outlined in the schema. It is best to do this before attempting to perform a copy or clone action in the CLI tool. Validation errors will usually enable you to identify invalid content. You can then update your schema validation or modify the content so that it passes validation.
For more information about validation parameters, please visit the validation page.
Validation error examplesLink copied!
Below you'll find an example of a validation error when a clone is run with and without the --validate command.
Validation error when run with validate optionLink copied!
In the error below, we have received a warning that one of our blogs does not validate under the available schema and may not import correctly. The --validate option allows us to identity the content items that do not pass validation.
Validation error when run without validate commandLink copied!
The error below shows the output of a clone when some invalid content is encountered and the --validate option is not specified. The clone command fails with an error and a validation error is shown.
Note
The --force option is particularly useful if you are combining multiple commands into scripts that you want to run unattended. This option will ignore any warnings and not wait for any prompts so the script can run without any user input. It is recommended that you use --validate to identify any problems before running scripts that use the --force option.
Bulk action errorsLink copied!
Another kind of error you may encounter could be a bulk action error. These kinds of errors occur when the task you're trying to perform includes actions on too many pieces of content.
Preventing bulk action errorsLink copied!
A solution to bulk action errors would be to break down your processes into smaller tasks so as to not overload the CLI tool's capability.
Bulk action error examplesLink copied!
Bulk action errors usually include the code "CONTENT_ITEM_UNABLE_TO_EXECUTE_FACETS which indicates the ClI tool's inability to deal with a large amount of content. Similar to validation errors, these errors may also have a status code of 400.