supabase: API Gateway and postgresql logging not working for local development
Bug report
API Gateway and postgresql logging not working for local development. It is very frustrating that the supabase team is not working to improve the local development experience.
I even updated the supabase. Deleted the complete docker images plus volumes and restarted the local environment. Still, it does not work. Also before that, I tried supabase db reset it also didn’t work.
Expected behavior
One should not get a 502 error.
Screenshots
My config.toml file
# A string used to distinguish different Supabase projects on the same host. Defaults to the working
# directory name when running `supabase init`.
project_id = "fcp-supabase"
[api]
# Port to use for the API URL.
port = 54321
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
# endpoints. public and storage are always included.
schemas = []
# Extra schemas to add to the search_path of every request.
extra_search_path = ["extensions"]
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
# for accidental or malicious requests.
max_rows = 50
[db]
# Port to use for the local database URL.
port = 54322
# The database major version to use. This has to be the same as your remote database's. Run `SHOW
# server_version;` on the remote database to check.
major_version = 15
[db.pooler]
enabled = false
port = 54329
pool_mode = "transaction"
default_pool_size = 15
max_client_conn = 100
[studio]
# Port to use for Supabase Studio.
port = 54323
# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
# are monitored, and you can view the emails that would have been sent from the web interface.
[inbucket]
# Port to use for the email testing server web interface.
port = 54324
smtp_port = 54325
pop3_port = 54326
[storage]
# The maximum file size allowed (e.g. "5MB", "500KB").
file_size_limit = "50MB"
[auth]
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
# in emails.
site_url = "http://localhost:5173"
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
additional_redirect_urls = ["https://localhost:5173", "http://localhost:54321"]
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 seconds (one
# week).
jwt_expiry = 3600
# Allow/disallow new user signups to your project.
enable_signup = true
[auth.email]
# Allow/disallow new user signups via email to your project.
enable_signup = true
# If enabled, a user will be required to confirm any email change on both the old, and new email
# addresses. If disabled, only the new email is required to confirm.
double_confirm_changes = true
# If enabled, users need to confirm their email address before signing in.
enable_confirmations = false
# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
# `discord`, `facebook`, `github`, `gitlab`, `google`, `twitch`, `twitter`, `slack`, `spotify`.
[auth.external.apple]
enabled = false
client_id = ""
secret = ""
# Overrides the default auth redirectUrl.
redirect_uri = ""
# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
# or any other third-party OIDC providers.
url = ""
[auth.external.github]
enabled = true
client_id = "env(SUPABASE_AUTH_GITHUB_CLIENT_ID)"
secret = "env(SUPABASE_AUTH_GITHUB_SECRET)"
redirect_uri = "http://localhost:54321/auth/v1/callback"
[auth.external.google]
enabled = true
client_id = "env(SUPABASE_AUTH_GOOGLE_CLIENT_ID)"
secret = "env(SUPABASE_AUTH_GOOGLE_SECRET)"
redirect_uri = "http://localhost:54321/auth/v1/callback"
[auth.external.linkedin_oidc]
enabled = true
client_id = "env(SUPABASE_AUTH_LINKEDIN_CLIENT_ID)"
secret = "env(SUPABASE_AUTH_LINKEDIN_SECRET)"
redirect_uri = "http://localhost:54321/auth/v1/callback"
[analytics]
enabled = true
port = 54327
vector_port = 54328
# Configure one of the supported backends: `postgres`, `bigquery`.
backend = "postgres"
[functions.admin]
verify_jwt = false
[functions.compressVideoFile]
verify_jwt = false
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 86 (65 by maintainers)
@Akash187 use
npxinstead or install usingbrew install supabase/tap/supabase-beta(beta comes first and then it is pushed to the main homebrew tap).Looks like this is working now so we can go ahead and close this one! Thanks to everyone who helped to debug this and pushed this! 🔥 🙏
and it’s running finally 🥳🥳🥳🥳🥳🥳
I’ve reverted studio to the last known working version in cli. You can use it via the beta release channel.
I will keep this issue open until the the root cause is resolved in studio.
I will let you know after updating the file
has this logging issue has already been fixed @encima ? Is this merged to current cli version?
This is so frustrating, have to remind myself updating supabase cli is never a good option.
the bugfix is not yet out on cli, as we are fixing other related bugs as well so that this is fully resolved. The issue will be closed once it is verified fixed on cli. The docker logs UI can still be used while we get this fix out, thanks for the patience.
Fixed the query in local here
Taking a look at the other issues. Sorry for the inconvenience folks.
In an existing project
brew upgrade supabaseupgrading to1.176.4can confirm logs showing up now! Thanks so much for the fix!Can confirm this is fixed in the latest CLI (1.176.4), though the default query is not.
npx supabase@latest initin an empty directory (also useful to check no images are cached)analyticsinsupabase/config.tomlnpx supabase@latest startPostgresorKongetc OR modify query to be:select timestamp, event_message, metadata from edge_logs limit 5Will leave this open while the query is fixed in the frontend
Thanks, @encima and @clxyder finally it started working. Let me know if it is fixed in the latest release so I can switch to the new version.
Can confirm this is occurring on the latest CLI version (
1.169.5) and also in1.168.1.Confirmed this is in the latest CLI (1.169.6) and is as @clxyder said.
Informing CLI and Analytics teams
I was able to overcome this issue by installing
supabase@1.166.1.This will force to you use
supabase/studio:20240422-5cf8f30, instead ofsupabase/studio:20240506-2976cd6.As a quick check I also installed the latest cli version (
supabase@1.169.5), which also has the same issue.When you inspect the docker logs for
supabase/logflare:1.4.0, I get the following error:API Gateway Logs
Postgres Logs
In both cases, the error message is
(Postgrex.Error) ERROR 42703 (undefined_column) column "body" does not exist.If you see the image, no
supabasewas installed before I rannpx supabase@latest.Anyway, I got it working through Homebrew. Thanks a lot for fixing this issue and hope it will not appear in future versions.
@encima below is the suggestion. Topic - Checking Logflare logs in a docker container. Information - It will cover how users can see supabase logs plus Postgres logs especially the
RAISE statement within your PL/pgSQL functions to log messages.@tecoad please see the above comment. this issue is not yet resolved. we will comment and close once the fix is out. sorry for the confusion and thank you for your patience!
Ok, thanks @encima confirm with us tomorrow if everything is fine.
Any update @encima @sweatybridge @Ziinc
Darwin
You can also download the binary from the Releases tab
The Analytics and CLI teams will investigate and provide a fix here when it is ready
Luckily firebase guys do not need to run docker for local development.