Clearer error when a job hits a full disk (ENOSPC) (#1899) - #2293
Conversation
|
@arimu1 thanks for using cwltool and contributing your fixes. Let's get the existing PRs resolved before opening more. Perhaps you can fix the codecov upload issue. Maybe the version needa bumping? If that doesn't work, I would accept a temporary disabling of CodeCov, but then reviews will take longer as I will have to personally check the code coverage locally. |
7061abf to
3f94afe
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2293 +/- ##
==========================================
- Coverage 85.21% 85.19% -0.02%
==========================================
Files 46 46
Lines 8621 8624 +3
Branches 2020 2021 +1
==========================================
+ Hits 7346 7347 +1
- Misses 808 811 +3
+ Partials 467 466 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3f94afe to
da8981d
Compare
323ea61 to
ae8b76a
Compare
4e8de92 to
a1a2f52
Compare
|
The three failing checks look unrelated to this change:
Could a maintainer re-run the failed jobs when convenient? Happy to rebase if that's easier. Thanks! |
|
@arimu1 Please enable "Allow edits from maintainers." for your PRs, thank you! https://docs.github.com/en/pull-requests/how-tos/work-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork |
…anguage#1899) When the temporary or output directory fills up mid-job, the OSError (errno 28, ENOSPC) fell through to the generic 'Exception while running job' handler and dumped a traceback, giving the user no idea the real problem was a full disk. Add a dedicated ENOSPC branch that logs an actionable message naming the tmpdir/outdir and pointing at --tmpdir-prefix / --outdir. Also switch the existing errno == 2 check to the named errno.ENOENT for clarity. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Head branch was pushed to by a user without write access
fe79da3 to
4fa981f
Compare
Problem
Fixes #1899.
When the user's temporary drive (or output directory) fills up while a job is running, the underlying
OSErrorcarrieserrno 28(ENOSPC, "No space left on device"). InJobBase._executethis fell through to the catch-all branch:…which dumps a stack trace and gives the user no hint that the actual problem is a full disk (the symptom reported on the CWL forum thread linked from the issue: a tool silently produces empty outputs).
Fix
Add a dedicated
ENOSPCbranch to the existingOSErrorhandler incwltool/job.py, right next to theENOENT("command not found") case that's already special-cased there. It logs a concise, actionable message instead of a traceback:The full traceback is still available with
--debug(the branch passesexc_info=runtimeContext.debug, matching the sibling cases). I also changed the existing magic-numbere.errno == 2to the namederrno.ENOSPC's counterparterrno.ENOENTfor readability, now thaterrnois imported.Tests
tests/test_examples.py::test_disk_full_error_messageinjects anOSError(errno.ENOSPC, …)at the job's output-handling stage (monkeypatchingcwltool.job.bytes2str_in_dicts) during a normalechorun, and asserts:--tmpdir-prefixguidance,Traceback (most recent call last)is printed,permanentFail).I verified this test fails against the unpatched code (it hits the old generic-exception/traceback path), proving it guards the behavior.
black,flake8, andisortare clean on the changed files.This addresses the "provide a better error message" ask in #1899. Actually probing free space ahead of time is a larger, platform-specific change and isn't attempted here.
This change was produced with the assistance of Claude Code (model: Claude Opus). The diff, root-cause analysis, and test were reviewed by a human before submission.