This exception is thrown by Database_Result, and it trying to find the caller means searching through the backtrace. You get all backtrace information in everything but the production environment, so these issues should have been found during development and testing? In production it would show the user an error screen, so I'm sure they can tell you what they did when it happened? Or are we talking about an API?
Assuming that you don't deliberately assign data to a database result object, the most obvious place for this to happen is when you pass a database result object to a view.
I know what is causing it. You're trying to assign or update a value which is the result of a DB call.
Something like this will trigger it:
$result = DB::select()->from('table')->execute(); foreach($result as &$row) { $row['id'] = intval($row['id']); // DB results are immutable! }
The only place the framework will attempt to do this for you, is when you pass a DB result to a View. Since by default the View will try to encode all data, it will update the values passed.
Addressing this is on my todo list, hopefully in time for 1.7.3.