supabase: Error while fetching Edge Functions Logs

Edge function logs is giving error.

Response of api/platform/projects/default/analytics/endpoints/logs.all API:

{
    "error": {
        "code": 502,
        "errors": [],
        "message": "Something went wrong! Unknown error. If this continues please contact support.",
        "status": "UNKNOWN"
    }
}

To Reproduce

  1. Open Supabase Studio interface
  2. Go to Logs > Edge Functions

Screenshots

Image

System information

  • OS: macOS 15.3.1
  • Version of Supabase CLI: 2.15.8

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 6
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Hi thanks for the patience we are investigating this.

This is not fixed in docker version. You can just install docker version and see it from dashboard right away

This is easy to reproduce for me on local machine

mkdir /tmp/suppppp && cd $_
npm install supabase@2.24.3
npx supabase init
npx supabase start
open http://localhost:54323/project/default/logs/edge-functions-logs

Seems like these are the relevant logs docker logs supabase_analytics_suppppp

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
  3 │   @env Application.get_env(:logflare, :env)
    │                    ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20210322193905_rename_columns_for_mnesia_compatibility.exs:3:20: Logflare.Repo.Migrations.RenameColumnsForMnesiaCompatibility (module)

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
 19 │   @username Application.get_env(:logflare, Logflare.Repo)[:username]
    │                         ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:19:25: Logflare.Repo.Migrations.SubscribeToPostgres (module)

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
 20 │   @slot Application.get_env(:logflare, Logflare.ContextCache.CacheBuster)[:replication_slot]
    │                     ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:20:21: Logflare.Repo.Migrations.SubscribeToPostgres (module)

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
 21 │   @env Application.get_env(:logflare, :env)
    │                    ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:21:20: Logflare.Repo.Migrations.SubscribeToPostgres (module)

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
 22 │   @publications Application.get_env(:logflare, Logflare.ContextCache.CacheBuster)[:publications]
    │                             ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:22:29: Logflare.Repo.Migrations.SubscribeToPostgres (module)

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
  5 │   @publications Application.get_env(:logflare, Logflare.ContextCache.CacheBuster)[:publications]
    │                             ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20240708025030_recreate_publication_for_tables.exs:5:29: Logflare.Repo.Migrations.RecreatePublicationForTables (module)

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
  5 │   @publications Application.get_env(:logflare, Logflare.ContextCache.CacheBuster)[:publications]
    │                             ~
    │
    └─ /opt/app/rel/logflare/lib/logflare-1.12.0/priv/repo/migrations/20241204120824_recreate_tables_publication.exs:5:29: Logflare.Repo.Migrations.RecreateTablesPublication (module)

warning: :protocol option is deprecated. Use :protocols instead.
  (nimble_options 1.1.1) lib/nimble_options.ex:575: NimbleOptions.validate_value/3
  (nimble_options 1.1.1) lib/nimble_options.ex:561: NimbleOptions.validate_option/3
  (nimble_options 1.1.1) lib/nimble_options.ex:542: NimbleOptions.reduce_options/2
  (elixir 1.17.3) lib/enum.ex:4858: Enumerable.List.reduce/3
  (elixir 1.17.3) lib/enum.ex:2585: Enum.reduce_while/3
  (nimble_options 1.1.1) lib/nimble_options.ex:535: NimbleOptions.validate_options/2

warning: LogflareWeb.Endpoint.init/2 is deprecated, use config/runtime.exs instead or pass additional options when starting the endpoint in your supervision tree
  (phoenix 1.7.14) lib/phoenix/endpoint/supervisor.ex:36: Phoenix.Endpoint.Supervisor.init/1
  (stdlib 6.1.2) supervisor.erl:869: :supervisor.init/1
  (stdlib 6.1.2) gen_server.erl:2229: :gen_server.init_it/2
  (stdlib 6.1.2) gen_server.erl:2184: :gen_server.init_it/6
  (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3


00:30:19.716 [error] GenServer {:endpoints, {1, %{"iso_timestamp_end" => "", "iso_timestamp_start" => "2025-06-05T23:30:19.412Z", "project" => "default", "project_tier" => "ENTERPRISE", "ref" => "default", "sql" => "select id, function_edge_logs.timestamp, event_message, response.status_code, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from function_edge_logs\n  cross join unnest(metadata) as m\n  cross join unnest(m.response) as response\n  cross join unnest(m.request) as request\n  \n  order by timestamp desc\n  limit 100\n  "}}} terminating
** (MatchError) no match of right hand side value: {:error, %Postgrex.Error{message: nil, postgres: %{code: :undefined_column, line: "3665", message: "column \"body\" does not exist", position: "9047", file: "parse_relation.c", unknown: "ERROR", severity: "ERROR", routine: "errorMissingColumn", pg_code: "42703"}, connection_id: 277, 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_d7939c76_d379_487e_b45b_90239ccb0331\" 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_a03927c7_6089_41c0_be69_b6cab721fd3f\" 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_8e79448e_c238_4264_bd03_2a9631d0fe33\" 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_2bb3e042_7283_4c55_8caa_50dee2db166b\" 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" <> ...}}
    (logflare 1.12.0) lib/logflare/backends/adaptor/postgres_adaptor.ex:119: Logflare.Backends.Adaptor.PostgresAdaptor.execute_query/2
    (logflare 1.12.0) lib/logflare/endpoints.ex:258: Logflare.Endpoints.exec_query_on_backend/4
    (logflare 1.12.0) lib/logflare/endpoints/cache.ex:132: Logflare.Endpoints.Cache.handle_call/3
    (stdlib 6.1.2) gen_server.erl:2381: :gen_server.try_handle_call/4
    (stdlib 6.1.2) gen_server.erl:2410: :gen_server.handle_msg/6
    (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.7009.0>): :query

00:30:19.719 [error] Endpoint query exited for an unknown reason

Env info

$ npx supabase services
   SERVICE IMAGE          | LOCAL                  | LINKED 
  ------------------------|------------------------|--------
   supabase/postgres      | 15.8.1.085             | -      
   supabase/gotrue        | v2.174.0               | -      
   postgrest/postgrest    | v12.2.12               | -      
   supabase/realtime      | v2.36.7                | -      
   supabase/storage-api   | v1.23.0                | -      
   supabase/edge-runtime  | v1.67.4                | -      
   supabase/studio        | 2025.06.02-sha-8f2993d | -      
   supabase/postgres-meta | v0.89.3                | -      
   supabase/logflare      | 1.12.0                 | -      
   supabase/supavisor     | 2.5.1                  | - 

$ sw_vers 
ProductName:		macOS
ProductVersion:		15.5
BuildVersion:		24F74