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

Failed to retrieve project status #2956

Open
CalvinWilkinson opened this issue Dec 9, 2024 · 2 comments
Open

Failed to retrieve project status #2956

CalvinWilkinson opened this issue Dec 9, 2024 · 2 comments

Comments

@CalvinWilkinson
Copy link

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

@sweatybridge
Copy link
Contributor

sweatybridge commented Dec 11, 2024

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.

@CalvinWilkinson
Copy link
Author

@sweatybridge Thanks for the quick response!

I tried that this morning, and it did not work.

Here is my updated 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: 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";

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

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