Build fails behind proxy on build.snapcraft.io

I’m experiencing build failures on build.snapcraft.io, which appear to be as a result of a proxy on the build server. It seems similar to: Ant build failing behind build.snapcraft.io server proxies . However that thread claims the issue is solved.

Here is what I believe is the offending error:

pm ERR! network tunneling socket could not be established, cause=Parse Error
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

The full build log is here:
https://launchpadlibrarian.net/384373927/buildlog_snap_ubuntu_xenial_amd64_9b37398b89a5b7110bb71b6ae81df2e8-xenial_BUILDING.txt.gz

1 Like

I also get this error which leads me to believe it’s a proxy issue. Are there any specific network restrictions on snapcraft build servers? I haven’t been able to find any documentation concerning this.

npm ERR! Unexpected token <
npm ERR! <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
npm ERR! <html><head>
npm ERR! <meta http-equiv="Content-Type" CONTENT="text/html; charset=utf-8">
npm ERR! <title>ERROR: The requested URL could not be retrieved</title>
npm ERR! <style type="text/css"><!-- 
npm ERR!  
npm ERR! 
npm ERR! body
npm ERR! :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
npm ERR! :lang(he) { direction: rtl; }
npm ERR!  --></style>
npm ERR! </head><body id=ERR_CONNECT_FAIL>
npm ERR! <div id="titles">
npm ERR! <h1>ERROR</h1>
npm ERR! <h2>The requested URL could not be retrieved</h2>
npm ERR! </div>
npm ERR! <hr>
npm ERR! 
npm ERR! <div id="content">
npm ERR! <p>The following error was encountered while trying to retrieve the URL: <a href="http://registry.npmjs.org/babel-eslint">http://registry.npmjs.org/babel-eslint</a></p>
npm ERR! 
npm ERR! <blockquote id="error">
npm ERR! <p><b>Connection to 2400:cb00:2048:1::6810:1323 failed.</b></p>
npm ERR! </blockquote>
npm ERR! 
npm ERR! <p id="sysmsg">The system returned: <i>(101) Network is unreachable</i></p>
npm ERR! 
npm ERR! <p>The remote host or network may be down. Please try the request again.</p>
npm ERR! 
npm ERR! <p>Your cache administrator is <a href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&amp;body=CacheHost%3A%20juju-prodstack-45-lp-snap-proxy-machine-1%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(101)%20Network%20is%20unreachable%0D%0ATimeStamp%3A%20Mon,%2020%20Aug%202018%2006%3A06%3A27%20GMT%0D%0A%0D%0AClientIP%3A%2010.189.154.26%0D%0AServerIP%3A%20registry.npmjs.org%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fbabel-eslint%20HTTP%2F1.1%0AProxy-Authorization%3A%20Basic%20U05BUEJVSUxELTMxNTg5OS0xNTM0NzQ0NTM5OjlkMTE1YTJiYzdkOTRkMzZiZTg1YjczZTkyZWU5ODcz%0D%0Anpm-session%3A%202f53e04ffbe4ad2f%0D%0AAccept-Encoding%3A%20gzip%0D%0AHost%3A%20registry.npmjs.org%0D%0AAccept%3A%20application%2Fjson%0D%0AUser-Agent%3A%20npm%2F3.5.2%20node%2Fv4.2.6%20linux%20arm%0D%0AConnection%3A%20close%0D%0Aversion%3A%203.5.2%0D%0AReferer%3A%20install%0D%0A%0D%0A%0D%0A">webmaster</a>.</p>
npm ERR! 
npm ERR! <br>
npm ERR! </div>
npm ERR! 
npm ERR! <hr>
npm ERR! <div id="footer">
npm ERR! <p>Generated Mon, 20 Aug 2018 06:06:27 GMT by juju-prodstack-45-lp-snap-proxy-machine-1 (squid/3.3.8)</p>
npm ERR! <!-- ERR_CONNECT_FAIL -->
npm ERR! </div>
npm ERR! </body></html>
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

@ryanjyoder, Thank you reporting this issue!

I am encountering by the very same issue when trying to include node and postcss-cli in the Hugo snap:

  node:
    plugin: nodejs
    node-packages: [postcss-cli]
    filesets:
      node:
        - bin/node
      postcss:
        - bin/postcss
        - lib/node_modules/postcss-cli/*
    prime:
      - $node
      - $postcss

where npm fails to fetch postcss-cli failing with the same network proxy issue:

npm --cache-min=Infinity install --global postcss-cli
[24/Aug/2018:15:51:26 +0000] "CONNECT nodejs.org:443 HTTP/1.0" 200 14030940 "-" "-"
[24/Aug/2018:15:51:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 503 1956 "install postcss-cli" "npm/3.10.10 node/v6.11.4 linux x64"
[24/Aug/2018:15:51:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 503 1956 "install postcss-cli" "npm/3.10.10 node/v6.11.4 linux x64"
[24/Aug/2018:15:52:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 503 1956 "install postcss-cli" "npm/3.10.10 node/v6.11.4 linux x64"
npm ERR! Linux 4.4.0-128-generic
npm ERR! argv "/build/hugo/parts/node/install/bin/node" "/build/hugo/parts/node/install/bin/npm" "--cache-min=Infinity" "install" "--global" "postcss-cli"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, statusCode=503
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /build/hugo/parts/node/src/npm-debug.log
Failed to run 'npm --cache-min=Infinity install --global postcss-cli' for 'node': Exited with code 1.

See the full build log at
https://launchpadlibrarian.net/385171998/buildlog_snap_ubuntu_xenial_amd64_hugo_BUILDING.txt.gz

Thanks in advance to the Snapcraft.io gurus for help!

Thanks for one upping this. It seems to be an issues for others as well:

I don’t know if there’s a better location to raise this issue?

I think I’m getting the issue to with my snap for Bisq. https://build.snapcraft.io/user/dmp1ce/bisq-snap/319337

You seem to be experiencing this LP: #1781970.

There’s more detailed information under the bug’s comments.

1 Like

hey so i’m not sure if this is the same or a separate bug, but a similar issue appears on armhf builds using rust. any ideas where to go from here / what the correct place to log a bug would be (new or re-opening the linked one)?

The relevant part of the log:

info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/root/.cargo/tmp/zlpjrtkbf5wpu12a_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out

on x86 (or amd64):

info: syncing channel updates for 'stable-i686-unknown-linux-gnu'
info: latest update on 2019-05-23, rust version 1.35.0 (3c235d560 2019-05-20)
info: downloading component 'rustc'
info: downloading component 'rust-std'
...

stable-i686-unknown-linux-gnu installed - rustc 1.35.0 (3c235d560 2019-05-20)

the checksum file is available and can be downloaded in both cases, which makes me suspect it’s this / another network connectivity issue.