Closed Jamesking56 closed 2 years ago
Just turned off my self-hosted runner and it appears to work fine with GitHub's hosted runners.
I did notice though that the patch version of PHP 8.0 has been upgraded tonight in my runner, which may explain what has happened:
GitHub Hosted Runners: PHP 8.0.15 My Runner: PHP 8.0.16
Is there a way you can verify that the issue is potentially caused by PHP 8.0.16?
@Jamesking56, I will try to fix this situation in the next release, can you try installing php8.0-dev
on your runner and run setup-php
again.
sudo apt-get install -y php8.0-dev
@shivammathur That was one of the first things I tried to debug and the same errors occur
@Jamesking56 ok, what is the output when you run
ls -la /usr/bin/php-config*
@shivammathur
lrwxrwxrwx 1 root root 28 Feb 25 21:34 /usr/bin/php-config -> /etc/alternatives/php-config
-rwxr-xr-x 1 root root 4409 Feb 21 14:42 /usr/bin/php-config8.0
@shivammathur Just re-ran the workflow to see what happens and this is the output now:
Run shivammathur/setup-php@2.17.0
with:
php-version: 8
tools: cs2pr
ini-file: production
env:
runner: self-hosted
/bin/bash /opt/actions-runner/1/_work/_actions/shivammathur/setup-php/2.17.0/src/scripts/run.sh
==> Setup PHP
chmod: cannot operate on dangling symlink '/etc/php/8.0/cli/conf.d/99-pecl.ini'
✓ PHP Found PHP 8.0.16
==> Setup Tools
✗ composer Could not download composer
Composer 2.2.7 already exists in my runner
Please remove /etc/php/8.0/cli/conf.d/99-pecl.ini
.
Not sure why this is a symlink. It should be an ini file that is symlinked in other SAPI.
Also, make sure you have set up passwordless-sudo. https://github.com/shivammathur/setup-php/wiki/Requirements-for-self-hosted-runners#linuxwsl
Then, can you try running with shivammathur/setup-php@verbose
and provide me the logs.
@shivammathur Thanks for your help investigating this.
Passwordless sudo is already setup on my runner.
I've just run the verbose tag of your action and this is the output:
Run shivammathur/setup-php@verbose
/bin/bash /opt/actions-runner/1/_work/_actions/shivammathur/setup-php/verbose/src/scripts/run.sh
Reading package lists...
Building dependency tree...
Reading state information...
autoconf is already the newest version (2.69-11.1).
automake is already the newest version (1:1.16.1-4ubuntu6).
file is already the newest version (1:5.38-4).
g++ is already the newest version (4:9.3.0-1ubuntu2).
gcc is already the newest version (4:9.3.0-1ubuntu2).
make is already the newest version (4.2.1-1.2).
unzip is already the newest version (6.0-25ubuntu1).
ca-certificates is already the newest version (20210119~20.04.2).
curl is already the newest version (7.68.0-1ubuntu2.7).
gnupg is already the newest version (2.2.19-3ubuntu2.1).
apt-transport-https is already the newest version (2.0.6).
jq is already the newest version (1.6-1ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
==> Setup PHP
date.timezone=UTC
memory_limit=-1
opcache.enable=1
opcache.jit_buffer_size=256M
opcache.jit=1235
xdebug.mode=coverage
✓ PHP Found PHP 8.0.16
==> Setup Tools
✗ composer Could not download composer
Your PHP setup seems to be working now. Whenever you have some time, I added more logging to the verbose tag, please restart your workflow with it and provide me the logs.
@shivammathur Run again and this is the log:
Thanks
what is the output when you run this with sudo and without sudo
php -r "try {\$p=new Phar('/usr/local/bin/composer.phar', 0);exit(0);} catch(Exception \$e) {exit(1);}"
echo $?
sudo php -r "try {\$p=new Phar('/usr/local/bin/composer.phar', 0);exit(0);} catch(Exception \$e) {exit(1);}"
echo $?
@shivammathur These both output exit code 0
I'm not sure why checking the composer phar fails in the action and works when you run the command. Does your runner run with a different user?
If you can reproduce this in a dockerized self-hosted runner. I can have a look.
Seems we're having the same trouble(but with v7.4);
check_suite_focus=true#step:3:2)
with:
php-version: 7.[4]
coverage: pcov
extensions: mbstring, phpredis/phpredis, php-curl, soap
tools: composer:v2
ini-file: production
env:
runner: self-hosted
/usr/bin/bash /opt/actions-runner/_work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh
==> Setup PHP
grep: : No such file or directory
grep: : No such file or directory
/opt/actions-runner/_work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/unix.sh: line 170: php_config: parameter null or not set
✓ PHP Switched to PHP
==> Setup Extensions
✓ mbstring Installed and enabled
/opt/actions-runner/_work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line semver: parameter null or not set
Error: The process '/usr/bin/bash' failed with exit code 1
The issues appeared suddenly as well, however it seems to be intermittent? If we re-run the workflows a few times we'll eventually get a good result, every other time we just get what i've included above.
Couldn't really see a solution from the thread above, @shivammathur please let me know if there's any known fix/workaround and i'll try it out! 👍
@thewoods96
There is a fix in the develop
branch. Please wait for the next release. I plan to do that tomorrow.
or you can run this and that should also fix it.
sudo apt-get install -y php7.4-dev
Fantastic, I'll keep an eye out and let you know if there's any further issues. Thanks for the fix and quick response 🚀
@thewoods96
Sorry for the delay. Released 2.18.0
with the fix.
Yepp can confirm that i'm no longer seeing the same issues. Thanks again!
Describe the bug
My actions workflow on a self-hosted runner has started spitting out new pecl errors all of a sudden in PHP 8.0
Version
v1
orv2
.v2
v1
Runners
Operating systems
Ubuntu 20.04 LTS
PHP versions
PHP 8.0
To Reproduce
Expected behavior
It was working before as normal, setting up PHP 8.0.
Screenshots/Logs
Additional context
Are you willing to submit a PR?
Honestly right now have no idea of a fix