python3 msgpack.unpackb exceeds max_str_len

result = on_message_callback(self, method, properties, msgpack.unpackb(body, raw=False))
  File "msgpack/_unpacker.pyx", line 187, in msgpack._cmsgpack.unpackb
ValueError: 1596336 exceeds max_str_len(1048576)
ERROR   :NodeManager:
    exception: 1596336 exceeds max_str_len(1048576)
    message: Exception in callback BaseConnection._handle_events()()
    handle:
 

1、检查msgpack版本

发现安装的是msgpack==0.6.0

2、卸载msgpack,重新安装0.6.1

pip3 uninstall msgpack
pip3 install msgpack==0.6.1
 

或 

1、修改配置参数 max_str_len,以下代码限制长度为50M

msgpack.unpackb(body, max_str_len=1024*1024*50)

 

你可能感兴趣的:(install,?)