If you are self-hosting n8n automation and the NocoDB database on the same VPS server, you have likely run into confusing, intermittent connection errors. One of the most frustrating is the red error message getaddrinfo EAI_AGAIN occur in tasks that process customer or order information. This article will guide you through how to connect n8n with NocoDB directly through the internal Docker network, helping the system increase processing speed by 3 times and completely resolve this network error issue.
What Is the EAI_AGAIN Error in n8n and What Causes It?
Error EAI_AGAIN is actually a temporary response error from the DNS resolver server (DNS lookup timeout). When you configure n8n to connect to NocoDB through a public domain name, for example https://nocodb.localbrand.vn/, where Node.js running inside the n8n container must constantly send requests out to the internet to look up the IP address of this domain name.
Even a brief network congestion from the carrier lasting a few milliseconds, or a slow response from a DNS server (such as Cloudflare or Google), causes API calls to fail immediately. As a result, synchronized data workflows run unreliably, working intermittently and causing considerable frustration.

Connecting n8n with NocoDB via Docker Internal Network
Instead of taking a detour from the VPS out to the Internet and back into the VPS through an external secure HTTPS port, why don't we connect these two applications directly through Docker's virtual internal network? In this way, n8n can call the NocoDB container directly over standard HTTP while still ensuring maximum security, because the data flow never leaves the VPS.
This approach requires you to thoroughly understand how to organize the virtual networks of containers. You can refer to more detailed information at Docker Network documentation official documentation to better understand this local routing mechanism.
Real-World Case Study: Speed-Up Experience from a Fashion Local Brand
Take a look at a real-life story from a fashion brand in Vietnam. They use n8n to pull orders from KiotViet into an internal NocoDB database hosted on a dedicated VPS.
The system runs quite smoothly, but every 3-4 days a few orders get stuck due to an error EAI_AGAIN of the NocoDB Node. The technical team decided to reconfigure n8n to connect directly to the NocoDB container through the default Bridge network of Nginx Proxy Manager on the VPS.
Surprising results: not only did it end the stuck orders caused by DNS errors, but the execution time of database query tasks also dropped sharply, and response speed was 3 times faster than the previous approach of calling through a public domain name. Completely eliminating the SSL handshake also significantly freed up CPU performance for the server.
Steps to Configure Direct Connection Between n8n and NocoDB
To carry out this configuration, you need to access the command-line interface (Terminal) of your VPS and follow the detailed steps below:
Step 1: Find the Network Name and Container Name of NocoDB
First, run the command docker ps to identify the exact container name of NocoDB. Then, run the following command to find its Docker network name:
docker inspect -f '{{json .NetworkSettings.Networks}}' [ten_container_nocodb]
The results will display the networks that NocoDB is participating in, for example nginx-proxy-manager_default.
Step 2: Connect n8n and the Worker containers to the same network
Since major n8n versions typically run queue mode with separate Worker containers to process tasks, you need to run the network connection command for both the main container and the Worker containers:
docker network connect nginx-proxy-manager_default [ten_container_n8n_main]
docker network connect nginx-proxy-manager_default [ten_container_n8n_worker_1]
docker network connect nginx-proxy-manager_default [ten_container_n8n_worker_2]
Step 3: Change the Host address in the n8n login credentials
Now, you just need to open the NocoDB credentials configuration panel (Credentials) in the n8n web interface and change the address in the Host field from the external domain name to the internal URL:
http://[ten_container_nocodb]:8080/
Usage Notes http:// instead of https:// because direct internal Docker connections do not need to go through SSL encryption and should not, in order to maximize speed.

Conclusion
With just a few basic network configuration steps in Docker, you have made your automation system more resilient to network incidents and dramatically improved processing performance. If your business needs to build sales automation systems, large-scale data management, and VPS performance optimization, please refer to the solutions and Digital Marketing services comprehensive support from DPS.MEDIA to receive the most professional assistance
Ý kiến bạn đọc (9)
Đăng nhập để bình luận
Đăng nhập nhanh 1-chạm bằng Google để chia sẻ ý kiến của bạn về bài viết.
Bằng cách đăng nhập, bạn đồng ý với điều khoản và chính sách cộng đồng.
We run n8n alongside NocoDB on a shared VPS. Until now, n8n has called them through their external address, so the order-sync workflow occasionally fails. Does switching to an internal Docker Network completely eliminate EAI_AGAIN, or does it only reduce how often the error occurs?
Yes, this approach correctly addresses the root cause if the problem lies in DNS lookup. When two containers communicate directly over a Docker network, they no longer depend on external DNS, so the system is much more stable.
It's also worth checking the container network configuration and service names. If NocoDB or the worker sits on a different network, changing the host alone is not enough; the containers must be placed on the same virtual network.
I'm using n8n with multiple workers to process customer data. I'm not sure whether placing all the workers in the same Docker network as NocoDB would affect security or slow down the system.
In practice, internal workflows are often safer because the data doesn't have to travel out over the internet. What matters is limiting access rights between containers and not opening unnecessary ports.
We've already applied this to our sales system, and response speed has improved noticeably. The part that needs the most attention is updating the host in n8n credentials, which many people often edit by mistake.
Agreed, internal Docker networking is the right direction when self-hosting. Reducing one external dependency makes operations much less of a headache.
I used to think EAI_AGAIN was an n8n error, but it turns out most of the time it's the DNS resolution step. This article explains that real-world scenario quite accurately.
May I ask whether this approach suits a small VPS, or is it only for systems with a lot of data? I'm running a few simple workflows.
Chưa có bình luận nào. Hãy là người đầu tiên chia sẻ cảm nghĩ!
Đăng nhập / Tạo tài khoản
Đăng nhập với Google để gửi bình luận và tương tác cùng cộng đồng.
Tiếp tục là đồng ý với điều khoản sử dụng và chính sách bảo mật của DPS Media.