Validation
PrepArr validates all configuration using Zod schemas. Validation runs at startup and whenever the config file changes.
Common Validation Errors
Section titled “Common Validation Errors”Invalid API Key
Section titled “Invalid API Key”API key must be exactly 32 characters and hexadecimalAPI keys must be 32-character hexadecimal strings. Use --generate-api-key to create one:
docker run --rm ghcr.io/robbeverhelst/preparr:latest bun run dist/index.js --generate-api-keyMissing Required Fields
Section titled “Missing Required Fields”Configuration missing required field: rootFolders.0.pathCheck that all required fields are present in your configuration file.
Invalid URL Format
Section titled “Invalid URL Format”SERVARR_URL must be a valid URL (e.g., http://sonarr:8989)URLs must include the protocol (http:// or https://).
Type Mismatches
Section titled “Type Mismatches”Expected number, received string at qualityProfiles.0.cutoffEnsure numeric fields contain numbers, not quoted strings.
Testing Configuration
Section titled “Testing Configuration”Use the validation endpoint to test your configuration before deploying:
curl -X POST http://preparr-sidecar:9001/validate \ -H "Content-Type: application/json" \ -d @sonarr-config.jsonValid response:
{ "valid": true, "message": "Configuration is valid"}Invalid response:
{ "valid": false, "errors": [ { "path": ["qualityProfiles", 0, "cutoff"], "message": "Expected number, received string" } ]}Validating JSON Syntax
Section titled “Validating JSON Syntax”Before checking schema validation, make sure your JSON is syntactically valid:
# Check JSON syntaxpython3 -m json.tool sonarr-config.json > /dev/null
# Or with jqjq . sonarr-config.json > /dev/nullCommon JSON syntax issues:
- Trailing commas after the last item in arrays or objects
- Single quotes instead of double quotes
- Unquoted keys
- Comments (JSON does not support comments)