You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RingdownCurlHttpClient declares hosts as "unavailable" if they give a response with a status code >= 400, or if something else goes entirely wrong, i.e. the inner client throws an HttpException.
This is fine, as long as only one phar to install is given.
It becomes an issue, as soon as one wants to install multiple phars at once on a fresh system and the first phar has its key stored on keyserver.ubuntu.com exclusively and the next phar has its key exclusively stored on keys.openpgp.org.
Phive will try to get the first key from keys.openpgp.org but will get a 404 status code and then declare keys.openpgp.org as unavailable, thus removing it from its internal host list. It will then succeed in fetching the key from keyserver.ubuntu.com.
When trying to download the key for the next phar, phive never tries to fetch the key from keys.openpgp.org, but only from keyserver.ubuntu.com, which fails, as it doesn't exist.
Steps to reproduce
For the reproduction, I used the official docker image, which uses phive in version 0.15.2, but I also verified it with our internal docker images, which use phive in version 0.15.3. I can't share them publicly, though.
Create a new directory and install php-cs-fixer and phpstan with phive
$ docker run -it --rm -v `pwd`:/repo phario/phive:0.15.2 install --trust-gpg-keys E82B2FB314E9906E,51C67305FFC2E5C0
Phive 0.15.2-8-g05a4851 - Copyright (C) 2015-2025 by Arne Blankerts, Sebastian Heuer and Contributors
Fetching repository list
Downloading https://phar.io/data/repositories.xml
Downloading https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/releases?per_page=100
Downloading https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.62.0/php-cs-fixer.phar
Downloading https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.62.0/php-cs-fixer.phar.asc
Downloading key E82B2FB314E9906E
Trying to connect to keys.openpgp.org (37.218.245.50)
Downloading https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0xE82B2FB314E9906E
Trying to connect to keys.openpgp.org (2a00:c6c0::154:1:0:0:1)
[ERROR] Request failed: (while requesting https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0xE82B2FB314E9906E)
[WARNING] Failed with error code 404: Key not found on keyserver
Trying to connect to keyserver.ubuntu.com (185.125.188.26)
Successfully downloaded key.
Fingerprint: BBAB 5DF0 A0D6 6729 89CF 1869 E82B 2FB3 14E9 906E
Dariusz Ruminski <[email protected]>
Created: 2015-01-17
Copying php-cs-fixer-3.62.0.phar to /repo/tools/php-cs-fixer
Downloading https://github.com/phpstan/phpstan/releases/download/2.1.2/phpstan.phar
Downloading https://github.com/phpstan/phpstan/releases/download/2.1.2/phpstan.phar.asc
Downloading key 51C67305FFC2E5C0
[WARNING] Failed with error code 0: No mirror yielded any result. Giving up.
Trying to connect to keyserver.ubuntu.com (185.125.188.26)
Downloading https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0x51C67305FFC2E5C0
Trying to connect to keyserver.ubuntu.com (185.125.188.27)
Downloading https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0x51C67305FFC2E5C0
Trying to connect to keyserver.ubuntu.com (2620:2d:4000:1007::d43)
[ERROR] Request failed: (while requesting https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0x51C67305FFC2E5C0)
Trying to connect to keyserver.ubuntu.com (2620:2d:4000:1007::70c)
[ERROR] Request failed: (while requesting https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0x51C67305FFC2E5C0)
[WARNING] Failed with error code 404: Key not found on keyserver
Trying to connect to pgp.mit.edu (18.9.60.141)
Downloading https://pgp.mit.edu/pks/lookup?op=get&options=mr&search=0x51C67305FFC2E5C0
[WARNING] Failed with error code 502: Server reported an error
[ERROR] PublicKey 51C67305FFC2E5C0 not found on key servers
Although I used phive with its --trust-gpg-keys option, the issue persists without the option as well.
The text was updated successfully, but these errors were encountered:
Summary
The
RingdownCurlHttpClient
declares hosts as "unavailable" if they give a response with a status code >= 400, or if something else goes entirely wrong, i.e. the inner client throws anHttpException
.This is fine, as long as only one phar to install is given.
It becomes an issue, as soon as one wants to install multiple phars at once on a fresh system and the first phar has its key stored on
keyserver.ubuntu.com
exclusively and the next phar has its key exclusively stored onkeys.openpgp.org
.Phive will try to get the first key from
keys.openpgp.org
but will get a 404 status code and then declarekeys.openpgp.org
as unavailable, thus removing it from its internal host list. It will then succeed in fetching the key fromkeyserver.ubuntu.com
.When trying to download the key for the next phar, phive never tries to fetch the key from
keys.openpgp.org
, but only fromkeyserver.ubuntu.com
, which fails, as it doesn't exist.Steps to reproduce
For the reproduction, I used the official docker image, which uses phive in version 0.15.2, but I also verified it with our internal docker images, which use phive in version 0.15.3. I can't share them publicly, though.
php-cs-fixer
andphpstan
with phivetools
directorydocker run -it --rm -v
pwd:/repo phario/phive:0.15.2 install --trust-gpg-keys E82B2FB314E9906E,51C67305FFC2E5C0
Output of the docker command:
Although I used phive with its
--trust-gpg-keys
option, the issue persists without the option as well.The text was updated successfully, but these errors were encountered: