Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: document missing headers problem #1976

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions website/docs/guides/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,21 @@ If you don't consume this publication, the WAL can fill up and your Postgres dat
##### Solution — run Electric

The simplest way to avoid this is to make sure you're running the Electric sync service against Postgres. This will consume the publication and allow the WAL to be released.

### Missing headers — why is the client complaining about missing headers?

When Electric responds to shape requests it includes headers in the response that the client needs in order to function. It's common to run Electric behind a proxy. However, some proxies might not pass through the response headers. In this case, the client will complain about missing headers.

##### Solution — pass through the response headers

Make sure that the headers in the response from Electric are passed-through to / copied onto the response that the proxy sends to the client. It's safest to pass-through / copy all the headers. At a minimum, you **must** pass through any headers prefixed with `electric-`.

### CORS headers — why are cross-origin requests not working?

Electric also exposes CORS headers. In some cases if a proxy overrides `Access-Control-Expose-Headers` when it responds to an `OPTIONS` request, this may break CORS.

##### Solution — pass through CORS requests and response headers

The safest thing is to also always make sure you proxy `OPTIONS` requests to Electric and pass through any CORS headers in the response from Electric to the client as well.

If in doubt, pass the headers through!