Webhook does not work

Hello!

I am relativly new to n8n and I am currently familiarizing myself with it.
My n8n server is an Ubuntu Server 24.04 instance (with NodeJS and NginX) on a Proxmox system. I used npm to install and update n8n.

Information on your n8n setup

  • n8n version: 1.82.3
  • Database (default: SQLite): PostgreSQL (seperate instance)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu Server 24.04 LTS

This private instance was published with a DynDNS provider with its own external DNS in a Fritzbox.

n8n runs as a service on the Ubuntu server. Here is die service description ():


[Unit]
Description=n8n - Workflow Automation
After=network.target

[Service]
Type=simple
User=root
Environment=“DB_TYPE=postgresdb”
Environment=“DB_POSTGRESDB_DATABASE=n8n”
Environment=“DB_POSTGRESDB_HOST=postgresql17”
Environment=“DB_POSTGRESDB_PORT=5432”
Environment=“DB_POSTGRESDB_USER=n8n”
Environment=“DB_POSTGRESDB_PASSWORD=password”
Environment=“DB_POSTGRESDB_POOL_SIZE=2”
Environment=“DB_POSTGRESDB_CONNECTION_TIMEOUT=2000”
Environment=“DB_POSTGRESDB_SCHEMA=public”
Environment=“DB_POSTGRESDB_SSL_ENABLED=false”
Environment=“N8N_SECURE_COOKIE=false”
Environment=“N8N_PROTOCOL=http”
Environment=“N8N_PORT=5678”
Environment=“N8N_HOST=name.ddnss.de
Environment=“N8N_WEBHOOK_URL=http://name.ddnss.de:5678/webhook/
Environment=“N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false”
Environment=“GENERIC_TIMEZONE=Europe/Berlin”
Environment=“N8N_PUBLIC_API_ENABLED=true”
ExecStart=/usr/local/bin/n8n start
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target


local_url=http://127.0.0.1:5678

**What has already been done?

  1. n8n update to version 1.82.3
  • Node.js has also been updated to version 20.19.0.
  • npm update -g n8n has been executed.
    2 Configuration of N8N_WEBHOOK_URL
  • N8N_WEBHOOK_URL was set.
  • Nevertheless, the urlBaseWebhook initially remained unchanged.
    3 Check the REST API & webhooks
  • curl -X GET “local_url/rest/settings” still shows the old urlBaseWebhook.
  • curl -X PATCH command to activate/deactivate the workflow fails with "Unauthorized ”.
    Public API is enabled (“enabled”: true).
  • API calls with X-N8N-API-KEY lead to “unauthorized” or “PATCH method not allowed”.
    4 Tests with the database
  • SELECT * FROM public.workflow_entity; shows the WebhookMeta workflow as active.
  • Webhook URLs are not registered (404 Not Found).
  • curl -X GET “local_url/rest/webhooks” returns Cannot GET /rest/webhooks.
    5 Restarts & updates.
  • Several restarts of n8n and nginx.
  • sudo systemctl daemon-reload && sudo systemctl restart n8n after each change.
  • nginx is configured correctly as a proxy, but 502 Bad Gateway or 504 Gateway Timeout errors occur.

***# Open problems

  1. webhook URLs do not update correctly
    Although N8N_WEBHOOK_URL has been set, the webhook node in the UI still shows the old URL (name.ddnss.de).

  2. webhooks are not registered (404 Not Found)
    curl -X GET “local_url/webhook/meta-webhook?hub.challenge=123456” still returns 404 Not Found.
    curl -X POST “local_url/rest/webhooks/refresh” returns “Cannot POST /rest/webhooks/refresh”.
    Webhooks do not appear to be registered correctly despite an active workflow.

  3. n8n REST-API denies API access with “Unauthorized”
    Despite activated Public API (“enabled”: true), a PATCH or GET call of the workflows with Unauthorized fails.
    API tokens (X-N8N-API-KEY) are not accepted.
    PATCH method not allowed could indicate an incorrect API version or endpoint problems.

Do you have nay idea to solve ther probme(s)?

I think the environment variable is just WEBHOOK_URL and does not include a path.

Environment=“WEBHOOK_URL=http://name.ddnss.de:5678”

I have added the env var “WEBHOOK_URL=http://name.ddnss.de:5678/” to /etc/environment and ‘Environment=“WEBHOOK_URL=http://name.ddnss.de:5678/”’. After a reboot, ‘env | grep -i webhook’ showed me the correct settings. In spite of that, there were no changes to the probem described.

The command “curl -X GET https://name.ddnss.de/webhook/meta-webhook” shows the following message: {“code”:404,“message”:“The requested webhook "GET meta-webhook" is not registered.”,“hint”:“The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren’t shown on the canvas (only in the executions list)”,“stacktrace”:“ResponseError: The requested webhook "GET meta-webhook" is not registered.\n at LiveWebhooks.findWebhook (/usr/local/lib/node_modules/n8n/src/webhooks/live-webhooks.ts:163:10)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at LiveWebhooks.executeWebhook (/usr/local/lib/node_modules/n8n/src/webhooks/live-webhooks.ts:81:19)\n at WebhookRequestHandler.handleRequest (/usr/local/lib/node_modules/n8n/src/webhooks/webhook-request-handler.ts:45:21)\n at /usr/local/lib/node_modules/n8n/src/webhooks/webhook-request-handler.ts:126:3”}

The Browser with that URL shows: “Cannot GET /webhook/webhook-meta”.

The webhhook node in the webhook workflow has the following parameters:
Test URL: http://name.ddnss.de:5678/webhook-test/webhook-meta
Production URL: http://name.ddnss.de:5678/webhook/webhook-meta
HTTP Method: GET
Path: webhook-meta
Authentication: None
Respond: Immediately
Options:

  • Response Data: { hub.challenge": {{$json[“query”][“hub.challenge”]}}}

The workflow is set to “active”