klaravel / db-logger

Laravel 5.3+ database queries logger
MIT License
13 stars 1 forks source link

Object of class Illuminate\Database\Events\QueryExecuted could not be converted to string #3

Open kabell opened 7 years ago

kabell commented 7 years ago

After 2 months of perfect working of this plugin I've found this error.


Object of class Illuminate\Database\Events\QueryExecuted could not be converted to string
--
in DbLogger.php (line 98)
at HandleExceptions->handleError(4096,  'Object of class Illuminate\\Database\\Events\\QueryExecuted could not  be converted to string',  '/data/api/vendor/klaravel/db-logger/src/DbLogger.php', 98, array('query' => object(QueryExecuted), 'bindings' => null, 'time' => null, 'queryNr' => 5, 'e' => object(ErrorException)))in DbLogger.php (line 98)

at DbLogger->log(object(QueryExecuted), null, null)in ServiceProvider.php (line 36)

at ServiceProvider->Klaravel\DbLogger\{closure}(object(QueryExecuted))in Dispatcher.php (line 348)

at Dispatcher->Illuminate\Events\{closure}('Illuminate\\Database\\Events\\QueryExecuted', array(object(QueryExecuted)))in Dispatcher.php (line 199)

at Dispatcher->dispatch('Illuminate\\Database\\Events\\QueryExecuted')in Connection.php (line 808)

at Connection->event(object(QueryExecuted))in Connection.php (line 665)

at Connection->logQuery('UPDATE  account SET  username=\'xxxx\',profile_picture=\'xxxxx_a.jpg\',full_name=\'XXX\',bio=\'📅🖍ที่เก็บความทรงจำ  ᖴᗷ:ᴺᴵᵀᴵᴷᴬᴿᴺ_ᴴᴬᴺᴾᴱᴱ✨1⃞9⃞9⃞6⃞™ ♦️TᕼᗩᑎK ᖴOᖇ ᖴOᒪᒪOᗯ  ᗰE♦️\',website=\'xxxxxx\',media=\'108\',follows=\'371\',followed_by=\'855\',last_update=\'2017-09-04  00:12:17\' WHERE instagram_id=\'XXXX\'', array(), 0.33000000000000002)

It seems there is a problem with the special characters, but many similar queries also with special characters run fine... so maybe these characters are extra special...

Please help. Thanks.

spinxdigital commented 7 years ago

@kabell

I will check this one soon and if possible then try to find some fix.

klaravel commented 7 years ago

Hi @kabell

Can you please attach data with text file? So I can insert and try again or if possible can you please export that table with few rows and that one so it will help me to troubleshot.

kabell commented 7 years ago

Ok, I found the problematic column, it's not the special characters I thought, but the fb url... why ?

error.txt

There is the simplest method how to reproduce it. I hope, it helps.

Thanks