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

curl command not found #76

Closed
WybeBaT opened this issue Jan 26, 2022 · 3 comments
Closed

curl command not found #76

WybeBaT opened this issue Jan 26, 2022 · 3 comments

Comments

@WybeBaT
Copy link

WybeBaT commented Jan 26, 2022

I'm trying to use composer@v2 to install dependencies, however I get an error saying the curl command is not found

/__w/_temp/2236824c-0115-4211-aa6e-f45dbd70b342.sh: line 1: curl: command not found

I also ran into #61, which I worked around with the "Touch output file (temporary fix)" step.

Below is my workflow file, commented lines are things that I've tried to fix the issue:

name: Build Workflow

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  workflow_dispatch:

jobs:
  php-stan:
    name: PHPStan
    runs-on: self-hosted
    container:
      image: ubuntu:20.04
      options: --rm

    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Touch output file (temporary fix)
        run: |
          mkdir -p /home/github-runner/github/actions-runner/_work/MyProject/MyProject
          touch /home/github-runner/github/actions-runner/_work/MyProject/MyProject/output.log

#      - name: Setup PHP 8
#        uses: shivammathur/setup-php@v2
#        env:
#          runner: self-hosted
#        with:
#          php-version: '8.0'
#          extensions: curl

#      - name: Install curl
#        run: apt-get install -y curl

      - name: Set up Composer
        uses: php-actions/composer@v6
        with:
          php_version: 8.0
#          php_extensions: curl
          version: 2

      - name: Set up and run PHPStan
        uses: php-actions/phpstan@v3
        with:
          path: src/
          level: 8

If I comment out the composer action, the PHPStan action gives me the same curl: command not found* error

EDIT:
The Install curl step above didn't work because I needed to do apt-get update first:

      - name: Install curl
        run: |
          apt-get update
          apt-get install -y curl

However, the composer package still doesn't work. It returns 1 and gives an empty Debug Output:

Debug output
Error: Process completed with exit code 1.

And just to be complete: When I manually install curl and composer. The @php-actions/phpstan action fails, with the same returns 1 and empty Debug Output as above.

EDIT 2:
I decided to save the output.log as artifact after the phpstan action. Inside it, I get the following error:

Running php-build phpstan
/dev/fd/63: line 53: docker: command not found
@g105b
Copy link
Member

g105b commented Jan 27, 2022

Hi @WybeBaT ,

In the next couple of days I'll recreate your settings in the example-composer repository to see if I can replicate the issues.

One thing I have noticed, but I doubt would cause the issue, is that php_version: 8.0 should be quoted, like this: php_version: '8.0'. It's something I learnt recently (I hate YAML).

@WybeBaT
Copy link
Author

WybeBaT commented Jan 31, 2022

Hi @WybeBaT ,

In the next couple of days I'll recreate your settings in the example-composer repository to see if I can replicate the issues.

One thing I have noticed, but I doubt would cause the issue, is that php_version: 8.0 should be quoted, like this: php_version: '8.0'. It's something I learnt recently (I hate YAML).

Thanks a lot for looking into it. Good catch on the php_version: '8.0' correction, to prevent confusion though, I had the same issue before I added that line.

@g105b
Copy link
Member

g105b commented Feb 5, 2022

@WybeBaT I'm struggling to replicate the issue you're sharing. I have an example-composer repository for testing in. Do you think you could help me replicate the issue there by creating a new workflow that matches yours as closely as possible?

The only thoughts I've had so far are that your action is running on a self-hosted image... why that would prevent curl from being available, I don't know, but it's worth starting the investigation there.

I'd like to resolve this with you if you are willing and able to spend a few minutes with me.

Thanks,
Greg.

@g105b g105b closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants