Pours seen but not recorded

running set up with 2 flow sensor -> arduino -> tablet -> server on VM.
Tablet sees controller and can register with server.
Flow sensors are detected and pour seen by tablet (pour start is detected, picture taken, flow counted etc). When pour is done however it is never recorded on the server (not on the tablet’s main screen).
The log on the server shows the failure below.
I saw other posts suggesting to resintall and reconfigure (with and without images) which I did 4 times to no avail.
Any insight on what the issue could be would be greatly appreciated!



POST /api/v1/taps/kegboard.flow0
April 5, 2016, 6:33 a.m. (pykeg.web.api.util) TypeError: __init__() got an unexpected keyword argument 'socket_connect_timeout'
Traceback (most recent call last):
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/pykeg/web/api/views.py", line 537, in tap_detail
    return _tap_detail_post(request, tap)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/pykeg/web/api/views.py", line 60, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/pykeg/web/api/views.py", line 669, in _tap_detail_post
    photo=request.FILES.get('photo', None))
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/django/db/transaction.py", line 394, in inner
    return func(*args, **kwargs)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/pykeg/backend/backends.py", line 229, in record_drink
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/pykeg/backend/backends.py", line 631, in build_stats
    tasks.build_stats.delay(drink_id=drink_id, rebuild_following=False)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/celery/app/task.py", line 453, in delay
    return self.apply_async(args, kwargs)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/celery/app/task.py", line 555, in apply_async
    **dict(self._get_exec_options(), **options)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/celery/app/base.py", line 353, in send_task
    reply_to=reply_to or self.oid, **options
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/celery/app/amqp.py", line 305, in publish_task
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/messaging.py", line 172, in publish
    routing_key, mandatory, immediate, exchange, declare)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/connection.py", line 436, in _ensured
    return fun(*args, **kwargs)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/messaging.py", line 177, in _publish
    channel = self.channel
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/messaging.py", line 194, in _get_channel
    channel = self._channel = channel()
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/utils/__init__.py", line 425, in __call__
    value = self.__value__ = self.__contract__()
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/messaging.py", line 209, in <lambda>
    channel = ChannelPromise(lambda: connection.default_channel)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/connection.py", line 757, in default_channel
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/connection.py", line 742, in connection
    self._connection = self._establish_connection()
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/connection.py", line 697, in _establish_connection
    conn = self.transport.establish_connection()
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/transport/virtual/__init__.py", line 809, in establish_connection
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/transport/virtual/__init__.py", line 791, in create_channel
    channel = self.Channel(connection)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/transport/redis.py", line 464, in __init__
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/utils/__init__.py", line 325, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/transport/redis.py", line 908, in client
    return self._create_client(async=True)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/transport/redis.py", line 861, in _create_client
    return self.AsyncClient(connection_pool=self.async_pool)
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/kombu/transport/redis.py", line 882, in __init__
    self.connection = self.connection_pool.get_connection('_')
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/redis/connection.py", line 455, in get_connection
    connection = self.make_connection()
  File "/home/kegbot/kegbot-server.venv/local/lib/python2.7/site-packages/redis/connection.py", line 464, in make_connection
    return self.connection_class(**self.connection_kwargs)
TypeError: __init__() got an unexpected keyword argument 'socket_connect_timeout'


Hi there.
quick update on this issue.
The issue seems to be related to celery not running correctly.

if I skip the stats building (i.e commenting out in /pykeg/backend/backends.py line 229: self.build_stats) the drink is recorded in the database.

I have tried to reinstall celery but the issue remains when I enable stats.
I have seen that others have had similar issue with celery not working but there was no update on those threads.
Any help would be greatly appreciated.


Hi there. I’m not sure this will help you, but it helped me with my run_workers problem where I was getting the ‘socket_connect_timeout’ error. It actually turned out to be a pretty easy solution (after a lot of troubleshooting):

  • activate your server virtualenv
  • pip install -U celery
  • pip install -U redis

The step for celery may not be necessary, but this is the order in which I performed the activities so I included it.

Good luck and let us know how it goes!

Hi kirk. thanks for your suggestion. I gave it a try and followed the steps you list below. However after restarting the server and starting apout, the “socket connect_timeout” error is still there and the pour doesn’t get recorded.
For now I am managing to survive with manually commenting out the
self.build_stats" line in backends.py, and periodically (separately) running “kegbot run_stats” to update the stats.

Hey everyone, I think I have a solution. For me at least, the problem was that the init method of connection in redis is getting passed arguments that it’s not expecting. What I did is just added whatever it was complaining about on the dashboard (one was “socket_connect_timeout” and the other was “socket_keepalive_options”) to the init arguments of connection.py with default values of None. Maybe this can work for you.