Rust build fails with network errors on snapcraft.io / armhf

originally posted (and possibly related to) here, a particular network request in rustup fails on a rust snapcraft build on armhf which works fine on x64 and x86 (and locally if you wget or go to the listed url).

The relevant part of the log on armhf:

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 a proxy issue, and it’s only on armhf which i think suggests the issue is the environment rather than rustup.

i also tried to debug the build locally, but, the instructions on build.snapcraft.io are outdated / don’t work, and appear to be missing any architecture configuration anyway.

I believe @kinnison raised this issue and there is a bug tracking this (I do not have it handy). He may be able to comment on the state of things.

I did spend some time discussing this with Colin Watson but we were unable to determine quite why this happens. If you set RUSTUP_USE_CURL=1 in your environment does the problem go away? If so then it suggests there’s an issue with reqwest or one of the associated libraries we use in rustup on armhf. If on the other hand the problem persists then there’s something interesting, perhaps around the fact that rustup doesn’t set a User-Agent to my knowledge.

1 Like

adding RUSTUP_USE_CURL=1 results in a slightly different error as follows:

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/otbm6sc6_v_lnoia_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
/root/.cargo/rustup.sh -y --default-toolchain none --no-modify-path

and i can confirm rustup works on other armhf-ish machines

We may possibly have very belatedly got to the bottom of this. See https://github.com/lxc/lxcfs/issues/553.

2 Likes