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

Problem building on snapcraft.io due to DNS problem #1075

Closed
benfrancis opened this issue Nov 15, 2019 · 11 comments
Closed

Problem building on snapcraft.io due to DNS problem #1075

benfrancis opened this issue Nov 15, 2019 · 11 comments
Labels
invalid ❌ Not related to Electron Packager directly

Comments

@benfrancis
Copy link

Issue Details

  • Electron Packager Version:
    • Latest?
  • Electron Version:
    • ^6.0.6
  • Operating System:
    • Ubuntu 18.04 amd64

Expected Behavior

Can build an electron-based kiosk snap on build.snapcraft.io using this tutorial.

Actual Behavior

Output of build:

[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

To Reproduce

Follow this tutorial.

Additional Information

I'm having a problem building two projects (shell and shell-kiosk) where I followed the same process as the tutorial linked to above. I think I've narrowed the problem down to electron-packager because the example in the tutorial no longer builds successfully on build.snapcraft.io where it did before.

My assumption is that something has changed in electron-packager which is causing the build to fail. I am able to get the build to work locally by changing the line:

cp -v -R ./webian-shell-kiosk-linux-$ARCH $SNAPCRAFT_PART_INSTALL/webian-shell-kiosk

to

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

but with this change the build still fails on the snapcraft build server with the same error as before.

Has there been some change to where the command:

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

will output to?

For more information, see my post on the Snapcraft forums.

Apologies if this has nothing to do with electron-packager and I'm barking up the wrong tree.

@welcome
Copy link

welcome bot commented Nov 15, 2019

👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@malept malept added invalid ❌ Not related to Electron Packager directly and removed bug 🐛 labels Nov 15, 2019
@malept
Copy link
Member

malept commented Nov 15, 2019

This isn't caused by Electron Packager. In your log, I see:

getaddrinfo ENOTFOUND github.com github.com:443

I don't know if snapcraft.io build machines have network access, but that's certainly necessary to install Electron prebuilt binaries unless you do some node_modules caching somehow.

I would recommend using electron-installer-snap to build Snaps.

@malept malept closed this as completed Nov 15, 2019
@malept malept changed the title Problem building on snapcraft.io Problem building on snapcraft.io due to DNS problem Nov 15, 2019
@benfrancis
Copy link
Author

@malept Thanks for the feedback.

I've brought up the potential network issue on the Snapcraft forums.

electron-install-snap sounds useful, but the challenge I have is that I'm trying to build a snap of my electron app for Ubuntu Core on a Raspberry Pi (armhf), which is why I'm using build.snapcraft.io (to cross-compile for that architecture). Do you happen to know whether there's a way to use electron-install-snap with the build.snapcraft.io build service? It seems like the build server expects a snapcraft.yaml file in the GitHub repository, whereas with electron-install-snap generates snapcraft.yaml at build time. Any advice would be appreciated.

@malept
Copy link
Member

malept commented Nov 16, 2019

This may be an interesting feature request for that module that you should file in its issue tracker. I would need to think about what the interaction would be for that.

@cjwatson
Copy link

For the record, our build machines do have network access, but require use of a proxy to reach the outside world. I think something in electron-packager or one of its dependent modules must be ignoring the proxy (which is configured using the standard http_proxy and https_proxy environment variables).

@benfrancis
Copy link
Author

Thanks @cjwatson!

@malept Looking through the commit log I see a recent commit dc31cac which was meant to improve proxy support.

Is there an argument I can pass to electron-packager on the command line to tell it to use the proxy from the https_proxy environment variable, or should it be doing this automatically?

Thanks

@cjwatson
Copy link

I may very well be missing something, but @electron/get's documentation says that downstream packages should call initializeProxy to set up proxy support, but electron-packager doesn't seem to do so.

@cjwatson
Copy link

In fact: you could check if this is the problem by setting ELECTRON_GET_USE_PROXY=1 in the environment before calling electron-packager. My understanding is that that's a workaround rather than a real fix (if nothing else, it's undocumented), but it would narrow things down.

@benfrancis
Copy link
Author

@cjwatson Thanks for the tip.

@malept I can confirm this is the case. When I set ELECTRON_GET_USE_PROXY=1 the builds started working again (e.g. https://build.snapcraft.io/user/webianproject/shell/737961).

It seems that electron-packager is not setting up the proxy as expected by default.

@malept
Copy link
Member

malept commented Nov 20, 2019

As of Electron Packager 14.1.1, proxy support is always enabled when using the CLI (#1077).

@cjwatson
Copy link

@malept Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid ❌ Not related to Electron Packager directly
Projects
None yet
Development

No branches or pull requests

3 participants