MySQL Error - (SSH) Channel open failure: Too many open files

Describe the problem/error/question

After a period of time, the MySQL node will return the error in the title. Same issue from this post:

What is the error message (if any)?

(SSH) Channel open failure: Too many open files

Resolution

Restarting n8n fixes the issue, but it inevitably comes back

Attempted Solution

I’ve tried increase the no file limits in /etc/security/limits.conf to the following:

  • soft nofile 4096
  • hard nofile 4096

I’ve also verified pam_limits is set correctly.

I then restarted it, but it still seems to be getting set to 1024

However, when I check ulimit -Sn it returns 1024. ulimit -Hn returns 4096

Bandaid Solution

I’ve been using the error trigger with the Execute Command node to restart n8n if it gets that error. Any long term solutions to this would be appreciated

Information on your n8n setup

  • n8n version: 1.75.2
  • Database (default: SQLite): postgresdb
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu 22

you must do this steps on your ubuntu server:
first check current setting :

ulimit -n

edit /etc/sysctl.conf and add this line:

fs.file-max = 65535

afther tha run this command to load this seeting

sudo sysctl -p

edit /etc/security/limits.conf and add:

root soft     nproc          65535    
root hard     nproc          65535   
root soft     nofile         65535   
root hard     nofile         65535

edit /etc/pam.d/common-session and add:

session required pam_limits.so

log out and login again and check new limits with this command:

ulimit -n

Restart n8n

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.