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

Show proper error if the database isn't working correctly #2276

Open
KyleAMathews opened this issue Feb 1, 2025 · 1 comment
Open

Show proper error if the database isn't working correctly #2276

KyleAMathews opened this issue Feb 1, 2025 · 1 comment
Labels

Comments

@KyleAMathews
Copy link
Contributor

If you run Electric and it can't setup things with the provided db and then you query a shape, we currently respond "stack not ready".

This isn't a very helpful response.

@samwillis has been doing nice work on validating dbs for cloud that we should also port here.

Dbs can fail for three reasons:

  1. Connecting issues e.g. domain not found (typo perhaps), the connection was blocked by a firewall, then at pg if the username or password is incorrect or the db doesn't exist. When these happen, we should just store the error and return it to shape requests.
  2. user doesn't have REPLICATION role to setup the publication slot — return nice error about this & link to docs on creating a user with the right role
  3. the db doesn't have logical replication enabled — return nice error and link to docs on enabling logical replication
@msfstef
Copy link
Contributor

msfstef commented Feb 3, 2025

Regarding the stack not ready, Electric has a health check endpoint and any requests for shapes while the service is not healthy will return a 5xx response (e.g. the stack not ready one) - I agree that we want to enrich the messaging but ultimately these are requests made to an unhealthy service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants