Troubleshooting Guide - Sentinel-2 Water Quality Processing
Common Errors and Solutions
1. “Workflow completed with errors!”
This generic error message means something went wrong during processing. Here’s how to diagnose:
Step 1: Check the Log Files
# Look at the newest log file in 06_logs/
dir 06_logs\ /o-d
# Open the most recent log file to see detailed error messages
Step 2: Run System Validation
python validate_system.py
2. Python Import Errors
Error: ModuleNotFoundError: No module named 'yaml' (or other packages)
Solution:
# Install missing packages
pip install -r requirements.txt
# Or install specific packages
pip install pyyaml pandas geopandas xarray matplotlib cartopy cmocean
3. SNAP GPT Not Found
Error: 'gpt' is not recognized as an internal or external command
Solution:
Install SNAP from: https://step.esa.int/main/download/snap-download/
Add SNAP to your PATH environment variable:
Windows: Add
C:\Program Files\snap\binto PATHOr restart command prompt after SNAP installation
4. Authentication Errors
Error: Failed to get authentication token or 401 Unauthorized
Solution:
Update your Copernicus credentials in
02_config/parameters.yaml:download: copernicus_user: "your_actual_email@example.com" copernicus_password: "your_actual_password"
Verify credentials at: https://identity.dataspace.copernicus.eu/
5. Network/Download Errors
Error: Connection timeout or No data found
Solution:
Check internet connection
Verify date range - ensure data exists for your dates
Check cloud cover threshold (may be too restrictive)
Try smaller date ranges
6. Processing Errors
Error: GPT processing failed or Java heap space
Solution:
Increase Java heap size for SNAP:
# Edit SNAP configuration # Windows: C:\Program Files\snap\bin\gpt.vmoptions # Add or modify: -Xmx8G (for 8GB RAM)
Ensure sufficient disk space (>10GB free)
7. File Permission Errors
Error: Permission denied or Access denied
Solution:
Run as Administrator
Check file permissions in processing directories
Ensure antivirus is not blocking file operations
8. Configuration Errors
Error: Configuration file not found or KeyError
Solution:
Ensure
02_config/parameters.yamlexistsCheck YAML syntax (indentation matters)
Verify all required fields are present
9. Memory Errors
Error: Out of memory or Memory allocation error
Solution:
Close other applications
Increase virtual memory/swap space
Process smaller areas or fewer dates at once
Increase Java heap size for SNAP
10. Path Errors
Error: File not found or Path does not exist
Solution:
Use forward slashes or double backslashes in paths
Ensure all directories exist
Check for special characters in paths
Diagnostic Commands
Check System Status
# Run complete validation
python validate_system.py
# Check specific components
python 01_scripts/utils.py --action validate --path .
# View processing statistics
python 01_scripts/utils.py --action stats --path .
Check Individual Components
# Test Python packages
python -c "import yaml, pandas, xarray, matplotlib; print('Packages OK')"
# Test SNAP GPT
gpt --help
# Test configuration
python -c "import yaml; yaml.safe_load(open('02_config/parameters.yaml'))"
Recovery Procedures
Clean and Restart
# Clean processed data
python 01_scripts/utils.py --action clean --path .
# Restart processing
python run_workflow.py --action process --clean
Step-by-Step Processing
# Run individual steps to isolate issues
python run_workflow.py --action download
python run_workflow.py --action process
python run_workflow.py --action plot
Getting Help
Check Log Files: Always check the newest log file in
06_logs/Run Validation: Use
python validate_system.pyCheck Documentation: Review
07_documentation/WORKFLOW_DOCUMENTATION.mdSystem Information: Include OS, Python version, and error messages when seeking help
Performance Tips
Optimize Java Heap: Set
-Xmx8Gor higher for SNAPUse SSD Storage: Process on SSD for faster I/O
Sufficient RAM: 16GB+ recommended for large areas
Network Stability: Stable internet for downloads
Close Applications: Free up system resources
Error Code Reference
Exit Code 0: Success
Exit Code 1: General error
Exit Code 2: Invalid arguments
Exit Code 3: File not found
Exit Code 4: Permission denied
Exit Code 5: Network error
Remember: Most errors are related to missing dependencies, incorrect configuration, or insufficient resources. The system validation script will help identify most issues quickly.