willjschmitt / joulia-webserver

Webserver and logging for electric brewing controller connecting distributed users to the equipment.
http://joulia.io
0 stars 0 forks source link

Launch returning 500. #128

Closed willjschmitt closed 7 years ago

willjschmitt commented 7 years ago

Launch brewhouse API is setting the brewhouse to active, but it's failing when watchers are attempting to send data. The next time the long poll reconnects, the controller, picks it up, but this breaks front end response handling, since the API returns an error rather than success code.

TypeError at /brewery/api/brewhouse/launch/ 'NoneType' object is not iterable

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.5/site-packages/django/views/decorators/csrf.py" in wrapped_view

  1. return view_func(*args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/views/generic/base.py" in view

  1. return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/rest_framework/views.py" in dispatch

  1. response = self.handle_exception(exc)

File "/usr/local/lib/python3.5/site-packages/rest_framework/views.py" in handle_exception

  1. self.raise_uncaught_exception(exc)

File "/usr/local/lib/python3.5/site-packages/rest_framework/views.py" in dispatch

  1. response = handler(request, *args, **kwargs)

File "/code/brewery/views.py" in post

  1. brewhouse=brewhouse, recipe=recipe, active=True)

File "/usr/local/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method

  1. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/db/models/query.py" in create

  1. obj.save(force_insert=True, using=self.db)

File "/code/brewery/models.py" in save

  1. super(RecipeInstance, self).save(*args, **kwargs)

File "/usr/local/lib/python3.5/site-packages/django/db/models/base.py" in save

  1. force_update=force_update, update_fields=update_fields)

File "/usr/local/lib/python3.5/site-packages/django/db/models/base.py" in save_base

  1. update_fields=update_fields, raw=raw, using=using)

File "/usr/local/lib/python3.5/site-packages/django/dispatch/dispatcher.py" in send

  1. response = receiver(signal=self, sender=sender, **named)

File "/code/tornado_sockets/views/recipe_instance.py" in recipe_instance_watcher

  1. RecipeInstanceStartHandler.notify(instance.brewhouse, instance.pk)

File "/code/tornado_sockets/views/recipe_instance.py" in notify

  1. waiter.set_result(dict(recipe_instance=recipe_instance))

File "/usr/local/lib/python3.5/site-packages/tornado/concurrent.py" in set_result

  1. self._set_done()

File "/usr/local/lib/python3.5/site-packages/tornado/concurrent.py" in _set_done

  1. for cb in self._callbacks:

Exception Type: TypeError at /brewery/api/brewhouse/launch/ Exception Value: 'NoneType' object is not iterable

willjschmitt commented 7 years ago

Solved by #129