Self-hosted instance of n8n version 1.31.2. Just set up. Created 1 workflow with 1 webhook and one node. Saved. Tested. All works.
Problem:
Every time I restart the stack of n8n and PostgreSQL I see warnings in the docker compose logs.
Not sure what to make of this, saw multiple people posting about the same error without any fitting answer for me.
n8n-postgresql | 2024-03-08 18:48:16.785 CET [1] LOG: database system is ready to accept connections
n8n | User settings loaded from: /home/node/.n8n/config
n8n | Initializing n8n process
n8n | n8n ready on 0.0.0.0, port 5678
n8n | Version: 1.31.2
n8n | ================================
n8n | Start Active Workflows:
n8n | ================================
n8n | - "outline2apprise2ntfyk20" (ID: 1Hqj2qu4iPjSD0os)
n8n-postgresql | 2024-03-08 18:48:31.464 CET [37] ERROR: duplicate key value violates unique constraint "PK_b21ace2e13596ccd87dc9bf4ea6"
n8n-postgresql | 2024-03-08 18:48:31.464 CET [37] DETAIL: Key ("webhookPath", method)=(f47eb632-fd01-4a9f-9b71-661b364cb92b, POST) already exists.
n8n-postgresql | 2024-03-08 18:48:31.464 CET [37] STATEMENT: INSERT INTO "public"."webhook_entity"("workflowId", "webhookPath", "method", "node", "webhookId", "pathLength") VALUES ($1, $2, $3, $4, DEFAULT, DEFAULT)
n8n | => Started
n8n |
n8n | Editor is now accessible via:
n8n: 1.31.2
db: postgresql-14-alpine
n8n running via Docker
OS: Debian Bookworm
EXECUTIONS_PROCESS - no idea what that is, I searched and it seems to have been deprecated since [email protected] 2023-05-03
Basically: started a completely fresh instance, imported this one workflow, saved, restarted the docker compose stack and upon restart, I again see the error above.
Didnāt help. The error message now complains exactly the same as above except about a different webhook. I created a second workflow also containing a webhook and now I get error messages for both.
Open for ideas, happy to remove the DB and try again as these are my first two workflows. I can remove all content of n8n and PG and have a clean slate in2 minutes.
Maybe something is wrong with the n8n+postgres container. Iām personally not a big fan of using multiservice containers, as they break the docker principle (one service per container).
Try this setup. One instance for n8n and another one for postgres.
Iām not sure what you mean, I do have one docker-compose.yml file which creates two containers: one for n8n and one for PostgreSQL. There is no difference whether I use docker compose or docker run to create these two containers as they are still two separate containers.
Iām sure the issue is somewhere with n8n or me, definitely not with the compose file. The compose file simply starts these two containers with the parameters I give it and which I have taken from the n8n docs.
Especially since I have deleted all n8n and PostgreSQL data and started with fresh containers twice already.
I found several issues in this forum when searching for: ERROR: duplicate key value violates unique constraint webhook
but unfortunately none had an applicable solution for me.
Do you happen to also have a workflow with a webhook by any chance? Do you see any of these errors when restarting your PostgreSQL container?
Thanks for checking. I am all out of ideas. All I can try is post my docker-compsoe.yml here and hope somebody spots an error. This is running behind traefik as reverse proxy.
Hey guys, Iām running into this same problem, but Iām using n8n inside a Google Cloud Run service container talking to a completely external Postgres DB.
I think the issue happens whenever the n8n container ārestartsā, but Iām not 100% sure.
We have a dev ticket somewhere to fix this, from what I remember nothing is actually broken and it is to do with registering webhooks on startup to make sure they are unique.