How to fix ERROR 1155: Got error from fcntl() in MySQL

MySQLINTERMEDIATEHIGHUpdated Dec 23, 2025ยท 183 views

Error 1155 is a network communication issue that occurs when MySQL cannot complete file descriptor operations on the client-server connection. This typically indicates system resource limits have been reached or network connectivity problems are preventing proper connection handling.

Quick fix

Fixes ERROR 1155: Got error from fcntl()

ulimit -n
  1. Check the current open file descriptor limit
  2. Increase the open file descriptor limit
  3. Check MySQL error log for additional context
  4. Verify MySQL server socket configuration
mysql โ€” error
ulimit -n
ERROR 1155: Got error from fcntl()

What this error means

ERROR 1155 (ER_NET_FCNTL_ERROR, SQLSTATE 08S01) is a low-level network error that occurs when the MySQL server or client encounters a failure in the fcntl() system call. The fcntl() function is used in Unix/Linux to perform file control operations on file descriptors, including socket configuration and locking operations that are essential for network communication. This error typically means the connection between client and server cannot be properly established or maintained because the operating system is unable to configure the socket file descriptor. It is a critical network-layer error that prevents normal database communication from occurring.

Typical symptoms

  • Client connections to MySQL server fail intermittently
  • Database queries timeout or hang unexpectedly
  • Connection errors appear in MySQL error log
  • Application receives "Lost connection to MySQL server" messages
  • Multiple failed login attempts in error log with fcntl errors
  • Server appears to be running but clients cannot connect reliably

Common causes

  1. System open file descriptor limit (ulimit) has been reached
  2. Too many concurrent MySQL connections exhausting system resources
  3. Network interface or socket configuration issues
  4. Corrupted or misaligned network packets during connection handshake
  5. MySQL process does not have sufficient permissions to configure sockets
  6. Kernel-level networking issues or network driver problems
  7. Client connection closed abruptly without proper mysql_close() call

How to fix "ERROR 1155: Got error from fcntl()"

1Check the current open file descriptor limit

First, determine what the system's open file descriptor limit is set to. Run this command on the MySQL server:

bash
ulimit -n

This shows the current limit. The default is often 1024, which may be too low for production MySQL servers handling many connections.

2Increase the open file descriptor limit

If the limit is too low, increase it to accommodate more connections. You can temporarily increase it for the current session:

bash
ulimit -n 65536

To make this permanent, edit /etc/security/limits.conf and add:

bash
mysql soft nofile 65536
mysql hard nofile 65536
mysql soft nproc 65536
mysql hard nproc 65536

Then restart the MySQL server for the changes to take effect.

bash
sudo systemctl restart mysql
3Check MySQL error log for additional context

Review the MySQL error log for more details about when and why the fcntl error occurs. The log location depends on your MySQL configuration, typically at:

bash
/var/log/mysql/error.log

Or check using MySQL:

sql
SHOW VARIABLES LIKE 'log_error';

Look for patterns in the errors to identify if they coincide with high connection counts or specific times.

4Verify MySQL server socket configuration

Ensure the MySQL server socket is properly configured and accessible. Check your MySQL configuration file (/etc/mysql/my.cnf or /etc/my.cnf):

ini
[mysqld]
socket=/var/run/mysqld/mysqld.sock

Verify the socket file exists and has proper permissions:

bash
ls -la /var/run/mysqld/mysqld.sock

The mysql user should own the socket with read/write permissions.

5Check for network connectivity issues

If connections are failing from remote hosts, verify network connectivity:

bash
# Test basic connectivity
ping mysql_server_ip

# Test port accessibility
nc -zv mysql_server_ip 3306

# Or use telnet
telnet mysql_server_ip 3306

If remote connections fail, check MySQL is listening on the correct interface:

sql
SHOW VARIABLES LIKE 'bind_address';

If bound to localhost only, change it to accept remote connections (if appropriate).

6Monitor and reduce concurrent connections

Check the current number of connections and the max limit:

sql
SHOW STATUS LIKE 'Threads_connected';
SHOW VARIABLES LIKE 'max_connections';

If connections are consistently near the max, increase the limit:

sql
SET GLOBAL max_connections = 1000;

Make it permanent by adding to your MySQL configuration file:

ini
[mysqld]
max_connections=1000

Also review application connection pooling to ensure connections are being reused and not exhausted.

7Restart the MySQL service

After making configuration changes, restart the MySQL service:

bash
# On Linux with systemd
sudo systemctl restart mysql

# Or
sudo service mysql restart

# On macOS
mysql.server restart

Monitor the error log after restart to confirm fcntl errors are resolved.

Advanced notes

Error 1155 is classified as a network communication error (SQLSTATE 08S01) and is distinct from InnoDB file locking errors. If you have external_locking enabled in your MySQL configuration, this can also cause file descriptor issues. On modern MySQL installations, external_locking is disabled by default and should remain disabled unless you have specific multi-instance requirements.

For containerized MySQL deployments (Docker, Kubernetes), pay special attention to resource limits and the /proc/sys/fs/file-max kernel parameter, as containers may have stricter resource constraints than the host system. The error may also indicate that the MySQL socket file is being created on a filesystem (often tmpfs in containers) that has size limits.

In clustered or replication scenarios, ensure all nodes have adequate file descriptor limits configured consistently.

Frequently asked questions

What does "ERROR 1155: Got error from fcntl()" mean?
ERROR 1155 (ER_NET_FCNTL_ERROR, SQLSTATE 08S01) is a low-level network error that occurs when the MySQL server or client encounters a failure in the fcntl() system call. The fcntl() function is used in Unix/Linux to perform file control operations on file descriptors, including socket configuration and locking operations that are essential for network communication. This error typically means the connection between client and server cannot be properly established or maintained because the operating system is unable to configure the socket file descriptor.
How do I fix "ERROR 1155: Got error from fcntl()"?
Error 1155 is a network communication issue that occurs when MySQL cannot complete file descriptor operations on the client-server connection. This typically indicates system resource limits have been reached or network connectivity problems are preventing proper connection handling.
What causes "ERROR 1155: Got error from fcntl()"?
System open file descriptor limit (ulimit) has been reached Too many concurrent MySQL connections exhausting system resources Network interface or socket configuration issues
Is the "ERROR 1155: Got error from fcntl()" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading