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

Screenshot 2024-05-27 at 5 08 14 AM Screenshot 2024-05-27 at 5 08 28 AM

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)

Most upvoted comments

@Akash187 use npx instead or install using brew 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.

npx supabase@beta start

I will keep this issue open until the the root cause is resolved in studio.

@raman04-byte Add the below line in config.toml and test and confirm if it works.

[analytics]
enabled = true
port = 54327
vector_port = 54328
# Configure one of the supported backends: `postgres`, `bigquery`.
backend = "postgres"

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 supabase upgrading to 1.176.4 can confirm logs showing up now! Thanks so much for the fix! CleanShot 2024-06-12 at 11 34 22@2x

Can confirm this is fixed in the latest CLI (1.176.4), though the default query is not.

  1. npx supabase@latest init in an empty directory (also useful to check no images are cached)
  2. Enable analytics in supabase/config.toml
  3. npx supabase@latest start
  4. Navigate to Studio -> Logs
  5. Select Postgres or Kong etc OR modify query to be: select timestamp, event_message, metadata from edge_logs limit 5
  6. Success image

Will 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 in 1.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 of supabase/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

20:57:03.237 [error] GenServer {Logflare.Endpoints.Cache, 1, %{"iso_timestamp_start" => "2024-05-27T19:00:00.000Z", "project" => "default", "project_tier" => "ENTERPRISE", "ref" => "default", "sql" => "select id, identifier, timestamp, event_message, request.method, request.path, response.status_code\n  from edge_logs\n  cross join unnest(metadata) as m\n  cross join unnest(m.request) as request\n  cross join unnest(m.response) as response\n  \n  order by timestamp desc\n  limit 100\n  "}} terminating
** (Postgrex.Error) ERROR 42703 (undefined_column) column "body" does not exist

    query: WITH retention AS (SELECT (CASE WHEN $1::text = 'FREE' THEN current_timestamp - INTERVAL '1 day' WHEN $2::text = 'PRO' THEN current_timestamp - INTERVAL '7 day' WHEN ($3::text = 'PAYG' OR $4::text = 'ENTERPRISE') THEN current_timestamp - INTERVAL '90 day' ELSE current_timestamp - INTERVAL '1 day' END) AS date), edge_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_c9901b6d_4e07_4ae8_a11f_e3a57eec0dca" AS t WHERE (t.body ->> 'project') = $5::text AND CASE WHEN COALESCE($6::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($7::text AS TIMESTAMP) END AND CASE WHEN COALESCE($8::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($9::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), postgres_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_12a6b45f_96c0_4512_95a4_d408173d3ccb" AS t WHERE (t.body ->> 'project') = $10::text AND CASE WHEN COALESCE($11::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($12::text AS TIMESTAMP) END AND CASE WHEN COALESCE($13::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($14::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), function_edge_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_71139d09_53d4_4ab0_aa0b_55f15a50b0dd" AS t WHERE CASE WHEN COALESCE($15::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($16::text AS TIMESTAMP) END AND CASE WHEN COALESCE($17::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($18::text AS TIMESTAMP) END AND (body #>> '{metadata,project_ref}') = $19::text AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), function_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_7a917400_0149_426e_97fd_d0a4791b4523" AS t WHERE (body #>> '{metadata,project_ref}') = $20::text AND CASE WHEN COALESCE($21::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($22::text AS TIMESTAMP) END AND CASE WHEN COALESCE($23::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($24::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), auth_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_eb3f3364_b8c2_4d41_b37f_61980c8cad3e" AS t WHERE (t.body ->> 'project') = $25::text AND CASE WHEN COALESCE($26::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($27::text AS TIMESTAMP) END AND CASE WHEN COALESCE($28::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($29::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), realtime_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_cfec0bd5_4e11_44ee_ad20_cea9b74a4175" AS t WHERE (body #>> '{metadata,project}') = $30::text AND CASE WHEN COALESCE($31::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($32::text AS TIMESTAMP) END AND CASE WHEN COALESCE($33::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($34::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), storage_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_30649fa8_b145_4298_8e88_f8b068311ef0" AS t WHERE (body #>> '{metadata,project}') = $35::text AND CASE WHEN COALESCE($36::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($37::text AS TIMESTAMP) END AND CASE WHEN COALESCE($38::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($39::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), postgrest_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_e2280f5c_f870_4465_9845_efa3091b7e6d" AS t WHERE CASE WHEN COALESCE($40::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($41::text AS TIMESTAMP) END AND CASE WHEN COALESCE($42::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'times (truncated)

20:57:03.238 [error] Endpoint query exited for an unknown reason

Postgres Logs

20:59:07.068 [error] GenServer {Logflare.Endpoints.Cache, 1, %{"iso_timestamp_start" => "2024-05-27T19:00:00.000Z", "project" => "default", "project_tier" => "ENTERPRISE", "ref" => "default", "sql" => "select identifier, postgres_logs.timestamp, id, event_message, parsed.error_severity from postgres_logs\n  cross join unnest(metadata) as m\n  cross join unnest(m.parsed) as parsed\n  \n  order by timestamp desc\n  limit 100\n  "}} terminating
** (Postgrex.Error) ERROR 42703 (undefined_column) column "body" does not exist

    query: WITH retention AS (SELECT (CASE WHEN $1::text = 'FREE' THEN current_timestamp - INTERVAL '1 day' WHEN $2::text = 'PRO' THEN current_timestamp - INTERVAL '7 day' WHEN ($3::text = 'PAYG' OR $4::text = 'ENTERPRISE') THEN current_timestamp - INTERVAL '90 day' ELSE current_timestamp - INTERVAL '1 day' END) AS date), edge_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_c9901b6d_4e07_4ae8_a11f_e3a57eec0dca" AS t WHERE (t.body ->> 'project') = $5::text AND CASE WHEN COALESCE($6::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($7::text AS TIMESTAMP) END AND CASE WHEN COALESCE($8::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($9::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), postgres_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_12a6b45f_96c0_4512_95a4_d408173d3ccb" AS t WHERE (t.body ->> 'project') = $10::text AND CASE WHEN COALESCE($11::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($12::text AS TIMESTAMP) END AND CASE WHEN COALESCE($13::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($14::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), function_edge_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_71139d09_53d4_4ab0_aa0b_55f15a50b0dd" AS t WHERE CASE WHEN COALESCE($15::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($16::text AS TIMESTAMP) END AND CASE WHEN COALESCE($17::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($18::text AS TIMESTAMP) END AND (body #>> '{metadata,project_ref}') = $19::text AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), function_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_7a917400_0149_426e_97fd_d0a4791b4523" AS t WHERE (body #>> '{metadata,project_ref}') = $20::text AND CASE WHEN COALESCE($21::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($22::text AS TIMESTAMP) END AND CASE WHEN COALESCE($23::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($24::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), auth_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_eb3f3364_b8c2_4d41_b37f_61980c8cad3e" AS t WHERE (t.body ->> 'project') = $25::text AND CASE WHEN COALESCE($26::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($27::text AS TIMESTAMP) END AND CASE WHEN COALESCE($28::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($29::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), realtime_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_cfec0bd5_4e11_44ee_ad20_cea9b74a4175" AS t WHERE (body #>> '{metadata,project}') = $30::text AND CASE WHEN COALESCE($31::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($32::text AS TIMESTAMP) END AND CASE WHEN COALESCE($33::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($34::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), storage_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_30649fa8_b145_4298_8e88_f8b068311ef0" AS t WHERE (body #>> '{metadata,project}') = $35::text AND CASE WHEN COALESCE($36::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($37::text AS TIMESTAMP) END AND CASE WHEN COALESCE($38::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) <= CAST($39::text AS TIMESTAMP) END AND CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > retention.date ORDER BY CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) DESC), postgrest_logs AS (SELECT (t.body -> 'timestamp') AS timestamp, (t.body -> 'id') AS id, (t.body -> 'event_message') AS event_message, (t.body -> 'metadata') AS metadata FROM retention, "_analytics"."log_events_e2280f5c_f870_4465_9845_efa3091b7e6d" AS t WHERE CASE WHEN COALESCE($40::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTAMP) > CAST($41::text AS TIMESTAMP) END AND CASE WHEN COALESCE($42::text, '') = '' THEN true ELSE CAST((to_timestamp(CAST((t.body ->> 'timestamp') AS BIGINT) / 1000000.0) AT TIME ZONE 'UTC') AS TIMESTA (truncated)

20:59:07.069 [error] Endpoint query exited for an unknown reason

In both cases, the error message is (Postgrex.Error) ERROR 42703 (undefined_column) column "body" does not exist.

If you see the image, no supabase was installed before I ran npx supabase@latest.

Screenshot 2024-07-29 at 7 40 37 PM

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.

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.