shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.93k stars 348 forks source link

Could not install phalcon5 #875

Open bucchi-kitamura opened 1 month ago

bucchi-kitamura commented 1 month ago

Describe the bug Hello!

I can no longer install phalcon with GitHub Actions. Do you know what the problem is?

The problem occurred at 08:00 Japan time on 2024-10-07.

Expected behavior I want to be able to install phalcon.

Screenshots/Logs

When you fail

This may not be relevant, but I will list the Ubuntu version

##[debug]Starting: Set up job
Current runner version: '[2](https://github.com/project/actions/runs/11382913300/job/31888204866#step:1:2).320.0'
Operating System
  Ubuntu
  22.04.5
  LTS
Runner Image
  Image: ubuntu-22.04
  Version: 20241015.1.0
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241015.1/images/ubuntu/Ubuntu2204-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241015.1
Runner Image Provisioner
  2.0.[3](https://github.com/project/actions/runs/11382913300/job/31888204866#step:1:3)84.1
setup-php logs Error: Process '/usr/bin/bash' failed with exit code null. The above error occurred. ``` ##[debug]Evaluating condition for step: 'Setup PHP, with composer and extensions' ##[debug]Evaluating: success() ##[debug]Evaluating success: ##[debug]=> true ##[debug]Result: true ##[debug]Starting: Setup PHP, with composer and extensions ##[debug]Loading inputs ##[debug]Evaluating: matrix.php-versions ##[debug]Evaluating Index: ##[debug]..Evaluating matrix: ##[debug]..=> Object ##[debug]..Evaluating String: ##[debug]..=> 'php-versions' ##[debug]=> '8.1' ##[debug]Result: '8.1' ##[debug]Evaluating: env.extensions ##[debug]Evaluating Index: ##[debug]..Evaluating env: ##[debug]..=> Object ##[debug]..Evaluating String: ##[debug]..=> 'extensions' ##[debug]=> 'mbstring, dom, zip, phalcon5, psr, mysql' ##[debug]Result: 'mbstring, dom, zip, phalcon5, psr, mysql' ##[debug]Loading env Run shivammathur/setup-php@v[2](https://github.com/project/actions/runs/11382913300/job/31888204866#step:7:2) with: php-version: 8.1 extensions: mbstring, dom, zip, phalcon5, psr, mysql ini-file: production env: extensions: mbstring, dom, zip, phalcon5, psr, mysql php-cache-key: php-cache-v1 require-deploy: false BRANCH_NAME: github-actions update: true /usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh ==> Setup PHP ✓ PHP Updated to PHP 8.1.[3](https://github.com/project/actions/runs/11382913300/job/31888204866#step:7:3)0 ==> Setup Extensions ✓ mbstring Enabled ✓ dom Enabled ✓ zip Enabled Error: The process '/usr/bin/bash' failed with exit code null ##[debug]Node Action run completed with exit code 1 ##[debug]Set output php-version = [8](https://github.com/project/actions/runs/11382913300/job/31888204866#step:7:8).1.30 ##[debug]Finishing: Setup PHP, with composer and extensions ```

When we were successful

Current runner version: '2.319.1'
Operating System
  Ubuntu
  22.04.5
  LTS
Runner Image
  Image: ubuntu-22.04
  Version: 20240922.1.0
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240922.1/images/ubuntu/Ubuntu2204-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240922.1
Runner Image Provisioner
  2.0.384.1
setup-php logs ``` Run shivammathur/setup-php@v2 with: php-version: 8.1 extensions: mbstring, dom, zip, phalcon5, psr, mysql ini-file: production env: extensions: mbstring, dom, zip, phalcon5, psr, mysql php-cache-key: php-cache-v1 require-deploy: false BRANCH_NAME: main update: true /usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh ==> Setup PHP ✓ PHP Updated to PHP 8.1.30 ==> Setup Extensions ✓ mbstring Enabled ✓ dom Enabled ✓ zip Enabled ✓ phalcon Enabled ✓ psr Enabled ✓ mysql Enabled ==> Setup Tools ✓ composer Added composer 2.8.1 ==> Sponsor setup-php ✓ setup-php https://setup-php.com/sponsor ```

Version

Runners

Operating systems

PHP versions

To Reproduce

jobs:
  build-deploy:
    name: Build-Deploy
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-versions: ['8.1']
    env:
      extensions: mbstring, dom, zip, phalcon5, psr, mysql

      - name: Setup PHP, with composer and extensions
        uses: shivammathur/setup-php@v2
        env:
          update: true
        with:
          php-version: ${{ matrix.php-versions }}
          extensions: ${{ env.extensions }}

Additional context https://github.blog/changelog/2024-09-25-actions-new-images-and-ubuntu-latest-changes/

I tried it because there was a difference in the ubuntu version. The result did not change.

Are you willing to submit a PR?

shivammathur commented 1 month ago

@bucchi-kitamura

I could not reproduce the issue, please try running your workflow again. If you still facing this issue, please run the workflow with shivammathur/setup-php@verbose instead of v2 and provide me the logs.

Test: https://github.com/shivammathur/test-setup-php/actions/runs/11472670438/workflow

bucchi-kitamura commented 1 month ago

@shivammathur

Thanks for doing the research.

Test: https://github.com/shivammathur/test-setup-php/actions/runs/11472670438/workflow

CleanShot 0006-10-23 at 17 18 11@2x

Comparing Test with my workflow, I noticed that my workflow uses cache. I tried it without using cache and it was successful.

Successful log ``` Run shivammathur/setup-php@verbose with: php-version: 8.1 extensions: mbstring, dom, zip, phalcon5, psr, mysql ini-file: production env: extensions: mbstring, dom, zip, phalcon5, psr, mysql require-deploy: false BRANCH_NAME: github-actions update: true fail-fast: true /usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/verbose/src/scripts/run.sh ==> Setup PHP update-alternatives: using /usr/sbin/php-fpm8.1 to provide /usr/sbin/php-fpm (php-fpm) in auto mode Reading package lists... Building dependency tree... Reading state information... ; priority=25 extension=redis.so production date.timezone=UTC memory_limit=-1 xdebug.mode=coverage opcache.enable=1 opcache.jit_buffer_size=256M opcache.jit=1235 php-version=8.1.30 ✓ PHP Updated to PHP 8.1.30 ==> Setup Extensions ✓ mbstring Enabled ✓ dom Enabled ✓ zip Enabled ID=ubuntu VERSION_ID=22.04 VERSION_CODENAME=jammy deb [arch=amd64 signed-by=/usr/share/keyrings/ondrej-php-keyring.gpg] http://ppa.launchpad.net/ondrej/php/ubuntu jammy main Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease [24.6 kB] Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu jammy/main amd64 Packages [134 kB] Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu jammy/main Translation-en [42.1 kB] Fetched 201 kB in 1s (299 kB/s) Reading package lists... force-confnew [apt-fast 08:03:37] [apt-fast 08:03:37]Working... this may take a while. [apt-fast 08:03:37] (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 267259 files and directories currently installed.) Preparing to unpack .../php8.1-phalcon_5.8.0-6+ubuntu22.04.1+deb.sury.org+1_amd64.deb ... Unpacking php8.1-phalcon (5.8.0-6+ubuntu22.04.1+deb.sury.org+1) ... Selecting previously unselected package php8.1-phalcon5. Preparing to unpack .../php8.1-phalcon5_5.8.0-5+ubuntu22.04.1+deb.sury.org+1_all.deb ... Unpacking php8.1-phalcon5 (5.8.0-5+ubuntu22.04.1+deb.sury.org+1) ... Setting up php8.1-phalcon (5.8.0-6+ubuntu22.04.1+deb.sury.org+1) ... Setting up php8.1-phalcon5 (5.8.0-5+ubuntu22.04.1+deb.sury.org+1) ... Processing triggers for php8.1-phpdbg (8.1.30-1+ubuntu22.04.1+deb.sury.org+1) ... Processing triggers for php8.1-cgi (8.1.30-1+ubuntu22.04.1+deb.sury.org+1) ... Processing triggers for libphp8.1-embed (8.1.30-1+ubuntu22.04.1+deb.sury.org+1) ... Processing triggers for php8.1-cli (8.1.30-1+ubuntu22.04.1+deb.sury.org+1) ... Processing triggers for php8.1-fpm (8.1.30-1+ubuntu22.04.1+deb.sury.org+1) ... NOTICE: Not enabling PHP 8.1 FPM by default. NOTICE: To enable PHP 8.1 FPM in Apache2 do: NOTICE: a2enmod proxy_fcgi setenvif NOTICE: a2enconf php8.1-fpm NOTICE: You are seeing this message because you have apache2 package installed. NEEDRESTART-VER: 3.5 NEEDRESTART-KCUR: 6.5.0-1025-azure NEEDRESTART-KEXP: 6.5.0-1025-azure NEEDRESTART-KSTA: 1 NEEDRESTART-SVC: irqbalance.service NEEDRESTART-SVC: networkd-dispatcher.service ✓ phalcon Installed and enabled ✓ psr Enabled ✓ mysql Enabled ==> Setup Tools /home/runner/.composer/vendor/bin ✓ composer Added composer 2.8.1 ==> Sponsor setup-php ✓ setup-php https://setup-php.com/sponsor ```

I changed the workflow to not perform the following tasks and was successful

      - name: Setup cache environment
        id: cache-env
        uses: shivammathur/cache-extensions@v1
        with:
          php-version: ${{ matrix.php-versions }}
          extensions: ${{ env.extensions }}
          key: ${{ env.php-cache-key }}

      - name: Cache extensions
        uses: actions/cache@v4
        with:
          path: ${{ steps.cache-env.outputs.dir }}
          key: ${{ steps.cache-env.outputs.key }}
          restore-keys: ${{ steps.cache-env.outputs.key }}

https://github.com/shivammathur/cache-extensions

Is it possible that phalcon is not cached on our end? I don't know the details, so sorry if I'm pointing out the wrong thing.

cache-extensions logs Changing the cache key name did not change the result ``` Run shivammathur/cache-extensions@v1 with: php-version: 8.1 extensions: mbstring, dom, zip, phalcon5, psr, mysql key: php-cache-v1 env: extensions: mbstring, dom, zip, phalcon5, psr, mysql php-cache-key: php-cache-v1 require-deploy: false BRANCH_NAME: github-actions /usr/bin/bash /home/runner/work/_actions/shivammathur/cache-extensions/v1/src/scripts/cache.sh data mbstring, dom, zip, phalcon5, psr, mysql 8.1 php-cache-v1 Cache Size: ~0 MB (13116 B) /usr/bin/tar -xf /home/runner/work/_temp/74cd9273-30ef-41cf-a699-a1fd05eaec8e/cache.tzst -P -C /home/runner/work/project --use-compress-program unzstd Cache restored successfully /usr/bin/bash /home/runner/work/_actions/shivammathur/cache-extensions/v1/src/scripts/cache.sh dependencies mbstring, dom, zip, phalcon5, psr, mysql 8.1 Received 13116 of 13116 (100.0%), 0.0 MBs/sec ==> Setup extensions ✓ phalcon Added phalcon ```
bucchi-kitamura commented 1 month ago

The system didn't slow down much even without using the cache, so I'm starting to think it might be okay to choose not to use it.