Launch error "Error: getaddrinfo EAI_AGAIN postgres"

Hi everyone. I use n8n-starter-kit on virtual machine. Yesterday I updated n8n to latest version.

Describe the problem/error/question:

Today, I encountered an issue in the AI agent workflow related to a “Window Buffer Memory” error, which affected all workflows utilizing the Window Buffer Memory node. The 4GB memory on my virtual machine (VM) was fully consumed, leading me to reboot the VM. However, after the reboot, the n8n container failed to start.

I tried to export workflows because I made significant changes in the last 2 days and did not create backups. But exporting credentials and/or workflows fails:

What is the error message (if any)?

Docker n8n contanier log:

User settings loaded from: /home/node/.n8n/config
Last session crashed
Initializing n8n process
There was an error initializing DB
Error: There was an error initializing DB
    at Start.exitWithCrash (/usr/local/lib/node_modules/n8n/dist/commands/base-command.js:115:49)
    at /usr/local/lib/node_modules/n8n/dist/commands/base-command.js:71:59
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Start.init (/usr/local/lib/node_modules/n8n/dist/commands/base-command.js:71:9)
    at Start.init (/usr/local/lib/node_modules/n8n/dist/commands/start.js:151:9)
    at Start._run (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/command.js:301:13)
    at Config.runCommand (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/config/config.js:424:25)
    at run (/usr/local/lib/node_modules/n8n/node_modules/@oclif/core/lib/main.js:94:16)
    at /usr/local/lib/node_modules/n8n/bin/n8n:72:2
getaddrinfo EAI_AGAIN postgres
Error: getaddrinfo EAI_AGAIN postgres
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
User settings loaded from: /home/node/.n8n/config

Information on your n8n setup

  • n8n version: latest
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • **Operating system:**Operating System: Ubuntu 22.04.5 LTS
    Kernel: Linux 5.15.0-124-generic
    Architecture: x86-64
    Hardware Vendor: QEMU
    Hardware Model: Standard PC i440FX + PIIX, 1996

I kindly ask for the community’s help. Everywhere I managed to find similar information, the n8n instance starts up successfully, unlike mine. Thanks!

Did you try to log into Postgres directly through pgadmin or something similar? Maybe you find the problem there. And you could try to export your db in case you have to reset your stack. Looking into the postgres logs might give you additional information. It should give you info about the authorisation attempt.
Good Luck

If only I could understand something about databases… :smiling_face_with_tear:

I was able to export my database using a command # docker exec -t self-hosted-ai-starter-kit-postgres-1 pg_dump -U user database_name > /home/user/postgres_n8n.sql

I can see all my projects in it that don’t have a backup :sweat_smile:

However, I have no idea how to import it into a new instance. Or how to extract only the workflows I need from this database.

UPD.
I temporarily solved the issue by restoring a backup with the hosting provider. By a stroke of luck, it turned out that my server is automatically backed up once a week, and the latest backup was from the day before.

After the rollback, I encountered the problem again with the Window Buffer Memory nodes in two working processes with the AI agent. And the machine memory is free now.
I made some changes: replaced the Session ID Key from the client’s ID number to a general “chat_history”.

This isn’t exactly what I need, as I believe the Session ID Key should be unique for each user.

I am continuing my attempts to deploy the database export on a backup machine and experimenting with the Memory AI agent to make it unique for each user.

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