jruizgit / rules

Durable Rules Engine
MIT License
1.15k stars 206 forks source link

UnicodeDecodeError issue #374

Open ruslanolkhovsky opened 3 years ago

ruslanolkhovsky commented 3 years ago

Hello,

we are using the durable rules in our project as a workflow engine, mostly as a flow ruleset. it works fine, but sometimes we get the following error:

Error dispatching ruleset
Traceback (most recent call last):
  File "/.../.local/lib/python3.8/site-packages/durable/engine.py", line 925, in dispatch_ruleset
    ruleset.dispatch()
  File "/.../.local/lib/python3.8/site-packages/durable/engine.py", line 509, in dispatch
    result = durable_rules_engine.start_action(self._handle)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 9: invalid start byte
...

Error dispatching ruleset
Traceback (most recent call last):
  File "/.../.local/lib/python3.8/site-packages/durable/engine.py", line 925, in dispatch_ruleset
    ruleset.dispatch()
  File "/.../.local/lib/python3.8/site-packages/durable/engine.py", line 509, in dispatch
    result = durable_rules_engine.start_action(self._handle)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 9: invalid start byte

We check and prepare the ruleset to be a valid json/string, which works just fine. But, apparently, sometimes it does not :) Also, we never experienced this error while running it on a mac host, it happens in a docker container with ubuntu.

Any advice is very welcome. Or maybe you could add an extra validation / fix in the engine.py (509) or in the pyStartAction (rules.c) to eliminate the problematic bytes? Please, help.

Thank you! Ruslan

ruslanolkhovsky commented 3 years ago

Interesting finding... Apparently, allocating more memory makes this issue disappear. Are there any minimal/recommended memory/cpu/other requirements for the library? I am considering an option of running it on Raspbery Pi and other low capacity platforms. Thank you.