I am not able to make test webhook works

Hello,

I’m sorry to bother you as this seems to be a recurring topic but I haven’t managed to get to the bottom of it myself.

After migrating to a new server, my prod webhooks are working but not the test ones.

Do you have any idea what I’m doing wrong?

Thank you for your understanding.

Details

  1. Webhook returns
{ "message": "Workflow was started" }
  1. UI keeps waiting for trigger event

  2. I can’t stop it (even though the DELETE request returns with a 200)

  3. Logs show

n8n-n8n-1       | The session "9hwjcz2h96d" is not registered.

setup

  • upgrade from 0.107 to 1.27.3
  • postgres
  • run via Docker on Ubuntu 20.04
  • behind nginx

env vars

DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgres
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=xxxx
DB_POSTGRESDB_USER=xxxx
DB_POSTGRESDB_PASSWORD=xxxx
N8N_ENCRYPTION_KEY=xxxx
WEBHOOK_URL=https://n8n.mydomain.com/
N8N_EDITOR_BASE_URL=https://n8n.mydomain.com/
NODE_FUNCTION_ALLOW_EXTERNAL=uuid,date-fns,js-base64
GENERIC_TIMEZONE=UTC
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168

nginx cong

server {
    server_name n8n.mydomain.com;

    listen 443 ssl; # managed by Certbot
    listen [::]:443 ssl;
    ssl_certificate /etc/letsencrypt/live/n8n.mydomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/n8n.mydomain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    client_max_body_size 0;

    location / {
        proxy_pass http://0.0.0.0:5678;
        proxy_set_header Connection '';
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
    }

    location ~ ^/(webhook|webhook-test) {
        proxy_pass http://0.0.0.0:5678;
        proxy_set_header Connection '';
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
    }
}

server {
    if ($host = n8n.mydomain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    server_name n8n.mydomain.com;
    return 404; # managed by Certbot
}

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: 1.27.3, after upgrading from 0.107
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): was “main” when using 0.107 but now logs told me to remove it as it’s deprecated
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 20.04

Hey @mlaigre,

It looks like your nginx config is not updated to support websockets. Try using the below and see if that helps. You don’t really need the location for webhook / webhook-test either as it will be handled anyway.

server {
    server_name n8n.mydomain.com;

    listen 443 ssl; # managed by Certbot
    listen [::]:443 ssl;
    ssl_certificate /etc/letsencrypt/live/n8n.mydomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/n8n.mydomain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    client_max_body_size 0;

    location / {
        proxy_pass http://0.0.0.0:5678;
        proxy_set_header Connection 'Upgrade';
        proxy_set_header Upgrade $http_upgrade;
        proxy_http_version 1.1;
    }

    location ~ ^/(webhook|webhook-test) {
        proxy_pass http://0.0.0.0:5678;
        proxy_set_header Connection '';
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
    }
}

server {
    if ($host = n8n.mydomain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    server_name n8n.mydomain.com;
    return 404; # managed by Certbot
}

Hi @Jon,

Many thanks, it now works perfectly.

In case anyone comes here with the same problem, this is the part fixed to make websockets work :

1 Like

The same solution is on a few other posts as well :slight_smile:

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