cli: Failed to retrieve project status

Describe the bug When using the supabase cli in my release workflow, I get the following error:

Unexpected error retrieving remote project status: {"message":"Failed to retrieve project status"}

At first, it was saying in the --debug output that the password was wrong. At this point I reset my db password, and my PAT. I then ran the command again and now I am at the point where I get the error above. The strange thing is that I had not changed anything and the and the last release I ran was 11/17/2024 and everything worked fine.

The only difference is that with that release I was running the Supabase CLI version v1.207.9. The release today that I am running I have changed it to use Supabase CLI version v2.0.0.

Another strange thing is that if I run the same commands locally, it works fine.

Entire Workflow Job

  run_db_migrations:
    name: Run Database Migrations
    needs: [get_version, run_prerelease_validation]
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v4

      - name: Setup Supabase CLI (${{ vars.SUPABASE_CLI_VERSION }})
        uses: supabase/setup-cli@v1
        with:
          version: ${{ vars.SUPABASE_CLI_VERSION }}

      - name: Login to Supabase
        run: |
          $token = "${{ inputs.release-type == 'Preview' && secrets.EA_SUPA_PAT_STANDARD_PREV || secrets.EA_SUPA_PAT_STANDARD_PROD }}";
          supabase login --token "$token";

      - name: Link to Supabase Project
        env:
          SUPABASE_DB_PASSWORD: "${{ inputs.release-type == 'Preview' && secrets.EA_SUPA_DB_PASS_PREV || secrets.EA_SUPA_DB_PASS_PROD }}"
        run: |
          $projRefId = "${{ inputs.release-type == 'Preview' && vars.EA_SUPA_PROJ_REF_ID_PREV || vars.EA_SUPA_PROJ_REF_ID_PROD }}";
          supabase link --project-ref "$projRefId";

      - name: Reset Database
        run: echo "y" | supabase db reset --linked;

[!NOTE] I am running on ubuntu latest and using powershell for the shell. The step that I am getting the errors are when I run the - name: Link to Supabase Project step when trying to link to the correct project. In this scenario, it is my preview environment that I am releasing to.

For the repuction steps, all I can say is to create a test project and use the same job in a test workflow as shown above. I would do this myself, but I am currently on the free account and I already have the max of 2 projects. I will admit I have not tried an emptly blank project to see if I can repoduce the issue.

I have already triple checked and reset my PAT secrets and db passwords and this did not get me very far. Before I reset the password, I was getting a ‘wrong password’ message in the verbose debug logs of the supabase link command, but once I reset all the PAT and password values, I then started getting the message above.

To Reproduce Steps to reproduce the behavior:

  1. Create new empty project
  2. Push project to a linked project in supabase
  3. Create simple workflow with the same job using the same commands as above
  4. Manually execute workflow and see what error messages are shown

Expected behavior I expected the entire workflow to work as normal just as before, even after I updated the Supabase CLI version being used in the workflow.

Screenshots If applicable, add screenshots to help explain your problem. image

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

  • Ticket ID: [e.g. ab1ac733e31e4f928a4d7c8402543712]
  • Version of OS: Ubuntu 22.04.05
  • Version of CLI: v2.0.0
  • Version of Docker: N/A - Problem only occurs in my GitHub workflow
  • Versions of services: [output from supabase services command]
    SERVICE NAME LOCAL LINKED
    supabase/gotrue │ v2.164.0 │ v2.164.0
    postgrest/postgrest │ v12.2.1 │ v12.2.1
    supabase/realtime │ v2.33.58 │ -
    supabase/storage-api │ v1.14.1 │ v1.14.1
    supabase/edge-runtime │ v1.65.3 │ -
    supabase/studio │ 20241202-71e5240 │ -
    supabase/postgres-meta │ v0.84.2 │ -
    supabase/logflare │ 1.4.0 │ -
    supabase/supavisor │ 1.1.56 │ -

Additional context N/A

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

That’s very strange if it works locally but not in GitHub action.

Could you double check token access token you added to GitHub? Is it from your personal access token?

That is very strange indeed. I know we had pooler outage recently but since supabase link is working for you locally, that shouldn’t have impacted your project.

Perhaps you can try skipping the link step and run reset with --db-url flag. You can obtain the pooler connection string from the connect button on dashboard.

      - name: Reset Database
        run: echo "y" | supabase db reset --db-url 'postgres://postgres.hypsasklbmkqagnwhkca:<your-db-password>@aws-0-us-west-1.pooler.supabase.com:5432/postgres'

failed to connect to postgres: failed to connect to host=aws-0-us-west-1.pooler.supabase.com user=postgres.hypsasklbmkqagnwhkca database=postgres: failed SASL auth (invalid SCRAM server-final-message received from server)

Ok this is a different error now. It’s complaining about db password being incorrect.

We are looking into password-less authentication on the platform side for the next few months. Meanwhile can you also double check that your database password is correctly set in GitHub secret?

I went into supabase and generated a new db password and then updated the EA_SUPA_DB_PASS_PREV secret. I ran the release workflow again and I am still getting the EXACT same message as before.

Indeed, this is strange . . . 🤔

failed to connect to postgres: failed to connect to host=aws-0-us-west-1.pooler.supabase.com user=postgres.hypsasklbmkqagnwhkca database=postgres: failed SASL auth (invalid SCRAM server-final-message received from server)

Ok this is a different error now. It’s complaining about db password being incorrect.

We are looking into password-less authentication on the platform side for the next few months. Meanwhile can you also double check that your database password is correctly set in GitHub secret?

I’m referring to this env var in your action

    - name: Link to Supabase Project
        env:
          SUPABASE_ACCESS_TOKEN: "${{ inputs.release-type == 'Preview' && secrets.EA_SUPA_PAT_STANDARD_PREV || secrets.EA_SUPA_PAT_STANDARD_PROD }}"

The SUPABASE_ACCESS_TOKEN should be a PAT from your Supabase account.

Hello, sorry for the late reply.

I would do this myself, but I am currently on the free account and I already have the max of 2 projects.

If this happens on a free project, I suspect the error is due to your preview project being paused after 7 days of inactivity. We added some validations in recent CLI versions to make sure that projects are in an active, healthy state before you can link.

Since we don’t expose an API to resume your project, the only way is to resume manually from the dashboard. If you want to keep your projects running, you can either send some requests periodically or, as I would shamelessly recommend, upgrade to Pro.

You will also get more features, resources, and support on all your projects when you switch to Pro plan, including

  • Branching
  • Daily backups
  • 7-day log retention
  • No project pausing
  • Email support

I was wondering if that was the issue. I logged in yesterday and made sure that the project was active before using the command.

I am building an application for a client, and we absolutely plan on upgrading to pro. We are just not quite there yet. I would expect in the next 3 months or so.

I got the following result which means that it all seems to be working:

❯ supabase link --project-ref <redacted-proj-ref-id>
WARN: no SMS provider is enabled. Disabling phone login
Enter your database password (or leave blank to skip):
Finished supabase link.
WARNING: Local config differs from linked project. Try updating supabase\config.toml
diff supabase\config.toml hypsasklbmkqagnwhkca
--- supabase\config.toml
+++ hypsasklbmkqagnwhkca
@@ -50,8 +50,7 @@

 [auth]
 enabled = true
-site_url = "http://127.0.0.1:3000"
-additional_redirect_urls = ["https://127.0.0.1:3000"]
+site_url = "http://localhost:8000/login"
 jwt_expiry = 3600
 enable_refresh_token_rotation = true
 refresh_token_reuse_interval = 10
@@ -58,14 +57,14 @@
 enable_manual_linking = false
 enable_signup = true
 enable_anonymous_sign_ins = false
-minimum_password_length = 6
+minimum_password_length = 10
 password_requirements = ""
 [auth.hook]
 [auth.mfa]
 max_enrolled_factors = 10
 [auth.mfa.totp]
-enroll_enabled = false
-verify_enabled = false
+enroll_enabled = true
+verify_enabled = true
 [auth.mfa.phone]
 enroll_enabled = false
 verify_enabled = false
@@ -81,9 +80,9 @@
 [auth.email]
 enable_signup = true
 double_confirm_changes = true
-enable_confirmations = false
+enable_confirmations = true
 secure_password_change = false
-max_frequency = "1s"
+max_frequency = "1m0s"
 otp_length = 6
 otp_expiry = 3600
 [auth.email.template]
@@ -90,7 +89,7 @@
 [auth.sms]
 enable_signup = false
 enable_confirmations = false
-template = "Your code is {{ .Code }} ."
+template = "Your code is {{ .Code }}"
 max_frequency = "5s"
 [auth.sms.twilio]
 enabled = false

The version of the supabase CLI that I am using is v2.6.8

Hello, sorry for the late reply.

I would do this myself, but I am currently on the free account and I already have the max of 2 projects.

If this happens on a free project, I suspect the error is due to your preview project being paused after 7 days of inactivity. We added some validations in recent CLI versions to make sure that projects are in active healthy state before you can link.

Since we don’t expose an API to resume your project, the only way is to resume manually from the dashboard. If you want to keep your projects running, you can either send some requests periodically or as I would shamelessly recommend, upgrade to Pro.

You will also get more features, resources, and support on all your projects when you switch to Pro plan, including

  • Branching
  • Daily backups
  • 7-day log retention
  • No project pausing
  • Email support

Hi @CalvinWilkinson, to help me narrow down the issue, could you try setting the access token via env var instead?

      - name: Link to Supabase Project
        env:
          SUPABASE_ACCESS_TOKEN: "${{ inputs.release-type == 'Preview' && secrets.EA_SUPA_PAT_STANDARD_PREV || secrets.EA_SUPA_PAT_STANDARD_PROD }}"
          SUPABASE_DB_PASSWORD: "${{ inputs.release-type == 'Preview' && secrets.EA_SUPA_DB_PASS_PREV || secrets.EA_SUPA_DB_PASS_PROD }}"
        run: |
          $projRefId = "${{ inputs.release-type == 'Preview' && vars.EA_SUPA_PROJ_REF_ID_PREV || vars.EA_SUPA_PROJ_REF_ID_PROD }}"
          supabase link --project-ref "$projRefId"

You can also remove the login step before this.