Wp-db.php error at line 1172

From time to time, my site has presented these errors in the log:

Warning: mysqli_real_escape_string () expects parameter 2 to be a string, the array being given in / .. mypath … /wp-includes/wp-db.php on line 1172

Is there a way to know which module may be causing this error?