-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Automatic key import fails #260
Comments
This looks a bit like the same issue as #222 Looking at the code though, I don't see why that would happen. Unfortunately, I cannot reproduce this with composer-unused as I can't install the previous version. |
Same problem again, this time with
|
I guess the error can be forced by installing an older version of phan first, then the current version. |
I'll have a look over the weekend. |
sigh I can't reproduce this:
Okay, 2.6.1 installed. Now let's get a 2.7 release with trust-gpg-keys switch:
Works fine for me? What am I doing "wrong"? |
I'm of course using an interactive terminal here. Maybe that makes a difference? Even though I cannot see anything in the code that should... |
Weird. On my shell I can't reproduce it, too. Will evaluate in the ci-environment further, I will keep you informed. |
Hello, I am getting this on my Jenkins box - any news on this?
However my command is slightly different:
|
thinking on it this could also be the |
For security reasons, Since phive keeps everything in its private keyring, you have to do this externally - for instance by importing the key into the gpg keyring (stored by default in |
Ok, thats what i had previously:
which was throwing out
what is the best way to automate the installation of phars on build servers? sorry for the digression, not had any troubles with this until today.. |
Works for me? |
just manually ran this directly on our jenkins CLI:
|
That tries to install things from Can you paste that info? |
hmm it looks to me that the issue here is that php cs fixer needs updating form 2.16.4 to 2.18.2 running the install command causes the above error however manually running the update command then the install command via cli results in success. Via the automated build script though it is asking for key import auth:
Output:
is there not a way to auto update and install without interaction? phars.xml: <?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpcpd" version="^6.0.2" installed="6.0.3" location="./tools/phpcpd" copy="false"/>
<phar name="phpunit" version="^9.3.8" installed="9.5.2" location="./tools/phpunit" copy="false"/>
<phar name="php-cs-fixer" version="^2.16.4" installed="2.18.2" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^0.12.42" installed="0.12.42" location="./tools/phpstan" copy="false"/>
<phar name="phploc" version="^7.0.1" installed="7.0.1" location="./tools/phploc" copy="false"/>
<phar name="phpdox" version="^0.12.0" installed="0.12.0" location="./tools/phpdox" copy="false"/>
</phive> |
I'm not sure why you are running
Running It is expected behavior for |
Regarding the "no matching release found": Your paste is missing a crutial line ;) in the output:
The release of phpstan requested is not found. That's likely because it's quite old and we currently do not have paging support in the github api call (see #274 ) |
right I get it. For some reason my CLI output doesn't capture the downloading of phpstan prior to the no release found - makes sense. I need to capture the phars.xml and commit it into the repo and install the phars designated from there using makes sense - completely missed that.. |
Hello again.. Apologies for the long post. I still cannot get this to work and cannot get my builds working due to something around this issue. Below I have documented what I have done. I am 90% sure it is me doing something idiotic or miss understanding something... I appreciate any help anyone can give me as phive is the solution to other issues I have been having with composer and dependencies.. I have added phive.xml to my repo and on the server (as jenkins user)
I accepted all key imports. I then got the following error when trying to run
Checking the
Then in my build script i now only do <?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpcpd" version="^6.0.3" installed="6.0.3" location="./tools/phpcpd" copy="false"/>
<phar name="phpunit" version="^9.5.2" installed="9.5.2" location="./tools/phpunit" copy="false"/>
<phar name="php-cs-fixer" version="^2.18.2" installed="2.18.2" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpstan" version="^0.14.5" installed="0.14.5" location="./tools/phpstan" copy="false"/>
<phar name="phploc" version="^7.0.1" installed="7.0.1" location="./tools/phploc" copy="false"/>
<phar name="phpdox" version="^0.12.0" installed="0.12.0" location="./tools/phpdox" copy="false"/>
</phive> I am now getting (taken directly from jenkins log..)
I have tried removing the However when manually running the
I have also tried to |
Okay, I'm not sure how you ended up in this and whether or not it is still an issue. But I'll try to explain some things ;-) Firstly, While Having both is a problem and thus the warning you saw is shown. It should only happen if you manually install something without a Having a Where ever Any keys accepted when installing are imported into a Key handling in general has two conflicting requirements: While I do not want others to make the decision whether I do trust a signature and have a key auto-imported without my confirmation on my system, I very much do want to automate the decision in CI. To address this, we opted for adding a list of trusted keys to the CLI. I'm currently considering to add the key id to the The alternative is to manually import all the required public keys to phive's keyring in So, to sum things up, this is how it should work, assuming you delete
There is no need to run any other phive command on CI. |
I am also still experiencing problems with automatic key import under some circumstances - mainly when a phar author has changed his gpg key, und I call update in a CI environment. |
Hi, Thanks for the detailed response - I feel like its all coming together now.
Now when running the build on the build server, or just the
is there something I am not clearing out - cache maybe? I double checked the key on openpgp and it is found, it installs and works locally so seems to be a server instance issue only - but short of a complete wipe and reimage I cant see why and the debugging is limited. |
And in a moment of clarity (and double/triple checking your example) I found the issue.. (Typical after posting the previous comment).. note: No spaces between the keys, just a single comma. Pushed the above changes to build script repo and can confirm all is working as expected. Whilst this is entirely an issue with me not being able to read - is it worth perhaps removing any whitespace from each key in the list? Also may it not be prudent to make the list aspects of the comamnd the same across all commands? |
No, because that'll be ambiguous: Look at |
I guess this issue can be closed. If this was a wrong assumption, please leave a note. |
When calling
with phive 0.14.2, it asks for permission (which I can't give, since this is an automated build).
At first I thought this worked in phive 0.14, but looking at the WARNING I guess this is because of the key-change in composer-unused/composer-unused#81?
The text was updated successfully, but these errors were encountered: