Build fails on snapcraft.io, works locally (during `cabal update`)

Bug #1797809 reported by Vidar
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
launchpad-buildd
Triaged
High
Unassigned

Bug Description

I have a build that consistently fails on build.snapcraft.io, but I'm unable to reproduce it locally.

Here's the snapcraft log: https://build.snapcraft.io/user/koalaman/shellcheck/350552

It appears to fail during `cabal update` to fetch the list of available Haskell packages:

    Downloading the latest package list from hackage.haskell.org
    [11/Oct/2018:05:03:10 +0000] "GET http://hackage.haskell.org/packages/archive/00-index.tar.gz HTTP/1.1" 301 - "-" "cabal-install/1.22.6.0 (linux; x86_64)"
    cabal: <socket: 10>: resource vanished
    Failed to run 'build': Exit code was 1.

The same build fails with the same message for all architectures.

Meanwhile, `snapcraft cleanbuild --debug` on my local machine works fine:

    Downloading the latest package list from hackage.haskell.org
    Warning: ShellCheck.cabal: Ignoring unknown section type: custom-setup
    Resolving dependencies...
    Notice: installing into a sandbox located at
    /root/build_shellcheck/parts/shellcheck/build/.cabal-sandbox
    Downloading base-compat-0.10.4...
    Downloading dlist-0.8.0.5...
    Configuring dlist-0.8.0.5...
    [...]
    Retrieved 'shellcheck_git_amd64.snap'

Is this a proxy problem? Or a Hackage IP block? Or a cabal issue? I'm not sure how to troubleshoot it.

Vidar (koalaman)
summary: - Build fails on snapcraft, works locally (during `cabal update`)
+ Build fails on snapcraft.io, works locally (during `cabal update`)
Kyle Fazzari (kyrofa)
affects: snapcraft → launchpad-buildd
Colin Watson (cjwatson)
Changed in launchpad-buildd:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Colin Watson (cjwatson) wrote :

This is really a bug in the somewhat old version of the Haskell HTTP library present in xenial's version of cabal-install:

  https://github.com/haskell/HTTP/issues/14

We may be able to work around it by adding connection persistence support to launchpad-buildd's internal proxy.

Revision history for this message
Colin Watson (cjwatson) wrote :

Hmm, it doesn't actually seem to be just that, although the symptoms are extremely similar. xenial's haskell-cabal-install was built against libghc-http-dev 1:4000.2.20-3, and the bug above was fixed in HTTP 4000.2.11. The current issue is in fact:

  https://github.com/haskell/HTTP/issues/68

Revision history for this message
Vidar (koalaman) wrote :

I tried a number of workarounds:

* The Stack build fails, possibly because `haskell-stack` is too old to support custom-setup
* The Docker build fails because `docker.io` is too old to support intermediate images
* A new, custom Docker build fails because it doesn't appear to nest well in LXD
* I tried pre-downloading files for Cabal with wget, but I was not able to get deprecated local-repo going or to get it to build from tarballs

So... I added a squid proxy to proxy to the proxy ¯\_(ツ)_/¯

   https://github.com/koalaman/shellcheck/commit/359b1467a29

It's not exactly pretty, but it takes some of the pressure off.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.