Databases 7 min read

Understanding MySQL Error MY-013129 and How to Handle It

This article explains the MySQL MY-013129 error, its lack of a fixed message, the code paths that generate it in MySQL 8.0, why it is logged as an ERROR, and practical recommendations for filtering or handling the log entries.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
Understanding MySQL Error MY-013129 and How to Handle It

Author: Li Bin, member of the ActionTech DBA team, responsible for daily issue handling and platform troubleshooting.

What is the MY-013129 error?

The MY-013129 error is unique because it does not contain a fixed error message; instead, it appends a context‑specific message to the log.

Typical log examples:

2025-03-03T15:38:08.918103+08:00 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error‑log instead: MY-000001 - Can't create/write to file '/opt/mysql/data/3307/mysqld.pid' (OS errno 13 - Permission denied)
2024-11-28T14:51:09.590102Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error‑log instead: MY-004031 - The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.

Official definition

MySQL defines the error as:

Error number: MY-013129; Symbol: ER_SERVER_NO_SESSION_TO_SEND_TO; SQLSTATE: HY000
Message: A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error‑log instead: MY-%06d - %s

Code logic

The relevant source file is mysql-8.0.28\share\messages_to_error_log.txt , which contains the definition:

ER_SERVER_NO_SESSION_TO_SEND_TO eng "A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error‑log instead: MY-%06d - %s"

The handling code (simplified) is:

/*
Caller wishes to send to client, but none is attached, so we send
to error‑log instead.
*/
else if (!thd) {
    LogEvent()
        .type(LOG_TYPE_ERROR)
        .subsys(LOG_SUBSYSTEM_TAG)
        .prio(ERROR_LEVEL)
        .errcode((error < ER_SERVER_RANGE_START) ? ER_SERVER_NO_SESSION_TO_SEND_TO : error)
        .lookup(ER_SERVER_NO_SESSION_TO_SEND_TO, error, str);
}

From the code we can conclude that MY-013129 appears only in MySQL 8.0 and is triggered when the server tries to send a message to a client but no thd (session) is attached, causing the message to be logged at the ERROR level.

Why is it logged as ERROR?

Because the trailing part of the log can contain either a serious error (e.g., permission denied) or a warning (e.g., client timeout), MySQL chooses the higher severity ERROR to avoid mis‑classification.

Handling recommendations

Do not simply suppress this log; the important information is in the trailing message. Instead, consider one of the following approaches:

1. Keyword filtering

Adjust your log‑collection or monitoring rules to filter out the keyword MY-013129 , optionally adding further checks on the subsequent error code to apply different handling logic.

2. Use the log_filter_dragnet component (MySQL 8.0 feature)

Install and configure the component to drop these messages:

-- Install component
INSTALL COMPONENT 'file://component_log_filter_dragnet';
SET GLOBAL log_error_services = 'log_filter_dragnet; log_sink_internal';

-- Configure rule
SET GLOBAL dragnet.log_error_filter_rules =
'IF prio == ERROR and err_code == ER_SERVER_NO_SESSION_TO_SEND_TO THEN drop.';

-- Remove configuration
SET GLOBAL log_error_services = 'log_filter_internal; log_sink_internal';
UNINSTALL COMPONENT 'file://component_log_filter_dragnet';

References

MySQL official error reference: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

databaseMySQLerror handlingMySQL 8.0log filteringMY-013129
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.