Skip to content

FIX: Provide more runtime information when node execution fails #3505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 14, 2022

Conversation

mgxd
Copy link
Member

@mgxd mgxd commented Sep 14, 2022

Partially addresses #3492

This adds runtime information to the error message when node execution fails.

1.8.x series:

220914-11:28:50,439 nipype.workflow WARNING:
	 [Node] Error on "test-fail" (/private/tmp/nipype/test-fail)
Traceback (most recent call last):
  File "/private/tmp/nipype/test-fail.py", line 21, in <module>
    eg = x.run()
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 524, in run
    result = self._run_interface(execute=True)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 642, in _run_interface
    return self._run_command(execute)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 750, in _run_command
    raise NodeExecutionError(
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node test-fail.

1.5.x series:

220914-11:27:16,631 nipype.workflow WARNING:
	 [Node] Error on "test-fail" (/private/tmp/nipype/test-fail)
Traceback (most recent call last):
  File "/private/tmp/nipype/test-fail.py", line 21, in <module>
    eg = x.run()
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
    result = self._run_interface(execute=True)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
    return self._run_command(execute)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 419, in run
    runtime = self._run_interface(runtime)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 814, in _run_interface
    self.raise_exception(runtime)
  File "/Users/mathiasg/.pyenv/versions/nipreps/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 741, in raise_exception
    raise RuntimeError(
RuntimeError: Command:
failing-bin 123
Standard output:
Starting the binary
Using input 123...
Standard error:
Failing!
Return code: 1

With this PR:

220914-11:45:14,669 nipype.workflow WARNING:
	 [Node] Error on "test-fail" (/private/tmp/nipype/test-fail)
Traceback (most recent call last):
  File "/private/tmp/nipype/test-fail.py", line 21, in <module>
    eg = x.run()
  File "/Users/mathiasg/code/nipype/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/Users/mathiasg/code/nipype/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/Users/mathiasg/code/nipype/nipype/pipeline/engine/nodes.py", line 758, in _run_command
    raise NodeExecutionError(
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node test-fail.

Cmdline:
	failing-bin 123
Stdout:
	Starting the binary
	Using input 123...
Stderr:
	Failing!
Traceback:
	RuntimeError: subprocess exited with code 1.

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Base: 65.25% // Head: 63.64% // Decreases project coverage by -1.61% ⚠️

Coverage data is based on head (f4a7792) compared to base (af3f8df).
Patch coverage: 81.81% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3505      +/-   ##
==========================================
- Coverage   65.25%   63.64%   -1.62%     
==========================================
  Files         309      309              
  Lines       40860    40870      +10     
  Branches     5378     5380       +2     
==========================================
- Hits        26664    26010     -654     
- Misses      13123    13836     +713     
+ Partials     1073     1024      -49     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nipype/pipeline/engine/nodes.py 79.05% <81.81%> (+0.01%) ⬆️
nipype/workflows/__init__.py 47.05% <0.00%> (-52.95%) ⬇️
nipype/utils/spm_docs.py 20.00% <0.00%> (-48.00%) ⬇️
nipype/testing/fixtures.py 57.14% <0.00%> (-41.56%) ⬇️
nipype/interfaces/freesurfer/base.py 48.38% <0.00%> (-28.23%) ⬇️
nipype/utils/logger.py 56.92% <0.00%> (-27.70%) ⬇️
nipype/interfaces/fsl/maths.py 79.06% <0.00%> (-19.19%) ⬇️
nipype/interfaces/dcm2nii.py 50.00% <0.00%> (-15.28%) ⬇️
nipype/interfaces/fsl/base.py 67.02% <0.00%> (-13.83%) ⬇️
nipype/interfaces/fsl/preprocess.py 61.04% <0.00%> (-10.50%) ⬇️
... and 20 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mgxd mgxd requested a review from effigies September 14, 2022 18:12
@mgxd mgxd marked this pull request as ready for review September 14, 2022 18:12
@mgxd mgxd merged commit fd39c1f into nipy:master Sep 14, 2022
@mgxd mgxd deleted the fix/node-execution-info branch September 14, 2022 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants