Getaddrinfo ENOTFOUND github.com - Builds failing on snapcraft.io due to network problems?

Hi,

My builds on build.snapcraft.io have started failing (e.g. shell#708811 and shell-kiosk#734877) for two Electron-based GitHub repos (shell and shell-kiosk) for which builds were previously working.

In the logs I see:

[15/Nov/2019:12:06:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6237 "install electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[15/Nov/2019:12:06:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11802 "install electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[15/Nov/2019:12:06:35 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7442 "install electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"

> core-js@3.4.1 postinstall /build/webian-shell-kiosk/parts/webian-shell-kiosk/build/node_modules/core-js
> node postinstall || echo "ignore"

shell-kiosk@0.0.1 /build/webian-shell-kiosk/parts/webian-shell-kiosk/build
β”œβ”€β”¬ electron@6.1.4
β”‚ └─┬ electron-download@4.1.1
β”‚   └─┬ debug@3.2.6 
β”‚     └── ms@2.1.2 
└── electron-packager@14.1.0  extraneous

npm WARN shell-kiosk@0.0.1 No repository field.
getaddrinfo ENOTFOUND github.com github.com:443
Failed to run 'override-build': Exit code was 1.
Build failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 266, in run
    self.build()
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 255, in build
    env=env)
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 102, in run_build_command
    return self.backend.run(args, env=full_env, **kwargs)
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 502, in run
    subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-bionic-armhf', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'SNAPCRAFT_BUILD_INFO=1', '--env', 'SNAPCRAFT_IMAGE_INFO={"build-request-id": "lp-52608244", "build-request-timestamp": "2019-11-15T11:53:32Z", "build_url": "https://launchpad.net/~build.snapcraft.io/+snap/f2b382584d2db83cf919b0d75a474457/+build/734877"}', '--env', 'SNAPCRAFT_BUILD_ENVIRONMENT=host', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy', '--', '/bin/sh', '-c', 'cd /build/webian-shell-kiosk && linux32 snapcraft']' returned non-zero exit status 2
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=bionic --arch=armhf SNAPBUILD-734877
Scanning for processes to kill in build SNAPBUILD-734877

In my snapcraft.yaml there is a line copied from this tutorial which runs:

npm install electron-packager

To my untrained eye this looks like it might be a network problem on the build server while trying to reach github.com:443, potentially caused by a proxy configuration on the server.

Does anyone have suggestions on how to fix this or any other ideas what might be causing the builds to fail?

Thanks

just guessing here, but your package,json seems to have:

"url": "git+https://github.com/webianproject/shell.git"

i’d try to drop the git+ from the url …

Thanks for the suggestion. Unfortunately this didn’t make any difference. And actually the other repo doesn’t include this line and still fails to build.

I have tried to build locally using lxd as recommended in the build page and see the following output which may give a more useful clue as to the root issue.

Building webian-shell-kiosk 
loadDep:global-tunnel-ng  β–Œ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ

> core-js@3.4.1 postinstall /root/parts/webian-shell-kiosk/build/node_modules/core-js
> node postinstall || echo "ignore"

shell-kiosk@0.0.1 /root/parts/webian-shell-kiosk/build
β”œβ”€β”¬ electron@6.1.4
β”‚ └─┬ electron-download@4.1.1
β”‚   └─┬ debug@3.2.6 
β”‚     └── ms@2.1.2 
└── electron-packager@14.1.0  extraneous

npm WARN shell-kiosk@0.0.1 No repository field.
Packaging app for platform linux x64 using electron v6.1.4
Wrote new app to /root/parts/webian-shell-kiosk/build/shell-kiosk-linux-x64
cp: cannot stat './webian-shell-kiosk-linux-x64': No such file or directory
Failed to run 'override-build': Exit code was 1.

In light of this error, if I change the corresponding line in snapcraft.yaml to:

cp -v -R /root/parts/webian-shell-kiosk/build/shell-kiosk-linux-$ARCH $SNAPCRAFT_PART_INSTALL/webian-shell-kiosk

then it builds locally.

However, this doesn’t work when building on build.snapcraft.io where it still produces the same error.

It seems like there may have been a change in electron-packager which means the example in the tutorial doesn’t work any more, because building that tutorial on build.snapcraft.io now fails with the same error (we managed to get it to build successfully before and I haven’t changed it since).

I’ve filed an issue against electron-packager to see if something has changed there, but is it possible something has changed with snapcraft or build.snapcraft.io which is resulting in the output of the command:

electron-packager . --overwrite --platform=linux --arch=$ARCH --output=release-build --prune=true

ending up somewhere different to when the tutorial was written?

I got a response on the electron-packager issue tracker and they think it’s a network problem on the snapcraft build server. I did notice that building locally didn’t have the same error about reaching github.com, could this be the issue?

I’ve verified that the example in the tutorial no longer works either and produces the same error, which does seem to suggest that something has changed with the build.snapcraft.io build service?

The build machines require use of a proxy to reach the outside world. I think something in electron-packager or one of its dependent packages is ignoring the configured HTTP proxy. You can see that other things are working just fine - not far back in the log there are a bunch of requests to registry.npmjs.org that get HTTP 200 responses and are generally perfectly happy.

Just to report back, it appears that electron-packager is not configuring proxy settings correctly. Manually setting the ELECTRON_GET_USE_PROXY=1 environment variable makes the builds work again.

This does mean that the Electron Kiosk tutorial will no longer work until electron-packager is fixed.

1 Like

if it is just that env variable, you should be able to add something like:

    build-environment:
      - ELECTRON_GET_USE_PROXY: 1

to your snapcraft.yaml (if that helps we can make a PR to update the tutorial)

This has now been fixed upstream (apparently in Electron Packager 14.1.1), so we shouldn’t need to update the tutorial.

2 Likes