Skip to content
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

Building container fails step 26/39 w/gpg: keyserver receive failed: No data #1

Closed
ElijahLynn opened this issue Feb 23, 2019 · 9 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ElijahLynn
Copy link
Contributor

This is the failed command, which works fine on my host but fails in the container build process, still investigating:

gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 1729F83938DA44E27BA0F4D3DBDB397470D12172

&& for key in $GPG_KEYS; do \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
done \

Step 26/39 : RUN set -xe     echo "jenkins ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers  && cd /usr/src  && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz  && echo "$PHP_SHA256
*php.tar.xz" | sha256sum -c -   && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc  && export GNUPGHOME="$(mktemp -d)"      && for key in $GPG_KEYS; do             gpg -
-keyserver ha.pool.sks-keyservers.net --recv-keys "$key";       done    && gpg --batch --verify php.tar.xz.asc php.tar.xz       && rm -r "$GNUPGHOME"                                                               
 ---> Running in 25b9971b31a7
+ cd /usr/src
+ curl -fSL https://secure.php.net/get/php-7.2.4.tar.xz/from/this/mirror -o php.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     1    0     1    0     0      1      0 --:--:-- --:--:-- --:--:--     1
100   185  100   185    0     0    113      0  0:00:01  0:00:01 --:--:--   249
100 11.4M    0 11.4M    0     0  2636k      0 --:--:--  0:00:04 --:--:-- 4665k
+ echo 7916b1bd148ddfd46d7f8f9a517d4b09cd8a8ad9248734e7c8dd91ef17057a88 *php.tar.xz
+ sha256sum -c -
php.tar.xz: OK
+ curl -fSL https://secure.php.net/get/php-7.2.4.tar.xz.asc/from/this/mirror -o php.tar.xz.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     1    0     1    0     0      1      0 --:--:-- --:--:-- --:--:--     1
100   185  100   185    0     0    110      0  0:00:01  0:00:01 --:--:--   774
100   801    0   801    0     0    415      0 --:--:--  0:00:01 --:--:--   415
+ mktemp -d
+ export GNUPGHOME=/tmp/tmp.bT6HkSp90b
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 1729F83938DA44E27BA0F4D3DBDB397470D12172
gpg: keybox '/tmp/tmp.bT6HkSp90b/pubring.kbx' created
gpg: keyserver receive failed: No data
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F
gpg: keyserver receive failed: No data
The command '/bin/sh -c set -xe     echo "jenkins ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers   && cd /usr/src  && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz  && echo "$PHP
_SHA256 *php.tar.xz" | sha256sum -c -   && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc  && export GNUPGHOME="$(mktemp -d)"      && for key in $GPG_KEYS; do         g
pg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key";   done    && gpg --batch --verify php.tar.xz.asc php.tar.xz       && rm -r "$GNUPGHOME"' returned a non-zero code: 2                                  ```
@ElijahLynn
Copy link
Contributor Author

Actual error inside container is

root@298b7430ed27:~# gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 1729F83938DA44E27BA0F4D3DBDB397470D12172
gpg: directory '/home/jenkins/.gnupg' created
gpg: keybox '/home/jenkins/.gnupg/pubring.kbx' created
gpg: keyserver receive failed: Cannot assign requested address

@ElijahLynn
Copy link
Contributor Author

Got it, PR coming...

usbarmory/usbarmory-debian-base_image#9 (comment)

jokersoft added a commit that referenced this issue Feb 23, 2019
@jokersoft jokersoft reopened this Feb 23, 2019
@jokersoft
Copy link
Owner

Still failing with:

Step 21/31 : RUN set -xe && mkdir ~/.gnupg && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf && echo "jenkins ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers && cd /usr/src && curl -fSL "https://secure.php.net/get/$PHP_FILENAME/from/this/mirror" -o php.tar.xz && echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c - && curl -fSL "https://secure.php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o php.tar.xz.asc && export GNUPGHOME="$(mktemp -d)" && for key in $GPG_KEYS; do gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; done && gpg --batch --verify php.tar.xz.asc php.tar.xz && rm -r "$GNUPGHOME"
---> Running in 15c6669c6060
+ mkdir /home/jenkins/.gnupg
+ echo disable-ipv6
+ echo jenkins ALL=(ALL:ALL) NOPASSWD: ALL
+ cd /usr/src
+ curl -fSL https://secure.php.net/get/php-7.2.4.tar.xz/from/this/mirror -o php.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1 0 1 0 0 1 0 --:--:-- --:--:-- --:--:-- 1
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 185 100 185 0 0 128 0 0:00:01 0:00:01 --:--:-- 232
100 65299 0 65299 0 0 38292 0 --:--:-- 0:00:01 --:--:-- 38292
100 9039k 0 9039k 0 0 3415k 0 --:--:-- 0:00:02 --:--:-- 9528k
100 11.4M 0 11.4M 0 0 4226k 0 --:--:-- 0:00:02 --:--:-- 10.6M
+ sha256sum -c -
+ echo 7916b1bd148ddfd46d7f8f9a517d4b09cd8a8ad9248734e7c8dd91ef17057a88 *php.tar.xz
php.tar.xz: OK
+ curl -fSL https://secure.php.net/get/php-7.2.4.tar.xz.asc/from/this/mirror -o php.tar.xz.asc
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1 0 1 0 0 2 0 --:--:-- --:--:-- --:--:-- 2
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 185 100 185 0 0 209 0 --:--:-- --:--:-- --:--:-- 528
100 801 0 801 0 0 765 0 --:--:-- 0:00:01 --:--:-- 765
+
mktemp -d
+ export GNUPGHOME=/tmp/tmp.g47TJidkn3
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 1729F83938DA44E27BA0F4D3DBDB397470D12172
gpg: keybox '/tmp/tmp.g47TJidkn3/pubring.kbx' created
gpg: keyserver receive failed: Cannot assign requested address
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F
gpg: keyserver receive failed: Cannot assign requested address

investigation required.

@jokersoft jokersoft added bug Something isn't working help wanted Extra attention is needed labels Feb 23, 2019
@ElijahLynn
Copy link
Contributor Author

ElijahLynn commented Feb 25, 2019

Reproduced. Interesting that if I build the image only up to that point then run the container and exec into it and run commands manually it works fine. I wonder if it needs a sleep.

@ElijahLynn
Copy link
Contributor Author

Getting interesting, mixed results running the for loop inside the container though, sometimes it works sometimes it doesn't. Will play with more later, no time right now.

@sklabinsky
Copy link
Collaborator

Same here - reproduced, but could not find the reason. Will investigate in a free time.

@sklabinsky
Copy link
Collaborator

Managed to fix here: #4

@jokersoft
Copy link
Owner

Resolved by using multiple sources.

@ElijahLynn
Copy link
Contributor Author

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants