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

Error 502 Cannot access logs in Local Development #2509

Closed
ricardomatias opened this issue Jul 10, 2024 · 10 comments
Closed

Error 502 Cannot access logs in Local Development #2509

ricardomatias opened this issue Jul 10, 2024 · 10 comments

Comments

@ricardomatias
Copy link

ricardomatias commented Jul 10, 2024

Describe the bug
When trying to view the Postgres logs in the Supabase Studio there's this error:

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

I've changed enabled to "true" under [analytics] in config.toml.

When I execute supabase start I get the following:

WARNING: analytics requires mounting default docker socket: /var/run/docker.sock
Started supabase local development setup.

         API URL: http://127.0.0.1:54321
     GraphQL URL: http://127.0.0.1:54321/graphql/v1
  S3 Storage URL: http://127.0.0.1:54321/storage/v1/s3
          DB URL: postgresql://postgres:[email protected]:54322/postgres
      Studio URL: http://127.0.0.1:54323
    Inbucket URL: http://127.0.0.1:54324
//....

If I execute with supabase start with DOCKER_HOST="unix:///var/run/docker.sock", the warning from the analytics container disappears, but I still get the same errors in Supabase Studio when trying to view the logs.

The following logs are from the supabase_analytics_database container:

2024-07-10 14:51:55 warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20210322193905_rename_columns_for_mnesia_compatibility.exs:3: Logflare.Repo.Migrations.RenameColumnsForMnesiaCompatibility
2024-07-10 14:51:55 
2024-07-10 14:51:55 warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:19: Logflare.Repo.Migrations.SubscribeToPostgres
2024-07-10 14:51:55 
2024-07-10 14:51:55 warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:20: Logflare.Repo.Migrations.SubscribeToPostgres
2024-07-10 14:51:55 
2024-07-10 14:51:55 warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:21: Logflare.Repo.Migrations.SubscribeToPostgres
2024-07-10 14:51:55 
2024-07-10 14:51:55 warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:22: Logflare.Repo.Migrations.SubscribeToPostgres
2024-07-10 14:51:55 
2024-07-10 14:51:55 warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20210729161959_subscribe_to_postgres.exs:23: Logflare.Repo.Migrations.SubscribeToPostgres
2024-07-10 14:51:55 
2024-07-10 14:51:55 warning: an expression is always required on the right side of ->. Please provide a value after ->
2024-07-10 14:51:55   /opt/app/rel/logflare/lib/logflare-1.4.0/priv/repo/migrations/20230727111150_update_endpoint_query_language_default_value.exs:8:13
2024-07-10 14:51:55 

Expected behavior
Can see the logs.

System information
Rerun the failing command with --create-ticket flag.

  • Version of OS: Mac OS Ventura 13.6.7
  • Version of CLI: 1.183.5
  • Version of Docker: Docker version 26.1.4, build 5650f9b
  • Versions of services: [output from supabase services command]
       SERVICE IMAGE      │      LOCAL       │ LINKED
 ─────────────────────────┼──────────────────┼─────────
   supabase/postgres      │ 15.1.1.61        │ -
   supabase/gotrue        │ v2.151.0         │ -
   postgrest/postgrest    │ v12.2.0          │ -
   supabase/realtime      │ v2.29.15         │ -
   supabase/storage-api   │ v1.0.6           │ -
   supabase/edge-runtime  │ v1.54.10         │ -
   supabase/studio        │ 20240701-05dfbec │ -
   supabase/postgres-meta │ v0.83.2          │ -
   supabase/logflare      │ 1.4.0            │ -
   supabase/supavisor     │ 1.1.56           │ -
   darthsim/imgproxy      │ v3.8.0           │ -
@sweatybridge
Copy link
Contributor

Do you confirm that your docker settings match this screenshot? Particularly requires Allow the default Docker socket ...

Screenshot 2024-07-10 at 8 57 10 PM

@ricardomatias
Copy link
Author

Do you confirm that your docker settings match this screenshot? Particularly requires Allow the default Docker socket ...

Screenshot 2024-07-10 at 8 57 10 PM

Yes. They look like this:

image

@sweatybridge
Copy link
Contributor

Could you also show the docker engine config?

Screenshot 2024-07-10 at 9 37 53 PM

I'm unable to reproduce on my macOS. Not sure if this helps, but it might be worth closing any studio browser tabs before supabase start.

@ricardomatias
Copy link
Author

ricardomatias commented Jul 10, 2024

Could you also show the docker engine config?

Screenshot 2024-07-10 at 9 37 53 PM I'm unable to reproduce on my macOS. Not sure if this helps, but it might be worth closing any studio browser tabs before `supabase start`.

I changed "experimental" to true and the problem persists. I also had all browser windows closed.

I see the following errors from the Studio in the Developer Tools' console window:
image

@SebasScript
Copy link

SebasScript commented Jul 11, 2024

I am having the same issue since updating the CLI to the last version on Windows 11, before all was working without issues

same warning

WARNING: analytics requires mounting default docker socket: /var/run/docker.sock

and the error in the vector container

2024-07-11T07:06:07.904242Z ERROR source{component_kind="source" component_id=docker_host component_type=docker_logs component_name=docker_host}: vector::sources::docker_logs: Listing currently running containers failed. error=error trying to connect: Connection refused (os error 111)
2024-07-11 15:06:07 2024-07-11T07:06:07.904258Z  INFO vector: Vector has started. debug="false" version="0.28.1" arch="x86_64" revision="ff15924 2023-03-06"
2024-07-11 15:06:07 2024-07-11T07:06:07.911842Z  INFO vector::internal_events::api: API server running. address=0.0.0.0:9001 playground=http://0.0.0.0:9001/playground
2024-07-11 15:06:07 2024-07-11T07:06:07.911869Z  INFO vector::app: All sources have finished.
2024-07-11 15:06:07 2024-07-11T07:06:07.911873Z  INFO vector: Vector has stopped.
  
        SERVICE IMAGE      │      LOCAL       │  LINKED
  ─────────────────────────┼──────────────────┼────────────
    supabase/postgres      │ 15.1.1.73        │ 15.1.1.73
    supabase/gotrue        │ v2.154.2         │ v2.154.2
    postgrest/postgrest    │ v12.2.1          │ v12.2.1
    supabase/realtime      │ v2.29.15         │ -
    supabase/storage-api   │ v1.6.8           │ v1.6.8
    supabase/edge-runtime  │ v1.54.10         │ -
    supabase/studio        │ 20240701-05dfbec │ -
    supabase/postgres-meta │ v0.83.2          │ -
    supabase/logflare      │ 1.4.0            │ -
    supabase/supavisor     │ 1.1.56           │ -
    darthsim/imgproxy      │ v3.8.0           │ -

all other containers run, but the /vector container for the analytics tries to start and shuts down

@SebasScript
Copy link

SebasScript commented Jul 11, 2024

On windows it is not possible to allow the docker Desktop socket to be used without a docker business subscription. Settings need to be configured via settings manager, There is are no advanced settings in the desktop app

https://docs.docker.com/desktop/hardened-desktop/enhanced-container-isolation/config/

https://docs.docker.com/desktop/hardened-desktop/settings-management/configure/

which is only available to business customers according to their docs unless i am missing something. I tried to to create a config and docker locks me out of my account and shuts down docker desktop unless i remove the config to get it to start up again.

@encima
Copy link
Member

encima commented Jul 15, 2024

Hello, it seems there are a few open issues about this so, in an effort to clean up, we will consolidate to this one here.

The issue is mostly solved and a fix for the frontend query is coming soon.

@encima encima closed this as completed Jul 15, 2024
@encima
Copy link
Member

encima commented Jul 15, 2024

For the issues with sockets and docker configs, those are outside of the Supabase scope and can be resolved by either:

  • paying for a Docker license
  • Using a different container engine, such as podman
  • Using a different Operating System

@sweatybridge
Copy link
Contributor

@SebasScript I can successfully setup tcp daemon socket on docker CE without a business subscription. could you try the docker settings here #2538 (comment)

@SebasScript
Copy link

@sweatybridge thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants