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

Supabase cli unable to start containers on github actions #1737

Closed
clayton-cc opened this issue Dec 11, 2023 · 8 comments
Closed

Supabase cli unable to start containers on github actions #1737

clayton-cc opened this issue Dec 11, 2023 · 8 comments

Comments

@clayton-cc
Copy link

Describe the bug
Running supabase start on github actions leads to auth error

To Reproduce
Steps to reproduce the behavior:

  1. Create a github action
  2. Use supabase/setup-cli@v1, version: latest for supabase, ubuntu-latest for actions runner, actions/setup-node@v3 with node-version: 18
  3. Run supabase start
  4. See error

Expected behavior
Supabase starts and is able to be interacted with

Screenshots
image
Desktop (please complete the following information):

  • OS: [e.g. iOS] ubuntu-latest github actions runner
  • Browser (if applicable) [e.g. chrome, safari]: N/A
  • Version of CLI [e.g. v1.60.0]: v1.120.0+
  • Version of supabase-js (if applicable) [e.g. v2.22.0]: N/A
  • Version of Node.js (if applicable) [e.g. v16.20.0]: 18

Additional context

Cross-posting this from the setup-cli repo as I had originally posted there.. We have been using latest version of the CLI within github actions. On Friday tests were passing, this morning they aren't as we aren't able to get supabase up and running within our actions. I did some various version testing after finding an older version still works fine with the following results:

Version Starting
1.123.3
1.123.0
1.122.0
1.121.1
1.121.0
1.120.0
1.119.1
1.119.0
1.115.5

Happy to try any other debugging or changes to the action

@sweatybridge
Copy link
Contributor

Could you share the output from running supabase services in your github action? Our CI test seems to be passing so there might be some project specific config that's causing it.

@clayton-cc
Copy link
Author

image

Here is the output of supabase services. We are pinning to major_version = 14 for the [db] block of our config.toml

@sweatybridge
Copy link
Contributor

Hmm I added pg14 to our test matrix and it still reported healthy. I went through the changes in 1.120.0 again and they seem unrelated to local password.

Could you check if there's any migrations altering the database password?

grep -ri supabase_admin supabase/migrations

Another thing you can try is to run supabase db start in your workflow instead. This launches just the database without other services. If this works, then you can try connecting via psql. For example,

steps:
  - run: supabase db start
  - run: psql -h localhost -U supabase_admin -p 54322 -c 'select 1'
    env:
      PGPASSWORD: postgres

@clayton-cc
Copy link
Author

No hits for grep -r "supabase_admin" supabase/migrations

Doing a (ignore whitespace issue from copy/paste):

  run: |
          supabase services
          supabase db start
          psql -h localhost -U supabase_admin -d postgres -p 54322 -c 'select 1'
          supabase status
          docker ps
        env:
          PGPASSWORD: postgres

gives

 ?column? 
----------
        1
(1 row)

Stopped services: [supabase_kong_database-migrator supabase_auth_database-migrator supabase_inbucket_database-migrator realtime-dev.supabase_realtime_database-migrator supabase_rest_database-migrator supabase_storage_database-migrator storage_imgproxy_database-migrator supabase_pg_meta_database-migrator supabase_studio_database-migrator supabase_analytics_database-migrator]
supabase local development setup is running.

          DB URL: ***127.0.0.1:54322/postgres
CONTAINER ID   IMAGE                                 COMMAND                  CREATED          STATUS                    PORTS                                         NAMES
d349bba2e04c   ghcr.io/supabase/postgres:14.1.0.89   "docker-entrypoint.s…"   13 seconds ago   Up 12 seconds (healthy)   0.0.0.0:54322->5432/tcp, :::54322->5432/tcp   supabase_db_database-migrator

which seems to be working. If I follow that with supabase start it reports

supabase start is already running.
Run supabase status to show status of local Supabase containers

Doing a supabase stop and a following supabase start gives the same error as the original

@sweatybridge
Copy link
Contributor

Thanks for these logs. I think we are making progress. Could you try isolating the realtime service since the error seems to be from there?

supabase start -x realtime

I've also made a new beta release with updated pg14 initial schema. I'm not sure if it fixes this specific issue but please give it a try. You can do that by setting the version of setup-cli to 1.123.6.

@clayton-cc
Copy link
Author

out.txt

Here is the output of the following, I just appended it to the previous debugging commands. I called stop so we wouldn't get the supabase start is already running

        run: |
          supabase services
          supabase db start
          psql -h localhost -U supabase_admin -d postgres -p 54322 -c 'select 1'
          supabase status
          docker ps
          supabase stop
          supabase start -x realtime
        env:
          PGPASSWORD: postgres

@sweatybridge
Copy link
Contributor

I still can't reproduce this error. Do you mind getting the logs from the following command?

        run: |
          supabase start -x realtime,storage-api,imgproxy,kong,inbucket,postgrest,pgadmin-schema-diff,migra,postgres-meta,studio,edge-runtime,logflare,vector,pgbouncer

@sweatybridge
Copy link
Contributor

We have updated realtime in latest CLI release which changes the order which realtime migrations are run.

If this is still a problem, I think the best resolution is to upgrade your hosted project to PG15.

Hope it helps!

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

2 participants