Troubleshooting
Common issues and solutions when deploying and running PrepArr.
Quick Diagnostics
Section titled “Quick Diagnostics”Health Check Status
Section titled “Health Check Status”# Check sidecar healthcurl http://localhost:9001/health
# Check readinesscurl http://localhost:9001/ready
# Docker Composedocker compose logs sonarr-sidecar
# Kuberneteskubectl logs -n media-stack deployment/sonarr -c preparr-sidecarContainer Status
Section titled “Container Status”# Docker Compose - check init container completiondocker compose ps
# Kubernetes - check init container statuskubectl describe pod -n media-stack sonarr-xxxInit Container Failures
Section titled “Init Container Failures”PostgreSQL Connection Issues
Section titled “PostgreSQL Connection Issues”Symptoms:
ERROR: Failed to connect to PostgreSQLFATAL: database "servarr" does not existSolutions:
# Check PostgreSQL is running and accessibledocker compose logs postgres
# Verify environment variablesdocker compose config
# Test direct connectiondocker run --rm postgres:16-alpine psql -h postgres -U postgres -d servarr -c "SELECT 1;"Check Configuration:
- Ensure
POSTGRES_HOSTpoints to the correct service name - Verify
POSTGRES_PASSWORDmatches the PostgreSQL container - Confirm the PostgreSQL container is healthy before the init container runs
Servarr URL Unreachable
Section titled “Servarr URL Unreachable”Symptoms:
ERROR: Servarr application not accessible at http://sonarr:8989ERROR: Failed to verify Servarr connectivitySolutions:
# Check if Servarr container is runningdocker compose ps sonarr
# Test connectivity from init containerdocker compose exec sonarr-init curl -f http://sonarr:8989
# Verify DNS resolutiondocker compose exec sonarr-init nslookup sonarrConfiguration Fixes:
- Ensure
SERVARR_URLuses the correct service name and port - Verify the Servarr container starts before the init container
- Check Docker network connectivity
API Key Generation Failures
Section titled “API Key Generation Failures”Symptoms:
ERROR: No API key found in config.xml - init container may have failedERROR: Failed to extract or generate API keySolutions:
# Check config.xml was createddocker compose exec sonarr cat /config/config.xml
# Verify shared volume mountingdocker compose exec sonarr-init ls -la /config/
# Check init container logs for detailed errorsdocker compose logs sonarr-initCommon Causes:
- Shared volume not properly mounted
- Insufficient permissions on config directory
- Init container exited before completing setup
Sidecar Runtime Issues
Section titled “Sidecar Runtime Issues”Configuration Loading Failures
Section titled “Configuration Loading Failures”Symptoms:
ERROR: Configuration file not found: /config/sonarr-config.jsonERROR: Configuration validation failedSolutions:
# Verify config file exists and is readabledocker compose exec sonarr-sidecar cat /config/sonarr-config.json
# Check file permissionsdocker compose exec sonarr-sidecar ls -la /config/Configuration Fixes:
- Ensure the JSON file is valid (no trailing commas, proper quotes)
- Verify the file is mounted as read-only from the host
- Check volume mount paths match
CONFIG_PATH
Servarr API Connection Issues
Section titled “Servarr API Connection Issues”Symptoms:
ERROR: Failed to connect to Servarr APIERROR: API key authentication failedSolutions:
# Test API connectivitycurl -H "X-Api-Key: your-api-key" http://sonarr:8989/api/v3/system/status
# Check API key in config.xmldocker compose exec sonarr grep -o 'ApiKey>.*<' /config/config.xml
# Verify sidecar can reach Servarrdocker compose exec sonarr-sidecar curl -f http://sonarr:8989Common Fixes:
- Wait for Servarr to fully initialize after container start
- Verify API key matches between config.xml and JSON config
- Ensure Servarr container is accessible on the specified port
Reconciliation Loop Errors
Section titled “Reconciliation Loop Errors”Symptoms:
ERROR: Step failed: quality-profilesWARN: Configuration drift detectedERROR: Failed to apply configuration changesSolutions:
# Check specific step failuresdocker compose logs sonarr-sidecar | grep "Step failed"
# Increase log level for debugging# Set LOG_LEVEL=debug in environmentdocker compose up -d sonarr-sidecar
# Verify current vs desired statecurl -H "X-Api-Key: api-key" http://sonarr:8989/api/v3/qualityprofileIndexer Management Issues
Section titled “Indexer Management Issues”Prowlarr Sync Not Working
Section titled “Prowlarr Sync Not Working”Symptoms:
INFO: Prowlarr sync enabled, skipping indexer management# But no indexers appear in Sonarr/RadarrSolutions:
# Verify Prowlarr application configurationcurl -H "X-Api-Key: prowlarr-key" http://prowlarr:9696/api/v1/applications
# Check Prowlarr can reach target applicationscurl -H "X-Api-Key: prowlarr-key" http://prowlarr:9696/api/v1/applications/test
# Test indexer sync manuallycurl -X POST -H "X-Api-Key: prowlarr-key" http://prowlarr:9696/api/v1/applications/syncConfiguration Checks:
- Ensure
prowlarrSync: truein Sonarr/Radarr config - Verify Prowlarr application settings have correct API keys
- Check Prowlarr can reach Sonarr/Radarr URLs
- Confirm indexers are enabled and have proper app profiles
Indexers Being Removed
Section titled “Indexers Being Removed”Symptoms:
INFO: Indexer removed successfully: "The Pirate Bay (Prowlarr)"# Indexers disappear after sidecar reconciliationFix:
- Set
"prowlarrSync": truein the config for apps where Prowlarr manages indexers - Remove the
"indexers": []array from the configuration - Restart the sidecar container
Docker Compose Issues
Section titled “Docker Compose Issues”Service Dependencies Not Working
Section titled “Service Dependencies Not Working”Symptoms:
ERROR: Init container started before PostgreSQL readyERROR: Sidecar started before Servarr readySolution: Use depends_on with health check conditions:
sonarr-init: depends_on: postgres: condition: service_healthy
sonarr: depends_on: sonarr-init: condition: service_completed_successfully
sonarr-sidecar: depends_on: - sonarrVolume Mount Issues
Section titled “Volume Mount Issues”Symptoms:
ERROR: Permission denied: /config/sonarr-config.jsonERROR: No such file or directorySolutions:
# Check host file exists and permissionsls -la ./sonarr-config.json
# Fix permissionschmod 644 ./sonarr-config.json
# Verify mount syntaxdocker compose config | grep volumes -A 5Kubernetes Issues
Section titled “Kubernetes Issues”Init Container Stuck
Section titled “Init Container Stuck”Symptoms:
kubectl get pods# Shows Init:0/1 status indefinitelyDiagnosis:
# Check init container logskubectl logs pod-name -c preparr-init
# Check eventskubectl describe pod pod-name
# Verify configmap and secretskubectl get configmap sonarr-config -o yamlkubectl get secret postgres-secret -o yamlConfigMap Updates Not Applied
Section titled “ConfigMap Updates Not Applied”Configuration changes not reflected in running containers.
Solutions:
# Force pod restart after ConfigMap updatekubectl rollout restart deployment/sonarr
# Or delete pods to force recreationkubectl delete pod -l app=sonarr
# Verify ConfigMap was updatedkubectl get configmap sonarr-config -o yamlService Discovery Issues
Section titled “Service Discovery Issues”Symptoms:
ERROR: Failed to resolve service hostnameSolutions:
# Test DNS resolutionkubectl exec -it pod-name -- nslookup postgres-service
# Check service configurationkubectl get svckubectl describe svc postgres-service
# Verify network policies (if using)kubectl get networkpolicyPostgreSQL Issues
Section titled “PostgreSQL Issues”Database Connection Limits
Section titled “Database Connection Limits”Symptoms:
ERROR: remaining connection slots are reserved for non-replication superuser connectionsSolutions:
# Check current connectionsdocker compose exec postgres psql -U postgres -c "SELECT count(*) FROM pg_stat_activity;"
# Increase connection limit in postgres environment:# POSTGRES_CONFIG_max_connections: 200Database Permission Issues
Section titled “Database Permission Issues”Symptoms:
ERROR: permission denied for database servarrERROR: role "sonarr" does not existSolutions:
-- Connect to PostgreSQL and check users\du
-- Create missing userCREATE USER sonarr WITH PASSWORD 'password';
-- Grant permissionsGRANT ALL PRIVILEGES ON DATABASE servarr TO sonarr;Performance Issues
Section titled “Performance Issues”Slow Startup Times
Section titled “Slow Startup Times”Common Causes: Large configuration files, slow database connections, network latency between services.
Solutions:
# Reduce reconciliation frequencyCONFIG_RECONCILE_INTERVAL=300
# Optimize PostgreSQL configuration# shared_buffers=256MB# max_connections=100High Memory Usage
Section titled “High Memory Usage”# Docker statsdocker stats sonarr-sidecar
# Kuberneteskubectl top podsAdd resource limits:
resources: limits: memory: 256Mi cpu: 200m requests: memory: 128Mi cpu: 100mDebugging Tips
Section titled “Debugging Tips”Enable Debug Logging
Section titled “Enable Debug Logging”# Docker ComposeLOG_LEVEL=debug docker compose up -d sonarr-sidecar
# Kuberneteskubectl set env deployment/sonarr LOG_LEVEL=debug -c preparr-sidecarExport Configuration State
Section titled “Export Configuration State”# Dump current Servarr configurationcurl -H "X-Api-Key: api-key" http://sonarr:8989/api/v3/config > current-config.json
# Compare with desired statediff desired-config.json current-config.jsonManual Configuration Testing
Section titled “Manual Configuration Testing”# Test specific API endpointscurl -H "X-Api-Key: api-key" http://sonarr:8989/api/v3/qualityprofilecurl -H "X-Api-Key: api-key" http://sonarr:8989/api/v3/indexercurl -H "X-Api-Key: api-key" http://sonarr:8989/api/v3/downloadclient
# Test connectivity between servicesdocker compose exec sonarr-sidecar curl -f http://sonarr:8989/api/v3/system/statusGetting Help
Section titled “Getting Help”When reporting issues, include:
- Environment details - Docker Compose or Kubernetes, PrepArr version/image tag, host OS
- Configuration - Sanitized environment variables, JSON configuration (remove sensitive data), docker-compose.yml or K8s manifests
- Logs - Init container, sidecar container, Servarr application, and PostgreSQL logs
- Error details - Exact error messages, when the error occurs, steps to reproduce
Log Collection
Section titled “Log Collection”# Docker Compose - collect all logsdocker compose logs > preparr-logs.txt
# Kubernetes - collect pod logskubectl logs deployment/sonarr -c preparr-sidecar > sidecar-logs.txtkubectl logs deployment/sonarr -c preparr-init > init-logs.txtSupport Channels
Section titled “Support Channels”- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and community support