Skip to content

Unhandled exception in event consumer. Analytics events were not processed. #57

@kjwilcox

Description

@kjwilcox

When calling launchdarkly_client.toggle(), we often see an error log with the following traceback:

Traceback (most recent call last):
  File "/path/to/virtualenv/lib/python3.5/site-packages/ldclient/event_consumer.py", line 50, in do_send
    data=json.dumps(body))
  File "/usr/local/python/lib/python3.5/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/python/lib/python3.5/json/encoder.py", line 198, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/python/lib/python3.5/json/encoder.py", line 256, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/python/lib/python3.5/json/encoder.py", line 179, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <object object at 0x7f3b18c7c230> is not JSON serializable

The user object we are providing to .toggle() does not contain any non-json-serializable fields. Example: {'anonymous': True, 'key': 'SECRET', 'custom': {'client': 'sandbox', 'roles': (), 'superuser': False}}

We are currently using version 0.20.3, but this problem repros on 3.0.0. Running on Python 3.5.2 on Ubuntu 14.04.

Is there a way for us to opt-out of these failing analytics events? Or can the this client library be updated to fix this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions