What does the TiDB log error "incorrect string value" mean?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB日志报错"incorrect string value"什么意思?

| username: jaybing926

[TiDB Usage Environment] Production Environment
[TiDB Version]
v5.4.3

[Encountered Issues]
The tidb_tikvclient_backoff_seconds_count alert shows a sudden peak, with the set alert threshold being 1000, but it reached over 5000.
Upon checking the TiDB logs, there are many ERROR logs with “incorrect string value”. What does this error mean? What impact does it have and how should it be handled?

[Attachments: Screenshots/Logs/Monitoring]
Prometheus metric:


Error log screenshot:

| username: 芮芮是产品 | Original post link

The error you encountered indicates that TiKV just went through an unavailable period and then recovered by itself.

| username: jaybing926 | Original post link

Oh no, I found that my TiDB logs have been reporting this kind of error continuously, which is unrelated to the monitoring anomaly mentioned above.

[ERROR] [column.go:321] [“incorrect string value”] [conn=11734073] [error=“[table:1366]Incorrect string value ‘\xF0\x9F\x87\xA8’ for column ‘signature’”]

| username: 大飞哥online | Original post link

When inserting a string value into the database, a character set mismatch or unsupported character issue occurred.

| username: xingzhenxiang | Original post link

It looks like this error is related to a character set issue.

| username: jaybing926 | Original post link

After checking the logs within the time range of the anomaly monitoring, I found a large number of lock conflict logs “prewrite encounters lock”. It seems this is the cause.

| username: 大飞哥online | Original post link

SHOW VARIABLES LIKE ‘character_set_database’;
Check the character set of your database.

| username: jaybing926 | Original post link

So, does that mean this is not a TiDB issue, but a problem with the business side writing data?

| username: 大飞哥online | Original post link

Correct, the character set of the written data is inconsistent with the database settings.

For example, if the application is set to GBK and the database is set to utf8mb4, an error will occur.

| username: 芮芮是产品 | Original post link

The tidb_tikvclient_backoff_seconds_count alert has a very high spike, with the set alert threshold being 1000, but it has reached 5000+. This alert indicates that TiKV is temporarily unavailable, and the issue needs to be investigated.

| username: jaybing926 | Original post link

Okay, thanks~

| username: jaybing926 | Original post link

In the error message, does table:1366 correspond to TIDB_TABLE_ID? I checked the TIDB_TABLE_ID field in the INFORMATION_SCHEMA.TABLES table and couldn’t find this ID. Did I check it incorrectly?

| username: jaybing926 | Original post link

I checked the logs, and it seems that there are a lot of write conflicts causing this. The logs contain a large number of “prewrite encounters lock”.

Since we are consuming data from Kafka, the data will definitely not be lost, it will just retry.
I will check why there are so many write conflicts.

| username: dba-kit | Original post link

Is there a partitioned table?

| username: jaybing926 | Original post link

I just checked, and it seems that none of the tables have been partitioned.

| username: dba远航 | Original post link

Caused by inserting inappropriate values.

| username: andone | Original post link

Check the monitoring to see if there are any anomalies.

| username: jaybing926 | Original post link

Which table is reporting this error and how can I check it?
I can’t find this ID: table:1366.

| username: 普罗米修斯 | Original post link

Check the TiDB logs or search for errors in the dashboard.

| username: jaybing926 | Original post link

The log I posted above is a complete TiDB log.
How do I search in the dashboard? I didn’t find anything useful.