setup-cli icon indicating copy to clipboard operation
setup-cli copied to clipboard

cli fails in self-hosted github action runner

Open Jayllyz opened this issue 1 year ago • 7 comments

Describe the bug supabase db push not ending correctly in github actions v23.10 (self-hosted ubuntu vps runner)

To Reproduce Steps to reproduce the behavior:

env:
  SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
  SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
  SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_PASSWORD }}
  
...

  - if: github.ref == 'refs/heads/main'
    name: Setup Supabase CLI
    uses: supabase/setup-cli@v1
    with:
      version: latest

  - if: github.ref == 'refs/heads/main'
    name: Deploy migrations
    run: 
      |
      supabase link --project-ref ${{ env.SUPABASE_PROJECT_ID }}
      supabase db push -p ${{ env.SUPABASE_DB_PASSWORD }}

Expected behavior A clear and concise description of what you expected to happen.

Return success exit code

Screenshots image

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

  • Ticket ID: [e.g. ab1ac733e31e4f928a4d7c8402543712]
  • Version of OS: Ubuntu v23.10
  • Version of CLI: 1.167.4
  • Version of Docker: [e.g. v25.0.3]
  • Versions of services: [output from supabase services command]

Additional context If applicable, add any other context about the problem here.

  • Browser [e.g. chrome, safari]
  • Version of supabase-js [e.g. v2.22.0]
  • Version of Node.js 22

Jayllyz avatar May 20 '24 20:05 Jayllyz

The link and push commands seem to have succeeded based on your logs. You can verify by adding echo $? to the run step, for eg.

    run: |
      supabase link --project-ref ${{ env.SUPABASE_PROJECT_ID }}
      supabase db push -p ${{ env.SUPABASE_DB_PASSWORD }}
      echo $?

Are you able to check the output of 7c5ad7cb-...f46e.sh? Perhaps the error originated from line 2 of that file: X4T: command not found.

sweatybridge avatar May 21 '24 12:05 sweatybridge

I tried to check before creating my issue what was in this bash file, but as it's in a temporary folder, when the action finishes, it's deleted.

Yes, the command looks to be successful.

Raw logs with echo $? added:

2024-05-21T12:50:32.9819523Z shell: /usr/bin/bash -e {0}
2024-05-21T12:50:32.9820012Z env:
2024-05-21T12:50:32.9820491Z   SUPABASE_PROJECT_ID: ***
2024-05-21T12:50:32.9821228Z   SUPABASE_ACCESS_TOKEN: ***
2024-05-21T12:50:32.9821776Z   SUPABASE_DB_PASSWORD: ***
2024-05-21T12:50:32.9822705Z   PNPM_HOME: /home/jayllyz/setup-pnpm/node_modules/.bin
2024-05-21T12:50:32.9823432Z   SUPABASE_INTERNAL_IMAGE_REGISTRY: ghcr.io
2024-05-21T12:50:32.9824112Z ##[endgroup]
2024-05-21T12:50:33.5064049Z Connecting to remote database...
2024-05-21T12:50:33.8197391Z Failed to save database password: failed to set credentials: The name org.freedesktop.secrets was not provided by any .service files
2024-05-21T12:50:33.8199704Z Finished supabase link.
2024-05-21T12:50:33.8254893Z /home/jayllyz/github/actions-runner/_work/_temp/57d66976-2d57-4bc7-ab93-618cbec0e12c.sh: line 2: X4T: command not found
2024-05-21T12:50:33.8848769Z Connecting to remote database...
2024-05-21T12:50:34.1538417Z Remote database is up to date.
2024-05-21T12:50:34.1582786Z ##[error]Process completed with exit code 127.

Jayllyz avatar May 21 '24 13:05 Jayllyz

Having the same issue. Any updates on this yet?

jasurabdullin avatar Jun 18 '24 17:06 jasurabdullin

@jasurabdullin can you run the following in your self-hosted runner and report the logs? Remember to redact any sensitive information.

    run: |
      set -x
      supabase link --project-ref ${{ env.SUPABASE_PROJECT_ID }}
      supabase db push -p ${{ env.SUPABASE_DB_PASSWORD }}
      echo "exit code: $?"

sweatybridge avatar Jun 19 '24 06:06 sweatybridge

removed password ofc this

Failure also occurs when some migrations need to be pushed:

image

The migrations are being pushed successfully, so I'm using continue-on-error: true as a workaround for now.

Jayllyz avatar Jun 19 '24 07:06 Jayllyz

As shown on line 18, something on your runner is trying to execute X4T. I don't know what that program is but it seems like something added by action runner itself and not supabase cli.

Can you try separate run steps to see if it works?

    - run: supabase link --project-ref ${{ env.SUPABASE_PROJECT_ID }}
    - run: supabase db push -p ${{ env.SUPABASE_DB_PASSWORD }}

sweatybridge avatar Jun 19 '24 08:06 sweatybridge

As shown on line 18, something on your runner is trying to execute X4T. I don't know what that program is but it seems like something added by action runner itself and not supabase cli.

Can you try separate run steps to see if it works?

    - run: supabase link --project-ref ${{ env.SUPABASE_PROJECT_ID }}
    - run: supabase db push -p ${{ env.SUPABASE_DB_PASSWORD }}

Same results, X4T is being executed right before supabase db push then fail with exit code 127. link exit with exit code 0.

Jayllyz avatar Jun 19 '24 08:06 Jayllyz