Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Hi, were experiencing failures to setup PHP versions 8.0 and 8.2 using this action on self-hosted runners.
The error appears to be:
E: Conflicting values set for option Signed-By regarding source https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy: /usr/share/keyrings/ondrej-php-keyring.gpg !=
E: The list of sources could not be read.
Version
- v2
- v1
Runners
Self Hosted
Operating systems
Ubuntu 22.04
PHP versions
PHP 8.0, PHP 8.2
To Reproduce
name: Test PHP
on:
workflow_call:
jobs:
test:
name: Automated Testing
runs-on: "self-hosted"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: 8.2
coverage: none
env:
runner: self-hostedExpected behavior
The PHP versions specified should be installed and next steps execute.
Screenshots/Logs
==> Setup PHP
ID=ubuntu
VERSION_ID=22.04
VERSION_CODENAME=jammy
deb [arch=amd64 signed-by=/usr/share/keyrings/ondrej-php-keyring.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main
Hit:1 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Reading package lists...
E: Conflicting values set for option Signed-By regarding source https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy: /usr/share/keyrings/ondrej-php-keyring.gpg !=
E: The list of sources could not be read.
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [4387 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2944 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1245 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [[127](https://github.com/Gear4music/backend-app-purchase-analytic-forecasting/actions/runs/15137815435/job/42553724320#step:4:128) kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [3255 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1547 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [4540 kB]
Fetched 18.3 MB in 2s (9578 kB/s)
Reading package lists...
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Conflicting values set for option Signed-By regarding source https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy: /usr/share/keyrings/ondrej-php-keyring.gpg !=
E: The list of sources could not be read.
E: Conflicting values set for option Signed-By regarding source https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy: /usr/share/keyrings/ondrej-php-keyring.gpg !=
E: The list of sources could not be read.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Conflicting values set for option Signed-By regarding source https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy: /usr/share/keyrings/ondrej-php-keyring.gpg !=
E: The list of sources could not be read.
β xml Enabled
β php-config Added php-config
β PECL Added PECL 1.10.16
β PHP Could not setup PHP 8.2
Error: The process '/usr/bin/bash' failed with exit code 1
Additional context
No response
Are you willing to submit a PR?
Yes
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
shivammathur commentedon May 20, 2025
@davgothic
Please run the following command to check the source files you have for the PPA.
grep -R "ondrej/php" /etc/apt/sources.list.d/It should show multiple files as per the error.
Keep the file that has the signed by clause. it should be this one
/etc/apt/sources.list.d/ondrej-php.list,Remove the rest of the list files shown by the
grepcommands and runapt-get updateafterwards.davgothic commentedon May 21, 2025
Hi @shivammathur,
Thanks for your response. I've ran the grep and I see the following output on the PHP 8.0 and 8.2 runs:
However for the other versions of PHP (e.g 7.4, 8.1, 8.3, 8.4) I see:
The image we run on the runner container has this in the build:
RUN add-apt-repository ppa:ondrej/php -yDo you recommend we do something different?
The
/etc/apt/sources.list.d/ondrej-php.listfile only appears during theshivammathur/setup-php@v2step and only for 8.0 and 8.2, before that only the/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.listfile exists.shivammathur commentedon May 21, 2025
@davgothic
If you use the image only for CI and not for deployment/local development, I would recommend removing this line and running CI on a image build without it.
RUN add-apt-repository ppa:ondrej/php -yOtherwise, please wait till the next release, I will try to fix the conflicting files issue in that.
davgothic commentedon May 23, 2025
Thanks for the update. We'll look into changing our build for now and hopefully it's not too difficult to fix going forward.
shivammathur commentedon Jun 10, 2025
Fixed in 2.34.0.
Sn0wCrack commentedon Oct 20, 2025
This bug now re-occurs on Ubuntu 24.04 and above due to
add-apt-repositoryusing the new deb822 format, so the file extension is now.sourcesrather than.list. So the code for checking if the repository has already been added misses this.I believe it should be sufficient to use
add-apt-repository --listto check all added repositories and simply just grep forondrej/phpor similar.