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

cli fails in self-hosted github action runner #288

Open
Jayllyz opened this issue May 20, 2024 · 7 comments
Open

cli fails in self-hosted github action runner #288

Jayllyz opened this issue May 20, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@Jayllyz
Copy link

Jayllyz commented May 20, 2024

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
@sweatybridge
Copy link
Collaborator

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.

@Jayllyz
Copy link
Author

Jayllyz commented May 21, 2024

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.

@sweatybridge sweatybridge added the bug Something isn't working label Jun 11, 2024
@jasurabdullin
Copy link

Having the same issue. Any updates on this yet?

@sweatybridge sweatybridge changed the title cli fails in github actions cli fails in self-hosted github action runner Jun 19, 2024
@sweatybridge
Copy link
Collaborator

@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 sweatybridge transferred this issue from supabase/cli Jun 19, 2024
@Jayllyz
Copy link
Author

Jayllyz commented Jun 19, 2024

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.

@sweatybridge
Copy link
Collaborator

sweatybridge commented Jun 19, 2024

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 }}

@Jayllyz
Copy link
Author

Jayllyz commented Jun 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants