cli icon indicating copy to clipboard operation
cli copied to clipboard

Cannot inspect Egde logs in CI/CD

Open riderx opened this issue 10 months ago • 9 comments

Bug report

  • [X] I confirm this is a bug with Supabase, not with my own application.
  • [X] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When running supabase start in Github action The edge function starts, but we can't see its logs. When running test against it and the test fails, we cannot see the reason of the fail in our code

To Reproduce

I made a reproduction repo for this: https://github.com/riderx/supabase_edge_issue

You can see in the GitHub action it fails: https://github.com/riderx/supabase_edge_issue/actions/runs/13354496001/job/37295330902 But we cannot see the logs of the edge functions. We could run directly the Deno code outside the Edge worker, but this defeats the purpose of having the same env as production.

Expected behavior

Having a way to inspect the edge workers logs if the CI/CD failed.

riderx avatar Feb 16 '25 11:02 riderx

Another example on why it's important: https://github.com/supabase/postgres/issues/1447 In my local test i was not up-to-date with images so i coudn't reproduce and understand the issue, now i replicate in local too but that was painful to understand

riderx avatar Feb 16 '25 14:02 riderx

@riderx I recommend posting this issue to https://github.com/supabase/cli/issues which covers issues with running the supabase command, and the images that are associated with that. Closing and recommend re-posting there.

samrose avatar Feb 26 '25 20:02 samrose

@kiwicopple recommended me to post here, as you would redirect it to correct place

riderx avatar Feb 26 '25 21:02 riderx

https://x.com/kiwicopple/status/1890470770884727131?s=46

riderx avatar Feb 26 '25 21:02 riderx

@sweatybridge do you know if there is a way to move this issue to https://github.com/supabase/cli/issues assuming you agree that is the correct home for it? Thanks!

samrose avatar Feb 26 '25 22:02 samrose

I think this is a known studio bug. We can move it to supabase/supabase repo.

The workaround is check the docker logs for edge runtime container.

docker logs -f supabase_edge_runtime_<project>

sweatybridge avatar Feb 27 '25 01:02 sweatybridge

in local i can see my logs yep, but in CI/CD i have no way to see them, unless i miss something ?

riderx avatar Feb 27 '25 03:02 riderx

thanks @sweatybridge

samrose avatar Feb 27 '25 10:02 samrose

@riderx I think that if you place the step with if: failure() set immediately after the step that fails, you will be able to view the logs by calling docker logs there. Did this not work?

nyannyacha avatar May 26 '25 01:05 nyannyacha

@nyannyacha I ended up doing:

      - uses: JarvusInnovations/background-action@v1
        name: Bootstrap Edge server
        with:
          run: supabase functions serve &
          wait-on: |
            http-get://127.0.0.1:54321/functions/v1/ok
          tail: stderr,stdout
          log-output-resume: stderr,stdout
          wait-for: 1m
          log-output: stderr,stdout # same as true
          log-output-if: true
          working-directory: .

And this solve my issue

riderx avatar Oct 18 '25 01:10 riderx