elm-package icon indicating copy to clipboard operation
elm-package copied to clipboard

elm package install fails in vagrant ssh

Open b1collector opened this issue 10 years ago • 14 comments

When attempting to run elm package install for the first time on a project I received the following error

Error: failed with 'FailedConnectionException "codeload.github.com" 443' when sending request to
    <http://github.com/elm-lang/core/zipball/2.1.0/>

I found a similar issue at https://groups.google.com/forum/#!topic/elm-discuss/I6TUhuBRcMI. The suggest provided works; if I load the box through VirtualBox and run the same command, everything runs smoothly.

Elm Platform: 0.15.1 Vagrant: 1.6.5 Host: Debian 8.1 Vagrant Provider: VirtualBox 4.3.1.8_Debian r96516 Vagrant File:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

    hostname = "elm.box"
    locale = "en_US.UTF.8"

    # Box
    config.vm.box = "ubuntu/vivid64"

    # Shared folders
    config.vm.synced_folder ".", "/srv"

    # Setup
    config.vm.provision :shell, :inline => "touch .hushlogin"
    config.vm.provision :shell, :inline => "hostnamectl set-hostname #{hostname} && locale-gen #{locale}"
    config.vm.provision :shell, :inline => "apt-get update --fix-missing"
    config.vm.provision :shell, :inline => "apt-get install -q -y g++ make git curl vim"

    # Lang
    config.vm.provision :shell, :inline => "apt-get install -q -y nodejs-legacy"
    config.vm.provision :shell, :inline => "apt-get install -q -y npm"
    config.vm.provision :shell, :inline => "npm install --global elm"

    # VirtualBox
    config.vm.provider "virtualbox" do |v|
       v.memory = 1024
    end
end

p.s. A big thank you to anyone developing or promoting Elm. It is by far the most fun language I have ever used.

b1collector avatar Jul 28 '15 23:07 b1collector

Further development, I can install elm-core using the work around but evancz/elm-html still fails with the error:

Error: failed with 'FailedConnectionException "codeload.github.com" 443' when sending request to
    <http://github.com/evancz/elm-html/zipball/4.0.1/>

Zipball is a problem for some reason.

b1collector avatar Jul 29 '15 00:07 b1collector

This also happens when building using a Dockerfile or running the command in a Docker container. It would be very useful if there was a --verbose flag for debugging.

agrafix avatar Jul 31 '15 18:07 agrafix

Here's a small script as workaround: https://gist.github.com/agrafix/11d33acb137646b317d1

Usage:

./elm-install.py circuithub/elm-bootstrap-html 6.3.1

agrafix avatar Aug 01 '15 13:08 agrafix

Thanks @b1collector :D

Does @agrafix's workaround sort this out for you?

I have seen folks run into this in docker containers where it mattered whether or not there was other network traffic in other docker containers. So my theory is that the root problem is in the underlying HTTP library in Haskell, some weird corner case there. If that is a plausible theory, I'm not sure if we have the power to fix this in Elm land and should close this issue and track it down to http://hackage.haskell.org/package/http-client

evancz avatar Aug 02 '15 06:08 evancz

Are there any issues open in relation to http://hackage.haskell.org/package/http-client that are similar to this?

evancz avatar Aug 02 '15 06:08 evancz

@evancz in my script I have to retry the download in some cases. Maybe that would be a possible quick fix for elm-package, too?

agrafix avatar Aug 02 '15 08:08 agrafix

@agrafix Thank you. Your script works like a charm.

@evancz I checked the http-client's github and none of the issues appear related to this. Maybe they have a separate bug tracker somewhere else?

b1collector avatar Aug 02 '15 22:08 b1collector

@agrafix thank you for this script.

janraasch avatar Sep 13 '15 15:09 janraasch

This is becoming a problem for our build servers as our number of dependencies increases. If any one of the dependencies fails to download, the whole build dies, so we're starting to see a lot of failures.

Would some sort of "retry up to 3 times" logic (on a per-package basis) seem like reasonable behavior here?

rtfeldman avatar Sep 21 '15 19:09 rtfeldman

Does this still happen with 0.17?

evancz avatar May 20 '16 04:05 evancz

I no longer have the issue with 0.17 on Vagrant 1.7.4. Thanks!

zekriad avatar May 20 '16 14:05 zekriad

I just started experiencing this issue both inside of Docker and outside of it using elm 0.18.0:

> elm-make elm/*.elm --yes --output public/assets/javascripts/elm.js && uglifyjs public/assets/javascripts/elm.js --output public/assets/javascripts/elm.js --compress --mangle

Starting downloads...

  ● Bogdanp/elm-time 1.4.0
  ● Bogdanp/elm-datepicker 3.0.2
  ● Bogdanp/elm-combine 3.1.1
  ● elm-lang/dom 1.1.1
  ● elm-lang/core 5.1.1
  ● elm-lang/http 1.0.0
  ● myrho/elm-round 1.0.1
  ● elm-lang/html 2.0.0
  ● elm-lang/virtual-dom 2.0.4
  ● krisajenkins/remotedata 4.3.0
  ● cuducos/elm-format-number 2.0.0
  ● elm-lang/lazy 2.0.0
  ✗ elm-community/list-extra 5.0.1
Error: The following HTTP request failed.
<https://github.com/elm-community/list-extra/zipball/5.0.1/>

FailedConnectionException "codeload.github.com" 443

Edit: nevermind, looks like the issue cleared itself up pretty quickly.

alex-tan avatar Jan 27 '17 17:01 alex-tan

This is adversely affecting the reliability of our production deploys as well. codeload.github.com seems to go through occasional periods of instability, during which times dependencies randomly fail to download with FailedConnectionException. We’ve mostly mitigated it by re-trying elm-package install --yes if it fails on the first attempt, and not clearing elm-stuff before the retry (which we do before the deploy).

sentience avatar Jan 31 '17 01:01 sentience

I'm hitting this right now as well...

jb55 avatar Jan 31 '17 01:01 jb55