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

Local Supabase Studio development shows 500 errors when trying to view logs #18891

Closed
2 tasks done
kaumac opened this issue Nov 12, 2023 · 21 comments · Fixed by #27314
Closed
2 tasks done

Local Supabase Studio development shows 500 errors when trying to view logs #18891

kaumac opened this issue Nov 12, 2023 · 21 comments · Fixed by #27314
Labels
bug Something isn't working documentation Improvements or additions to documentation frontend Related to supabase dashboard good first issue Good for newcomers help wanted Extra attention is needed self-hosted Issues related to self hosting

Comments

@kaumac
Copy link

kaumac commented Nov 12, 2023

Bug report

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

Describe the bug

Supabase Studio for local development flow is not reliable at all.

  1. I can't see logs. If I try to see Postgres logs (or any other logs) I get a 500 error.
  2. When you go to Triggers and refresh the page I see a "Failed to retrieve database triggers" error.
  3. If I create a trigger through SQL query I can't see it listed on the dashboard (although it is created and it does work). If I create a trigger through the dashboard I can see it on the dashboard.

It's really hard to develop on a development/staging/production environment when the local development environment is so unstable. I'll need to either develop directly on production or look for a different solution.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Run supabase with supabase start
  2. Open the dashboard.
  3. Create a trigger through a sql query
  4. Go to Triggers on the dashboard and look for the trigger, it won't be there.
  5. Go to the Logs page. There will be a 500 error.

Expected behavior

I should be able to see all triggers, no matter if I create it through a query or through the dashboard/ui.
I should be able to see the postgres logs on the dashboard.

Screenshots

Captura de Tela 2023-11-11 às 21 25 53 Captura de Tela 2023-11-11 às 21 26 41

System information

  • OS: MacOS Sonoma 14.0 (Intel Chipset)
  • Edge and Chrome
  • Version of supabase-js: 2.38.4
  • Version of Node.js: 20.6.1

Additional context

Add any other context about the problem here.

@kaumac kaumac added the bug Something isn't working label Nov 12, 2023
@AndreMiras
Copy link
Contributor

AndreMiras commented Nov 13, 2023

I'm impacted by both bugs described here.
While I have been having the log page 500 error for a long while (at least since supabase CLI 1.93.0 and still to this day 1.106.1), the issue with the trigger page returning an error after refresh is something that I didn't see in previous versions.
Edit, the refresh bug on the trigger page seems to be solved in 1.110.1

@saltcod saltcod added self-hosted Issues related to self hosting logs frontend Related to supabase dashboard labels Nov 13, 2023
@kaumac
Copy link
Author

kaumac commented Nov 13, 2023

I'm impacted by both bugs described here. While I have been having the log page 500 error for a long while (at least since supabase CLI 1.93.0 and still to this day 1.106.1), the issue with the trigger page returning an error after refresh is something that I didn't see in previous versions. Edit, the refresh bug on the trigger page seems to be solved in 1.110.1

Honestly I think the logs are more critical than the triggers not showing. We can still see the triggers through SQL queries (even though this is not an ideal solution/experience).
Logs on the other hand are critical to development. I'm getting errors and I have no way to debug them.

@christian-ledesma
Copy link

I'm also getting error 500 on logs page. Is this currently being worked on?

@Hallidayo
Copy link
Contributor

Hi guys - Are you having issues creating tables from using the Table Editor as well locally?

@christian-ledesma
Copy link

Hi guys - Are you having issues creating tables from using the Table Editor as well locally?

Not in my case. I can perform every other action except for logs.

@kaumac
Copy link
Author

kaumac commented Nov 16, 2023

Hi guys - Are you having issues creating tables from using the Table Editor as well locally?

I also have no issues creating tables and rows. Even the trigger erros seem to have been fixed in one of the latest versions.

I only have issues viewing the logs which are still showing a 500 error

@kaumac kaumac changed the title Local Supabase Studio development is extremely unreliable! Local Supabase Studio development shows 500 errors when trying to view logs Nov 16, 2023
@joshling1919
Copy link

We're also running into this issue. @kaumac, curious if you (or anyone else) have figured out a solution for this. Thanks!

@tranhoangvuit
Copy link
Contributor

Hi @kaumac, @joshling1919, Can I know to which port of analytic you are connecting?
During local development, we will need to make some adjustments to the port and API key of LOGFLARE
Here is my configuration; I hope it can be helpful.
image
image
image

@kaumac
Copy link
Author

kaumac commented Dec 19, 2023

Hi @kaumac, @joshling1919, Can I know to which port of analytic you are connecting? During local development, we will need to make some adjustments to the port and API key of LOGFLARE Here is my configuration; I hope it can be helpful. image image image

Not sure I understand, do I need to make those changes on Docker?
The only thing I did was run supabase start

@kaumac
Copy link
Author

kaumac commented Dec 19, 2023

Also do I need to get an api key for this? Or "api-key" string works?

Hi @kaumac, @joshling1919, Can I know to which port of analytic you are connecting? During local development, we will need to make some adjustments to the port and API key of LOGFLARE Here is my configuration; I hope it can be helpful. image image image

Not sure I understand, do I need to make those changes on Docker? The only thing I did was run supabase start

@kaumac
Copy link
Author

kaumac commented Dec 19, 2023

Hmm I don't even have "supabase_analytics_test", see screenshot
Captura de Tela 2023-12-19 às 16 31 43

@kaumac
Copy link
Author

kaumac commented Dec 19, 2023

Honestly I feel like there's a lack of interest from supabase on the selfhosted stack. You can tell from the lack of features that you have on the hosted app.

This would be totally understandable (after all the selfhosted app doesn't bring in any money), except that the self hosted stack is a critical part of a mature/production app.

I develop locally and afterwards deploy to staging and production which are cloud (paid for) apps.

Supabase is such a great platform, you can tell there's a lot of hard work done on the cloud app, but I must say that the local development feels unpolished and somewhat painful to work with.

@kaumac
Copy link
Author

kaumac commented Dec 19, 2023

I have just written a Function and Trigger that was not working. Even the error message was blank in development/local.

I had to create a migration, deploy the migration to production (cloud/hosted app) just to see the error message and logs, then fix it on my local stack and create a migration with the fix.

The logs are very critical and I feel like they are not being given the attention they should 🙁

@kaumac
Copy link
Author

kaumac commented Dec 19, 2023

Local:
Captura de Tela 2023-12-19 às 16 53 10
Production (cloud/hosted):
Captura de Tela 2023-12-19 às 16 52 27

@tranhoangvuit
Copy link
Contributor

Hmm I don't even have "supabase_analytics_test", see screenshot

In the config.toml file, you can enable it as shown in this image:

image

@tranhoangvuit
Copy link
Contributor

tranhoangvuit commented Dec 20, 2023

Honestly I feel like there's a lack of interest from supabase on the selfhosted stack. You can tell from the lack of features that you have on the hosted app.

Feel free to create an issue in this repo. We will check and update it soon.

I have just written a Function and Trigger that was not working. Even the error message was blank in development/local.

Can you create another ticket for this issue?


Local: Captura de Tela 2023-12-19 às 16 53 10 Production (cloud/hosted): Captura de Tela 2023-12-19 às 16 52 27

It has been resolved in the master code, and the release will be available soon.

@dallastjames
Copy link

Hmm I don't even have "supabase_analytics_test", see screenshot

In the config.toml file, you can enable it as shown in this image:

image

I was running into this same error and I needed to enable analytics in my config.toml file, but I had to add the entire analytics entry manually, likely because I was running an older project that was created before analytics were supported in the local studio. Doing that and restarting supabase, it pulled the logging containers and works correctly for me.

@balazss
Copy link

balazss commented Jan 11, 2024

If it helps anybody... As mentioned above, to have logs locally, you need to edit config.toml and enable analytics:

[analytics]
enabled = false  <-- Set this to true
port = 54327
vector_port = 54328
\# Configure one of the supported backends: `postgres`, `bigquery`.
backend = "postgres" 

Important! After enabling, you need to restart supabase:
npm supa stop
npm supa start

@encima
Copy link
Member

encima commented Jan 19, 2024

I will close this as it is answered here and in the documentation.

Please comment (or open a PR) if you think it could be made clearer and we can re-evaluate!

@encima encima closed this as completed Jan 19, 2024
@stefanstidlffg
Copy link

I will close this as it is answered here and in the documentation.

in the documentation there it is called: LOGFLARE_SINGLE_TENANT_MODE and in the example docker-compose it is called LOGFLARE_SINGLE_TENANT
please adapt the documentation or docker-compose example depending which is the correct one.

@encima
Copy link
Member

encima commented Jun 11, 2024

@stefanstidlffg Thanks for calling that out, anyone is welcome to make a PR to make this clearer in the docs and align with the compose file. If not, I will do it later this week.

@encima encima reopened this Jun 11, 2024
@encima encima added documentation Improvements or additions to documentation help wanted Extra attention is needed good first issue Good for newcomers labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation frontend Related to supabase dashboard good first issue Good for newcomers help wanted Extra attention is needed self-hosted Issues related to self hosting
Projects
Development

Successfully merging a pull request may close this issue.