Commit aa44e31
Fix MultiQC task to handle crashes from empty/invalid FastQC zip files
## Problem
PR #606 attempted to fix MultiQC task failures when processing empty FastQC
zip files, but the fix was incomplete. MultiQC crashes with exit code 1
when it encounters empty zip files, causing the WDL task to fail before
reaching the error handling code.
### Root Cause
MultiQC (both v1.8 and v1.32) crashes when processing empty zip archives:
```
IndexError: list index out of range
at: d_name = fqc_zip.namelist()[0]
```
The previous fix added cleanup code but didn't handle the crash itself:
1. Command block starts with `set -e` (exit on any error)
2. MultiQC crashes with exit code 1
3. Script terminates immediately, never reaching cleanup code
## Solution
Modified the MultiQC task command block to gracefully handle crashes:
1. **Wrap MultiQC call**: Use `set +e` before calling MultiQC to prevent
immediate script termination on error
2. **Capture exit code**: Store MultiQC's exit code in `MULTIQC_EXIT_CODE`
3. **Re-enable error checking**: Use `set -e` after MultiQC completes
4. **Update Docker image**: Upgrade from v1.8 to v1.32 (latest stable)
5. **Improve error suppression**: Add `2>/dev/null || true` to mv command
The existing safety nets (creating placeholder HTML and empty data directory)
now execute successfully regardless of MultiQC's exit status.
## Testing
Tested with empty FastQC zip file that previously caused task failure:
- ✅ Task completes successfully (exit code 0)
- ✅ Creates placeholder HTML: "No analysis results found in input files"
- ✅ Creates empty data tarball
- ✅ WDL syntax validates with miniwdl
This fix ensures workflows don't fail when upstream tasks produce empty or
corrupted FastQC outputs, which can occur with low-quality or no-read samples.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent ee094f0 commit aa44e31
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
| 664 | + | |
663 | 665 | | |
664 | 666 | | |
665 | 667 | | |
| |||
687 | 689 | | |
688 | 690 | | |
689 | 691 | | |
| 692 | + | |
| 693 | + | |
690 | 694 | | |
691 | | - | |
| 695 | + | |
692 | 696 | | |
693 | 697 | | |
694 | 698 | | |
695 | | - | |
| 699 | + | |
696 | 700 | | |
697 | 701 | | |
698 | | - | |
| 702 | + | |
699 | 703 | | |
700 | 704 | | |
701 | 705 | | |
| |||
0 commit comments