# rosbag2_storage: Failed to open bag: unsupported compression format 'zstd' for storage plugin 'sqlite3'

- **ID:** `ros2/rosbag2-compression-format-mismatch`
- **Domain:** ros2
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The rosbag2 sqlite3 storage plugin does not support zstd compression; only lz4 is supported by default, and custom plugins for zstd are not installed.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| ros2-humble | active | — | — |
| ros2-iron | active | — | — |
| ros2-rolling | active | — | — |

## Workarounds

1. **Install the rosbag2_compression_zstd plugin: sudo apt install ros-humble-rosbag2-compression-zstd** (95% success)
   ```
   Install the rosbag2_compression_zstd plugin: sudo apt install ros-humble-rosbag2-compression-zstd
   ```
2. **Convert bag to lz4 compression: ros2 bag compress --input /path/to/bag --output /path/to/output --compression-queue-size 1 --compression-mode file --compression-format lz4** (90% success)
   ```
   Convert bag to lz4 compression: ros2 bag compress --input /path/to/bag --output /path/to/output --compression-queue-size 1 --compression-mode file --compression-format lz4
   ```

## Dead Ends

- **** — Default sqlite3 plugin code doesn't support zstd; requires a separate plugin package. (80% fail)
- **** — Environment variable alone doesn't install the required plugin; the plugin must be built and loaded. (90% fail)
