Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
1.2k views
in Plugins by
edited by

Before asking a question, I searched for related questions. A similar problem was posted before, but it has not been resolved. (Another related question)

I tried to solve it by myself, but the problem was still not solved.I describe this question and my findings, hoping to get a reply from the community.

1.  The picture intuitively reflects part of the proble. Comments are already posted and also generate the warning that your submission appears to be a duplicate.

2. Considering that it is possible that the plugin affects the normal work of the website. I deleted all the plugins, the warning disappeared, and the website returned to normal work.

3. I tried to run the plugin one by one, and finally found that the plugin of q2apro-on-site-notifications-master caused the failure. Since this plugin is very important for my website, I tested it in more depth.

4. This plugin only generates warnings for Chinese answers and comments. English answers and descriptions are normal. It may be related to multibyte encoding of chinese characters.

5. This is my error log:

 [error] 21206#0: *47740 FastCGI sent in stderr: "PHP message: PHP Question2Answer MySQL query error 1366: Incorrect string value: '\xEF...\x09f...' for column 'params' at row 1 - Query: INSERT INTO qa_eventlog (datetime, ipaddress, userid, handle, cookieid, event, params) VALUES (NOW(), '175.191.48.223', '2', '娑夎胺鍥?, NULL, 'in_c_answer', 'postid=248 parentid=243 parenttype=A parent=array(46) questionid=242 question=array(46) thread=array(0) content=娓╁皵锛?骞村亣鏄緸鑱岀殑瀵肩伀绱... format= text=娓╁皵锛?骞村亣鏄緸鑱岀殑瀵肩伀绱... categoryid= name= notify=1 email=')" while reading response header from upstream, client: 175.***.**.***, server: heidongwang.top, request: "POST / HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-cgi-73.sock:", host: "www.****.top", referrer: "https://www.****.top/242?state=comment-243&show=243"

I am not very good at English, there may be some grammatical errors. If you can’t understand it, tell me, I ’m happy to explain it.

Q2A version: Q2A 1.8.4
by
+1
I suggest you to convert the qa_eventlog table to utf8mb4 encoding which will remove the query error. You can see if the duplicate error still persists after that.
by
edited by
arjunsuresh,Thanks for your reply!

I convert the qa_eventlog table to utf8mb4 encoding and restart the database.Since I do n’t know if the operation is correct, I paste the printed information

CREATE TABLE `qa_eventlog` (
 `datetime` datetime NOT NULL,
 `ipaddress` varchar(45) CHARACTER SET ascii DEFAULT NULL,
 `userid` int(10) unsigned DEFAULT NULL,
 `handle` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
 `cookieid` bigint(20) unsigned DEFAULT NULL,
 `event` varchar(20) CHARACTER SET ascii NOT NULL,
 `params` varchar(800) CHARACTER SET utf8 NOT NULL,
 KEY `datetime` (`datetime`),
 KEY `ipaddress` (`ipaddress`),
 KEY `userid` (`userid`),
 KEY `event` (`event`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

The warning will still appear wrong. The problem does not seem to be resolved


error log:

2020/05/11 22:24:11 [error] 21206#0: *48404 FastCGI sent in stderr: "PHP message: PHP Question2Answer MySQL query error 1366: Incorrect string value: '\xE7\xA4...\x09...' for column 'params' at row 1 - Query: INSERT INTO qa_eventlog (datetime, ipaddress, userid, handle, cookieid, event, params) VALUES (NOW(), '175.191.48.223', '2', '娑夎胺鍥?, NULL, 'in_c_answer', 'postid=256    parentid=243    parenttype=A    parent=array(46)    questionid=242    question=array(46)    thread=array(0)    content=浠锋牸鍦?-3鍗冨厓鏈€濂界殑娓告垙鏄剧?..    format=    text=浠锋牸鍦?-3鍗冨厓鏈€濂界殑娓告垙鏄剧?..    categoryid=    name=    notify=1    email=')" while reading response header from upstream, client: 175.191.48.223, server: ****.top, request: "POST / HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-cgi-73.sock:", host: "www.****.top", referrer: "https://www.****.top/242/"
by
+1
No, still the column params is utf8 and not utf8mb4. You need to change it for that column in particular.
by
I have changed and it has printed the following information. Is the change correct now?
the warning still exists.

CREATE TABLE `qa_eventlog` (
 `datetime` datetime NOT NULL,
 `ipaddress` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `userid` int(10) unsigned DEFAULT NULL,
 `handle` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `cookieid` bigint(20) unsigned DEFAULT NULL,
 `event` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
 `params` varchar(800) COLLATE utf8mb4_unicode_ci NOT NULL,
 KEY `datetime` (`datetime`),
 KEY `ipaddress` (`ipaddress`),
 KEY `userid` (`userid`),
 KEY `event` (`event`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
by
+1
Yes. Now the MySQL error should be gone. Do you still see duplicate submission?
by
Sorry, no timely reply. It was late night in my country.

The following is the latest printed information:

CREATE TABLE `qa_eventlog` (
 `datetime` datetime NOT NULL,
 `ipaddress` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `userid` int(10) unsigned DEFAULT NULL,
 `handle` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 `cookieid` bigint(20) unsigned DEFAULT NULL,
 `event` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
 `params` varchar(800) COLLATE utf8mb4_unicode_ci NOT NULL,
 KEY `datetime` (`datetime`),
 KEY `ipaddress` (`ipaddress`),
 KEY `userid` (`userid`),
 KEY `event` (`event`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci


error log:

2020/05/12 08:07:19 [error] 25673#0: *49168 FastCGI sent in stderr: "PHP message: PHP Question2Answer MySQL query error 1366: Incorrect string value: '\xE4...\x09f...' for column 'params' at row 1 - Query: INSERT INTO qa_eventlog (datetime, ipaddress, userid, handle, cookieid, event, params) VALUES (NOW(), '101.233.206.216', '2', '娑夎胺鍥?, NULL, 'in_c_answer', 'postid=269    parentid=243    parenttype=A    parent=array(46)    questionid=242    question=array(46)    thread=arr46ay(0)    content=澶х櫧锛?鈥滀笘鐣屼笂缇庡ソ鐨勪笢瑗夸...    format=    text=澶х櫧锛?鈥滀笘鐣屼笂缇庡ソ鐨勪笢瑗夸...    categoryid=    name=    notify=1    email=')" while reading response header from upstream, client: 101.233.206.216, server: *****.top, request: "POST / HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-cgi-73.sock:", host: "www.****.top", referrer: "https://www.****.top/242/"

 I still see duplicate submission.  That's a really strange behavior.
by
This is very strange. I found that when the number of characters in Chinese is less than 13, there is no warning. When the number of characters in Chinese is greater than 13, the warning appears.
by
Is it the wrong direction? When deleting the on-site-notifications plugin, the website is normal and there is no error warning. the error warning only appears when the plugin is installed.
by
I'm not sure that create table was success? Since the table is already present are you deleting and then adding again? What's the output of
Show CREATE TABLE `qa_eventlog` ?

The reason why that plugin causes failure is it turns on event log. It is actually the eventlogger which is causing the failure. But wherever the duplicate message is coming from -- it is a bug. It should have instead reported server error. Are you using any plugin to avoid duplicate submissions?
by
I have made great efforts and tried many ways, but it has not been resolved. I gave up.Thank you for your patient reply, thank you

Please log in or register to answer this question.

...