BotBotMe / botbot-web

Web interface for BotBot.me
https://lincolnloop.com/blog/saying-goodbye-botbotme/
Other
152 stars 32 forks source link

logs with unicode fail to go through realtime #140

Closed ipmb closed 9 years ago

ipmb commented 9 years ago
ERROR Plugin failed [logit]
Traceback (most recent call last):
  File "/srv/botbot/src/botbot/botbot/apps/plugins/utils.py", line 40, in wrap
    return method(*args, **kwargs)
  File "/srv/botbot/src/botbot/botbot/apps/plugins/core/logger.py", line 25, in logit
    raw=line._raw)
  File "/srv/botbot/local/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/srv/botbot/local/lib/python2.7/site-packages/django/db/models/query.py", line 372, in create
    obj.save(force_insert=True, using=self.db)
  File "/srv/botbot/src/botbot/botbot/apps/logs/models.py", line 111, in save
    self.notify()
  File "/srv/botbot/src/botbot/botbot/apps/logs/models.py", line 83, in notify
    channel=self.channel_id)
  File "/srv/botbot/src/botbot/botbot/apps/logs/utils.py", line 36, in _send_event_with_id
    data=data)
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/api.py", line 88, in post
    return request('post', url, data=data, **kwargs)
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/sessions.py", line 383, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/sessions.py", line 486, in send
    r = adapter.send(request, **kwargs)
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/adapters.py", line 330, in send
    timeout=timeout
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 480, in urlopen
    body=body, headers=headers)
  File "/srv/botbot/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 285, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 833, in _send_output
    self.send(message_body)
  File "/usr/lib/python2.7/httplib.py", line 805, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 280-283: ordinal not in range(128)