fluent / fluent-logger-python

A structured logger for Fluentd (Python)
http://fluentd.org/
Other
444 stars 138 forks source link

ValueError: Recursion limit exceeded, in msgpack #191

Closed j-adamczyk closed 2 years ago

j-adamczyk commented 2 years ago

I tried using fluent-logger-python to get my AWS Lambda outputs to Fluentd, and got error:

  File "/var/task/fluent/sender.py", line 88, in emit_with_time
    bytes_ = self._make_packet(label, timestamp, data)
  File "/var/task/fluent/sender.py", line 131, in _make_packet
    return msgpack.packb(packet, **self.msgpack_kwargs)
  File "/var/task/msgpack/__init__.py", line 38, in packb
    return Packer(**kwargs).pack(o)
  File "msgpack/_packer.pyx", line 294, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 300, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 297, in msgpack._cmsgpack.Packer.pack
  File "msgpack/_packer.pyx", line 264, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
  [Previous line repeated 507 more times]
  File "msgpack/_packer.pyx", line 229, in msgpack._cmsgpack.Packer._pack
  File "msgpack/_packer.pyx", line 163, in msgpack._cmsgpack.Packer._pack
ValueError: recursion limit exceeded.

Process finished with exit code 0

On one hand, this kinda worked, since I got this in Kibana, so Fluentd captured this and sent through AWS networking and into my Elasticsearch. However, there is obviously a bug here, either in this library or in msgpack. For reference, it can be found here.

What can I do about this? Or is this strictly msgpack error and I should create an issue there?

j-adamczyk commented 2 years ago

This was a circular reference in JSON that was being logged, so error on my side.