Error in Piwik (tracker): Error query: SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xD0_\xD0\xB2\xD1\x82…’ for column ‘name’ at row 1 In query: INSERT INTO piwik_log_action (name, hash, type, url_prefix) VALUES (?,CRC32(?),?,?)
This error occurs frequently in php-error file my disk space decrease frequently more than 2gb. Any solution to stop this error
Hi @tehseen
Which version of Mysql do you use? could you create an issue at: Issues · piwik/piwik · GitHub and post there the HTTP request found in your access log containing piwik.php?... and the request we can use to reproduce this error? thanks,
I have upgraded piwik 3.0.2 and php 7.0.16 x64 nts, but still same type of error is coming in php error file.
Now this error occurs
[12-Apr-2017 04:42:45 UTC] Error in Piwik (tracker): Error query: SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xD0_\xD0\xBB\xD0\xB5…’ for column ‘name’ at row 1 In query: INSERT INTO piwik_log_action (name, hash, type, url_prefix) VALUES (?,CRC32(?),?,?) Parameters: array ( 0 => ‘Счетчики Ð_лектроÑ_нергии/?cid=91701’, 1 => ‘Счетчики Ð_лектроÑ_нергии/?cid=91701’, 2 => 1, 3 => 0, )
I’m running Piwik 3.2.0 on Windows 2008 R2 (IIS 7.5) using Log Analytics.
I have a user who is saving filenames with special character quotes in the name “ and ” the kind you get if you enter a quote in Word. It also applies to single quotes and apostrophes. Someone browses to the file. The filename gets entered into the log file. Import_logs.py runs, and the import gets a fatal error when trying to process this line. I removed these entries from the log file I was testing and it then ran successfully.
I’m still searching for a solution, but came across some suggestions on other PHP (non-Piwik) related sites to adjust the character encoding, possibly using the iconv command. If I find a working solution, I will share. And if not, I hope this can at least help someone else find one.
Edit:
I’m not sure if this is the best solution as I not very familiar with the Piwik source code, but import_log.py finished without an error when I did this. I’ll need to review the data closer to make sure this actually worked as intended.
In core/Tracker/Model.php, in function insertNewAction(), before the $db->query() line, insert the following (Leaving out the @ will give a warning message.):
$name = @iconv(‘UTF-8’, ‘ASCII//TRANSLIT’, $name);
converts the $name to basic ASCII, which is limited to something like 128 characters. mb_convert_encoding will remove all characters not in the UTF-8 range.
This issue is caused by four bit Unicode characters that don’t fit in the UTF-8 column.
It appears to be caused by malicious or spam requests to your site.