open-research / sumatra

http://neuralensemble.org/sumatra/
BSD 2-Clause "Simplified" License
127 stars 48 forks source link

smtweb throws exception when viewing record with DistributedLaunchMode. #321

Open cc-a opened 8 years ago

cc-a commented 8 years ago

Please see the below traceback generated by smtweb. Viewing the same record with smt list --long does not cause any problems. I have encountered the same issue using a variety of different executables on both Arch Linux and Red Hat.

Environment:

Request Method: GET Request URL: http://127.0.0.1:8001/test/20160113-181836/

Django Version: 1.8.8 Python Version: 2.7.5 Installed Applications: [u'sumatra.recordstore.django_store', u'django.contrib.contenttypes', u'tagging', 'sumatra.web'] Installed Middleware: ()

Traceback:
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  164.                 response = response.render()
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/response.py" in render
  158.             self.content = self.rendered_content
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  135.         content = template.render(context, self._request)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/backends/django.py" in render
  74.         return self.template.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render
  210.                     return self._render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in _render
  202.         return self.nodelist.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render_node
  919.         return node.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  135.         return compiled_parent._render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in _render
  202.         return self.nodelist.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render_node
  919.         return node.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render
  905.                 bit = self.render_node(node, context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render_node
  919.         return node.render(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in render
  959.             output = self.filter_expression.resolve(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in resolve
  648.                 obj = self.var.resolve(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in resolve
  789.             value = self._resolve_lookup(context)
File "/home/cica1d14/.local/lib/python2.7/site-packages/django/template/base.py" in _resolve_lookup
  849.                             current = current()
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/recordstore/django_store/models.py" in command_line
  305.         return self.to_sumatra().command_line
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/recordstore/django_store/models.py" in to_sumatra
  277.             self.launch_mode.to_sumatra(),
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/recordstore/django_store/models.py" in to_sumatra
  166.             lm = getattr(launch, self.type)(**parameters)
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/launch.py" in __init__
  225.             mpi_cmd = MPI(path=mpirun)
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/programs.py" in __init__
  69.         self.version = version or self._get_version()
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/programs.py" in _get_version
  97.                                       shell=True, timeout=5)
File "/home/cica1d14/.local/lib/python2.7/site-packages/sumatra/core.py" in run
  69.         signal.signal(signal.SIGALRM, alarm_handler)

Exception Type: ValueError at /test/20160113-181836/
Exception Value: signal only works in main thread
apdavison commented 8 years ago

The problem seems to be in that reconstructing the LaunchMode object from the database, Sumatra retrieves an invalid value for the version (None, ought to be 'unknown'), which then causes it to attempt to launch mpirun to get the version.

We need to figure out how the value of None is getting stored in the database.