Skip to content

Restore traceback on hard crashes#965

Merged
boegel merged 3 commits intoeasybuilders:developfrom
boegel:restore_traceback
Jul 4, 2014
Merged

Restore traceback on hard crashes#965
boegel merged 3 commits intoeasybuilders:developfrom
boegel:restore_traceback

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Jul 4, 2014

without this:

$ eb test/framework/easyconfigs/toy-0.0.eb --easyblock=EB_toy_buggy --sourcepath=$PWD/test/framework/sandbox/sources -f 
== temporary log file in case of crash /var/folders/8s/_frgh9sj6m744mxt5w5lyztr0000gn/T/easybuild-sIy444/easybuild-1s455C.log
== resolving dependencies ...
== processing EasyBuild easyconfig /Users/kehoste/work/easybuild-framework/test/framework/easyconfigs/toy-0.0.eb
== building and installing toy/0.0...
== fetching files...
== creating build dir, resetting environment...
== unpacking...
== patching...
== preparing...
== configuring...
== building...
ERROR: EasyBuild crashed with an error (at easybuild/main.py:107 in build_and_install_software): Build of /Users/kehoste/work/easybuild-framework/test/framework/easyconfigs/toy-0.0.eb failed (err: global name 'run_cmd' is not defined)

with this:

$ eb test/framework/easyconfigs/toy-0.0.eb --easyblock=EB_toy_buggy --sourcepath=$PWD/test/framework/sandbox/sources -f 
== temporary log file in case of crash /var/folders/8s/_frgh9sj6m744mxt5w5lyztr0000gn/T/easybuild-1mtWa2/easybuild-0B9Lkf.log
== resolving dependencies ...
== processing EasyBuild easyconfig /Users/kehoste/work/easybuild-framework/test/framework/easyconfigs/toy-0.0.eb
== building and installing toy/0.0...
== fetching files...
== creating build dir, resetting environment...
== unpacking...
== patching...
== preparing...
== configuring...
== building...
ERROR: EasyBuild crashed with an error (at easybuild/main.py:110 in build_and_install_software): Traceback (most recent call last):
  File "/Users/kehoste/work/easybuild-framework/easybuild/main.py", line 84, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, orig_environ)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 1953, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 1894, in run_all_steps
    self.run_step(stop_name, step_methods, skippable=skippable)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 1777, in run_step
    m(self)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 1830, in <lambda>
    build_step_spec = ('build', 'building', [lambda x: x.build_step()], True)
  File "/Users/kehoste/work/easybuild-framework/test/framework/sandbox/easybuild/easyblocks/toy_buggy.py", line 43, in build_step
    run_cmd('gcc toy.c -o toy')
NameError: global name 'run_cmd' is not defined

@gjbex: this fixes your request for more sensible error messages (at least partially)

@JensTimmerman, @wpoely86: please review?

Comment thread easybuild/main.py
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't traceback always present?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, only when a hard crash occured

If the build exited via a log.error, then no traceback will be available; a log.error spits out an EasyBuildError, which is nicely catched by build_and_install_one. When an unexpected error occurs however, an Exception other than EasyBuildError will be raised, only to be captured here, for which a traceback will be collected.

So, we'll see a traceback for hard crashes (unexpected errors, bugs in the EB framework or easyblock), and a 'clean' error messages for calls to log.error (since then the error message is supposed to be sufficient).

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jul 4, 2014

Thanks for reviewing @wpoely86, @JensTimmerman!

boegel added a commit that referenced this pull request Jul 4, 2014
Restore traceback on hard crashes
@boegel boegel merged commit 1517fe1 into easybuilders:develop Jul 4, 2014
@boegel boegel deleted the restore_traceback branch July 4, 2014 10:36
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.

3 participants