Issue:
A scripting processor returns an exception:
Error :SCRIPTING_04 - Script sent record to error: Expecting object: line 321 column 1 (char 23205)
Solution:
"Expecting object" points to the data which is loaded in the scripting processor. In this case, the JSON format is not valid and therefore the processor sends the records to the error record handling.
The exception points to the line 921, however, it does not necessarily mean that the problem is on this line. You could use some JSON parser to verify where the problem is.
For further troubleshooting, it may help to add some additional logging to the script. For example, you could modify your script by adding log.debug part before attempting to parse it:log.debug(bodyRequest.content).
This log would be logged only if there are parsing problems and the log level is set to DEBUG. The log level can be changed while pipelines are running so when you see an issue, you can easily change the level from the INFO level.
