An exception occurred while transforming 'malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190

Hello,

I’m running OH 3.2 andit has been chugging along happily for a few months without any intervention. Today I wanted to make a small change to a light item and I noticed that I was getting warning errors in the log:

2022-07-20 15:19:23.613 [WARN ] [ng.exec.internal.handler.ExecHandler] - An exception occurred while transforming 'malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190.

malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190.' with 'JSONPATH($.result)' : 'Invalid path '$.result' in 'malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190.

malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/perl5/JSON.pm line 190.''

This is the only info I am getting in the log and I can’t seem to figure out the cause. Anyone here have any idea how to troubleshoot further?

The error is coming from the ExecHandler which points to the Exec binding or executeCommandLine.

The error says it occurred while transforming so it’s almost certainly coming from the Exec binding.

The error is complaining that the string it was handed to transform is not valid JSON.

So find an Exec Thing you’ve created that includes a JSONPATH transformation and you should find the trouble. Run that script/command from the terminal (as the openhab user) and you should see the same thing that OH is seeing and you can probably fix it from there.

1 Like

Found it - Thanks Rich!