Novu sync "431 Request Header Fields Too Large": fix
A 431 on `npx novu@latest sync` means a server or proxy in front of your endpoint rejected the request because its headers exceeded a size limit. Find which layer answered, raise its header limit (usually Node or the proxy), and retry. The post-login "Sorry, but something went wrong" is a separate problem.
Sohail Hussain8 min readShort answer
- A 431 means some layer between the CLI and your endpoint refused the request because its headers were too big. Find which layer answered (Node, a reverse proxy, or a load balancer) and raise its header limit.
- For "Sorry, but something went wrong" after login on the community Docker Compose setup, the issue was closed as not planned. Move to the compose setup Novu documents as supported, or to hosted Novu.
You ran npx novu@latest sync against a self-hosted endpoint and got this:
431 Request Header Fields Too Large
Or the dashboard loads after login and shows "Sorry, but something went wrong". These are two separate failures that tend to appear in the same self-hosting attempt. The first is a configuration limit you can fix in a few minutes. The second is a known problem with a community setup, and I'd stop debugging it early.
Why novu sync returns 431
RFC 6585 defines 431 as the server being unwilling to process a request because its header fields are too large. The same RFC says it can mean the headers are too big in total or that one header is. It also says the request may be resubmitted after the headers are reduced. So there are only two fixes: raise the limit on the layer that refused, or send smaller headers.
The problem was reported for self-hosted endpoints in a Novu GitHub issue that was closed in January 2025. From the report I can't tell which header was oversized in your setup, so test rather than assume.
Causes, most common first:
- The Node.js process hosting the endpoint. Node caps total request header size at 16 KiB by default in current versions and answers with 431 above that. This is the most likely source.
- A reverse proxy or load balancer with a low limit. Each layer has its own limit, and the smallest one wins.
- A Go-based proxy such as Caddy. Its default limit is 1 MB, so it only trips if someone lowered it.
- Bloated headers. A long
Authorizationtoken, large cookies on a shared parent domain, or an SSO or API gateway that injects extra headers.
nginx is a special case. By default it answers 400 Request Header Or Cookie Too Large, not 431. If you run nginx and see a 431, the response probably came from something behind it.
Step-by-step fixes
Find which layer returned the 431
Send a request with one deliberately large header and see who answers. Replace the URL with the endpoint you pass to the CLI.
curl -sv -X POST "https://your-endpoint.example.com/api/novu" \
-H "X-Padding: $(head -c 20000 /dev/zero | tr '\0' a)" \
-o /dev/null 2>&1 | grep -iE "^< (HTTP|server|via)"
Then run the same request straight at the container port, skipping the proxy. If the direct call works and the public URL fails, the proxy or load balancer is your culprit.
| What you see | Likely source | Fix |
|---|---|---|
431 with no Server header | The Node process | Fix 1 |
431 with Server: Caddy | Caddy with a lowered limit | Fix 2 |
400 Request Header Or Cookie Too Large | nginx | Fix 2 |
431 only on the public hostname | Proxy or cloud load balancer | Fix 2 |
| Real requests fail but the padded test passes | A specific header is the problem | Fix 3 |
Fix 1: raise the limit in Node
If the app process answered, start it with a larger limit. In Docker Compose, set an environment variable on the service that serves your endpoint:
services:
app:
environment:
NODE_OPTIONS: "--max-http-header-size=32768"
- Open your compose file and find the service that hosts the endpoint the CLI posts to.
- Add the
NODE_OPTIONSvalue above. If the variable already exists, append the flag to it instead of replacing it. - Recreate the container (
docker compose up -d). - Rerun
npx novu@latest sync.
This applies to whichever process receives the sync request. That is the app hosting your endpoint, not necessarily a Novu container.
Fix 2: raise the limit on the proxy
For nginx, raise the buffers so large headers pass:
http {
large_client_header_buffers 4 32k;
}
For Caddy, only act if a limit was lowered. Look for max_header_size in your Caddyfile and raise it if it is below what your headers need:
{
servers {
max_header_size 1MB
}
}
Reload the proxy (nginx -s reload, or restart Caddy) and rerun the sync. If a cloud load balancer sits in front, check its documentation for a header limit. Some limits are fixed and can't be raised. In that case, shrink the headers or call the endpoint by a path that bypasses the balancer.
Raise every layer, not one
If you set 32 KB on Node but a proxy in front still allows 8 KB, the proxy's smaller limit still wins and you will keep seeing the error.
Fix 3: shrink the headers
Raising a limit works, but oversized headers usually have a source. Log the incoming header names and sizes at the first layer that sees the request. Typical offenders are a long Authorization token, large cookies scoped to a parent domain, and headers added by an auth proxy. Trimming a bloated cookie is a better long-term fix than a 64 KB limit.
"Sorry, but something went wrong" after login
This is the second failure. People on Novu's GitHub reported it in October 2025 with the community Docker Compose setup. The dashboard showed "Sorry, but something went wrong" after login. The network tab showed GET /v1/organizations/me returning 422, and the console showed:
TypeError: Cannot read properties of undefined (reading 'request')
That issue was closed as not planned, so don't wait for a patch to that compose file. What I'd do, in order:
- Open browser developer tools and confirm you see the same failing request. A 422 on a different endpoint is a different problem.
- Read the API container logs at the moment of the failed call. A 422 response body often says what the API rejected.
- Check that every Novu image in your compose file runs the same version. A dashboard and API that disagree can produce errors like this.
- Confirm the API URL configured for the dashboard is reachable from your browser, not only from inside the Docker network.
- If it still fails, stop. Switch to the compose setup Novu documents as supported, or use hosted Novu.
Self-hosters also report on community forums that the docs and the community Kubernetes charts are stale or hard to follow. Budget extra time if you go the Kubernetes route. If running the stack isn't the point of your project, hosted Novu is the lower-effort choice.
Check the version first
Many "something went wrong" screens after login come from a dashboard and API built from different versions. Pin one tag for all Novu images before you debug anything else.
Checklist before you try again
- The failing layer is identified with the
curl -svtest, not guessed. - Node, the reverse proxy and any load balancer all allow headers at least as large as your real requests.
- You restarted or reloaded each component after changing it.
- You rerun
npx novu@latest syncwith the same endpoint URL you tested. - All Novu images in your compose file share one version.
- The dashboard's API URL opens from your browser.
If nothing works
If a 431 persists after raising limits on every layer, open or comment on an issue in the Novu GitHub repository, or ask on Novu's community channels. For a proxy or cloud load balancer, contact that vendor's support with the same details. Include:
- the CLI version and the exact command, with secrets removed
- the response headers from the
curl -svtest - your proxy name and version, and the Node version of the app
- for the dashboard error, the failing request's response body and API log lines from the same second
Subject: npx novu sync returns 431 Request Header Fields Too Large (self-hosted)
Command: npx novu@latest sync --bridge-url https://{your-domain}/api/novu (secrets removed)
Novu CLI version: {version}
Node version of the endpoint app: {version}
Proxy: {nginx/Caddy/other} {version}
Result: 431 Request Header Fields Too Large
Direct call to the container port: {works / fails}
Through the public hostname: {works / fails}
Already tried: NODE_OPTIONS=--max-http-header-size=32768, proxy header buffer increase
Response headers from curl -sv are attached.
Common questions
Is a 431 an error in the Novu CLI itself?
Not usually. The CLI sends the request and something on your side refuses it because of header size. Which layer refused it is what the curl test tells you.
Why do I get 400 from nginx but 431 elsewhere?
nginx defaults to 400 Request Header Or Cookie Too Large for oversized headers. A 431 behind nginx came from another component, most likely the Node process.
Is a bigger header limit safe?
A moderate increase such as 32 KB is fine for most setups. Header limits exist partly to protect servers from abuse, so I'd fix the source of the bloat before going far past that.
Should I keep using the community compose file?
I wouldn't, given the closed-as-not-planned status of the post-login error. Use the setup Novu documents as supported, or hosted Novu.
Explore: Email Marketing Strategy
Related Articles
ActiveCampaign n8n error 301 on create contact: causes and fixes
A 301 from the ActiveCampaign node means the request went to a URL that redirects, so start with the API URL in your n8n credential. Copy it from Settings, then Developer, and check the scheme and path. Zapier 403 and cURL error 28 behind Cloudflare have different causes, covered below.
"Stage not on allowlist": Apollo to HubSpot sync fix
The error "Stage not on allowlist" means the contact's Apollo stage is not on the list of stages permitted to push to HubSpot. Open the HubSpot integration in Apollo, go to the Sync tab, and add that stage under "Stages for push contacts". Lifecycle stage mapping is a separate setting.
Salesmate "Authorization with Gmail failed": Gmail IMAP fix
Salesmate shows "Authorization with Gmail failed" when it can't read your Gmail account over IMAP. In Gmail settings, enable IMAP, choose "Do not limit the number of messages in an IMAP folder", and show All Mail in IMAP. Then reconnect the account in Salesmate. Other causes are covered below.
AWeber export "Stop Status" and "Stop Time" columns explained
In an AWeber subscriber export, a non-empty Stop Time and a non-zero Stop Status most likely mean the person has stopped receiving your mail, usually because they unsubscribed. AWeber doesn't explain the columns in the file, so verify against a few known unsubscribes, then import those rows as blocked, not subscribed.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free