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

Stack does not retry effectively when S3 is being flaky. #3510

Closed
NorfairKing opened this issue Oct 24, 2017 · 65 comments
Closed

Stack does not retry effectively when S3 is being flaky. #3510

NorfairKing opened this issue Oct 24, 2017 · 65 comments

Comments

@NorfairKing
Copy link
Contributor

@NorfairKing NorfairKing commented Oct 24, 2017

This an issue that will help us to evaluate how good stack's retrying strategy is when it comes to flaky connections.

@mgsloan mgsloan added this to the P2: Should milestone Oct 27, 2017
@jdbrandon
Copy link

@jdbrandon jdbrandon commented Dec 12, 2017

Retry failed but running the command manually (not in make) succeeded.

@vilinski
Copy link

@vilinski vilinski commented Dec 15, 2017

Hi,
I'm using cntlm behind corp firewall, and it hangs periodically, like in this case:

'stack build intero'

Click to view terminal output
...
Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/haskeline-0.7.4.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HostCannotConnect "localhost" [Network.Socket.connect: <socket: 708>: failed (Connection refused (WSAECONNREFUSED)),Network.Socket.connect: <socket: 708>: failed (Connection refused (WSAECONNREFUSED))]))
Progress: 4/5
@leptonyu
Copy link

@leptonyu leptonyu commented Dec 19, 2017

Hi,
this is my log, what's the problem?

stack install stylish-haskell

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
syb-0.7: download
polyparse-1.12: download
strict-0.3.2: download
happy-1.19.7: download
strict-0.3.2: configure
strict-0.3.2: build
syb-0.7: configure
syb-0.7: build
strict-0.3.2: copy/register
polyparse-1.12: configure
syb-0.7: copy/register
polyparse-1.12: build
polyparse-1.12: copy/register
cpphs-1.20.8: download
happy-1.19.7: configure
happy-1.19.7: build
cpphs-1.20.8: configure
cpphs-1.20.8: build
happy-1.19.7: copy/register
cpphs-1.20.8: copy/register
             
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
Progress: 6/7HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/haskell-src-exts-1.18.2.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ConnectionTimeout
@mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Dec 23, 2017

@leptonyu Is that with stack-1.6.1 or some other version?

@weak-head
Copy link

@weak-head weak-head commented Dec 27, 2017

It doesn't look like my case is related to a flaky connection, but I'll keep it here:

stack new time scotty-hello-world

Downloading template "scotty-hello-world" to create project "time" in time/ ...

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

HttpExceptionRequest Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("If-None-Match","\"a6c397921b68d011fc139585510b72010aad7ac0\"")]
  path                 = "/commercialhaskell/stack-templates/master/scotty-hello-world.hsfiles"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo: does not exist (Name does not resolve)) 

Sanity check using curl:

curl -X GET https://raw.githubusercontent.com:443/commercialhaskell/stack-templates/master/scotty-hello-world.hsfiles

{-# START_FILE {{name}}.cabal #-}
name:          {{name}}
version:       0.0.0
cabal-version: >= 1.8
build-type:    Simple

executable          {{name}}
    hs-source-dirs: .
    main-is:        Main.hs
    ghc-options:    -Wall -threaded -O2 -rtsopts -with-rtsopts=-N
    extensions:     OverloadedStrings
    build-depends:  base   >= 4      && < 5
                  , scotty

{-# START_FILE Main.hs #-}
{-# LANGUAGE OverloadedStrings #-}

import Web.Scotty

main :: IO ()
main = scotty 3000 $ do
  get "/:word" $ do
    beam <- param "word"
    html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]

{-# START_FILE .ghci #-}
:set -XOverloadedStrings

{-# START_FILE .gitignore #-}
*.hi
*.o
.stack-work/
.cabal-sandbox
cabal.sandbox.config
.DS_Store
*.swp
*.keter
stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
@mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Dec 27, 2017

Hmm, very strange! I wonder what the difference in behavior between curl and http-client is. Thanks for the report

@leptonyu
Copy link

@leptonyu leptonyu commented Dec 28, 2017

@mgsloan it is version 1.6.1

@sclausen
Copy link

@sclausen sclausen commented Jan 4, 2018

Strange, that a simple retry worked…

Preparing to download ghc-8.0.2 ...HttpExceptionRequest Request {
  host                 = "github.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/commercialhaskell/ghc/releases/download/ghc-8.0.2-release/ghc-8.0.2-x86_64-deb7-linux.tar.xz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo: does not exist (Name does not resolve))
@gl-remote
Copy link

@gl-remote gl-remote commented Jan 9, 2018

[root@localhost ~]# stack setup
Writing implicit global project config file to: /root/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-10.3
Downloaded lts-10.3 build plan.
Preparing to install GHC (tinfo6) to an isolated location.
This will not interfere with any system-level installation.

Warning: Retry number 0 after a total delay of 0 us
If you see this warning and stack fails to download, but running the
command again solves the problem, please report here:
#3510
ghc-tinfo6-8.2.2: 406.52 KiB / 122.86 MiB ( 0.32%) downloaded...

it working,but slowly

@xnuk
Copy link

@xnuk xnuk commented Jan 15, 2018

After I add microlens-platform to library dependencies, running stack build shows this:

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
             
Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Progress: 1/6HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/microlens-0.4.8.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 6, addrAddress = <assumed to be undefined>, addrCanonName = <assumed to be undefined>}, host name: Just "s3.amazonaws.com", service name: Just "443"): does not exist (Name or service not known))

Running stack build again did work anyway.

I'm using stack 1.6.3 x86_64.

@SandWind
Copy link

@SandWind SandWind commented Jan 29, 2018

[root@localhost postgrest]# stack build --install-ghc --copy-bins --local-bin-path /usr/local/bin
postgresql-libpq-0.9.3.1: configure
syb-0.7: download
postgresql-libpq-0.9.3.1: build
syb-0.7: configure
syb-0.7: build
syb-0.7: copy/register
Progress: 2/107
-- While building custom Setup.hs for package postgresql-libpq-0.9.3.1 using:
/tmp/stack23329/postgresql-libpq-0.9.3.1/.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /root/postgrest/.stack-work/logs/postgresql-libpq-0.9.3.1.log

[1 of 2] Compiling Main             ( /tmp/stack23329/postgresql-libpq-0.9.3.1/Setup.hs, /tmp/stack23329/postgresql-libpq-0.9.3.1/.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim   ( /root/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack23329/postgresql-libpq-0.9.3.1/.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/setup/StackSetupShim.o )
Linking /tmp/stack23329/postgresql-libpq-0.9.3.1/.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/setup/setup ...
Configuring postgresql-libpq-0.9.3.1...
Building postgresql-libpq-0.9.3.1...
Preprocessing library postgresql-libpq-0.9.3.1...
/tmp/stack23329/postgresql-libpq-0.9.3.1/LibPQ.hsc:1919:1: warning: "hsc_alignment" redefined
In file included from .stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/build/Database/PostgreSQL/LibPQ_hsc_make.c:1:
/root/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/lib/ghc-8.0.2/template-hsc.h:88:1: warning: this is the location of the previous definition
LibPQ.hsc: In function ‘main’:
LibPQ.hsc:981: error: ‘PGRES_COPY_BOTH’ undeclared (first use in this function)
LibPQ.hsc:981: error: (Each undeclared identifier is reported only once
LibPQ.hsc:981: error: for each function it appears in.)
LibPQ.hsc:985: error: ‘PGRES_SINGLE_TUPLE’ undeclared (first use in this function)
compiling .stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/build/Database/PostgreSQL/LibPQ_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c .stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/build/Database/PostgreSQL/LibPQ_hsc_make.c -o .stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/build/Database/PostgreSQL/LibPQ_hsc_make.o -fno-stack-protector -fno-stack-protector -D__GLASGOW_HASKELL__=800 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -I/usr/include -Icbits -I.stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/build/autogen -include .stack-work/dist/x86_64-linux-gmp4/Cabal-1.24.2.0/build/autogen/cabal_macros.h -I/root/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/lib/ghc-8.0.2/bytestring-0.10.8.1/include -I/root/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/lib/ghc-8.0.2/base-4.9.1.0/include -I/root/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1/include -I/root/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/lib/ghc-8.0.2/include -I/root/.stack/programs/x86_64-linux/ghc-gmp4-8.0.2/lib/ghc-8.0.2/include/
@kadoban
Copy link
Collaborator

@kadoban kadoban commented Jan 30, 2018

@SandWind I might be missing something, but that doesn't look related to a S3 download failure or retrys or anything. I'd start a new issue if it's as unrelated as it looks.

@Quantumplation
Copy link

@Quantumplation Quantumplation commented Feb 4, 2018

Just encountered this issue while trying to stack install hlint ghc-mod from an ubuntu 16 droplet:

... etc ...

old-time-1.1.0.3: copy/register
prelude-extras-0.4.0.3: download
prelude-extras-0.4.0.3: configure
prelude-extras-0.4.0.3: build
prelude-extras-0.4.0.3: copy/register
primitive-0.6.3.0: download
primitive-0.6.3.0: configure
primitive-0.6.3.0: build
primitive-0.6.3.0: copy/register
random-1.1: download
random-1.1: configure
random-1.1: build
random-1.1: copy/register

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510
Cabal-2.0.1.1: copy/register
HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/edit-distance-0.2.2.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo: does not exist (Name does not resolve))
Progress: 33/98%

quantumplation@haskell-dev ~                                                                           [18:31:17]
> $ stack install hlint ghc-mod
edit-distance-0.2.2.1: download
edit-distance-0.2.2.1: configure
cabal-doctest-1.0.5: download
edit-distance-0.2.2.1: build
cabal-doctest-1.0.5: configure
cabal-doctest-1.0.5: build

... etc ...
@AntouanK
Copy link

@AntouanK AntouanK commented Feb 5, 2018

I get the same errors.
I cannot install or update anything with stack.

with resolver 10.3, I get error on a package and it stops.
with 10.4, it errors before it gets to a package.

stack build --resolver lts-10.4
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Downloading lts-10.4 build plan ...HttpExceptionRequest Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-10.4.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 TlsNotSupported
@lsund
Copy link

@lsund lsund commented Feb 5, 2018

Got exactly the same problem and error as AntouanK, can not use stack for anything right now.

@borsboom
Copy link
Contributor

@borsboom borsboom commented Feb 5, 2018

@AntouanK @Quantumplation How did you install Stack, and did this installation work before?

@weak-head
Copy link

@weak-head weak-head commented Feb 5, 2018

It is pretty consistent with v1.6.3 for me, though v1.5.1 works fine and the issue doesn't happen with it. So I'm using 1.5.1 since end of December.

@AntouanK
Copy link

@AntouanK AntouanK commented Feb 5, 2018

@borsboom I used arch's repositories ( pacman ).
It's working fine for almost a year, never had an issue before.

$ stack --version
Version 1.6.3 x86_64
@borsboom
Copy link
Contributor

@borsboom borsboom commented Feb 5, 2018

@AntouanK Can you try downloading the binary from https://github.com/commercialhaskell/stack/releases/download/v1.6.3/stack-1.6.3-linux-x86_64-static.tar.gz and see if that one works any better?

@AntouanK
Copy link

@AntouanK AntouanK commented Feb 5, 2018

@borsboom that binary works, yes.

@borsboom
Copy link
Contributor

@borsboom borsboom commented Feb 5, 2018

New issue for this specific problem: #3848

@onslauth
Copy link

@onslauth onslauth commented Mar 4, 2018

Hi,

This might be related since I am asked to comment in this thread by the output messages produced. I am new to Haskell and I am trying to build wire-server from this repo: wire-server. After cloning the repo I run the following command:

cd build/alpine && make

When building, it was getting to

Updating indexes

After which time it would sit there indefinitely. I discovered that this was because the package index server was taking a really long time to respond or download it, and fixed it by creating the following config.yaml file as taken from this comment

config.yaml:

build:
  prefetch: true
ghc-build: standard
system-ghc: true
ghc-options:
  "$everything": -split-sections
package-indices:
- name: fpco-hackage-mirror
  download-prefix: https://s3.amazonaws.com/hackage.fpcomplete.com/packages
  http: https://s3.amazonaws.com/hackage.fpcomplete.com/
  hackage-security:
    keyids:
      [ "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d"
      , "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42"
      , "280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833"
      , "2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201"
      , "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3"
      , "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"
      , "772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d"
      , "aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9"
      , "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
      ]
    key-threshold: 3
- name: standard-hackage
  download-prefix: https://hackage.haskell.org/packages/
  http: https://hackage.haskell.org/
  hackage-security:
    keyids:
      [ "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d"
      , "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42"
      , "280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833"
      , "2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201"
      , "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3"
      , "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"
      , "772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d"
      , "aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9"
      , "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
      ]
    key-threshold: 3
- name: dream-hackage-mirror
  download-prefix: http://objects-us-west-1.dream.io/hackage-mirror/package/
  http: http://objects-us-west-1.dream.io/hackage-mirror/
  hackage-security:
    keyids:
      [ "0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d"
      , "1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42"
      , "280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833"
      , "2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201"
      , "2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3"
      , "51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"
      , "772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d"
      , "aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9"
      , "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
      ]
    key-threshold: 3

This helped to progress past the "Updating indexes" stall, and I now receive the following issue:

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/packagesCabal-2.0.1.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (StatusCodeException (Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, responseVersion = HTTP/1.1, responseHeaders = [("x-amz-request-id","47A6E9DAF6F64BF7"),("x-amz-id-2","8iy9dIx0wKbPx9ikx5lcTDu1gLRj9aDKUEn69im+Ilu02fCcY6glzcY4Cgk32y3HLo4Mjy4Eu9M="),("Content-Type","application/xml"),("Transfer-Encoding","chunked"),("Date","Sun, 04 Mar 2018 09:57:08 GMT"),("Server","AmazonS3")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>47A6E9DAF6F64BF7</RequestId><HostId>8iy9dIx0wKbPx9ikx5lcTDu1gLRj9aDKUEn69im+Ilu02fCcY6glzcY4Cgk32y3HLo4Mjy4Eu9M=</HostId></Error>")

Does anyone have any suggestions as to how to proceed?

@mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Mar 5, 2018

@onslauth Looks like I made a typo in that comment (I don't use the mirrors myself, yet). I edited it. The clue was that your error output has

  path                 = "/hackage.fpcomplete.com/packagesCabal-2.0.1.1.tar.gz"

Note the missing / after packages.

@fizruk
Copy link
Contributor

@fizruk fizruk commented Apr 23, 2018

Just bumped into this problem for servant-auth-token-acid-0.5.3.1 which has been released 3 days ago on Hackage:

$ stack build -j1

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please report here:
         https://github.com/commercialhaskell/stack/issues/3510
Progress: 0/3HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/servant-auth-token-acid-0.5.3.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Protocol ("certificate rejected: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)",True,CertificateUnknown))))

Meanwhile curl appears to be working:

$ curl -v https://s3.amazonaws.com/hackage.fpcomplete.com/package/servant-auth-token-acid-0.5.3.1.tar.gz
...
< HTTP/1.1 200 OK
< x-amz-id-2: FQdH8wshmQPj0mTf5HhiJGzoWWTB4QPdJF1GHbI5q/DjoOZ4XSdfK70PdUl4rHcKPDv2tmp+m30=
< x-amz-request-id: 32731268FBBE183B
< Date: Mon, 23 Apr 2018 15:29:16 GMT
< Last-Modified: Fri, 20 Apr 2018 16:08:01 GMT
< ETag: "2315c454e9814cc28fa672b914d58fbd"
< Accept-Ranges: bytes
< Content-Type: application/x-gzip
< Content-Length: 8185
< Server: AmazonS3
...

EDIT:

$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0
# stack.yaml
resolver: lts-11.0

extra-deps:
- servant-auth-token-0.5.3.0
- servant-auth-token-acid-0.5.3.1
- servant-auth-token-api-0.5.2.0
- acid-state-0.14.3

nix:
  add-gc-roots: true
  enable: true
  pure: true
  packages: [zlib]
@solrach
Copy link

@solrach solrach commented Apr 28, 2018

W10...



C:\stack install hoogle
appar-0.1.4: using precompiled package
async-2.1.1.1: using precompiled package
auto-update-0.1.4: using precompiled package
base-compat-0.9.3: using precompiled package

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
base64-bytestring-1.0.0.1: using precompiled package

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
basement-0.0.7: using precompiled package

Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
byteable-0.1.1: using precompiled package
Progress: 8/111HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/base-orphans-0.7.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.BSD.getProtocolByName: does not exist (no such protocol name: tcp))
>stack --version
Version 1.6.1, Git revision f25811329bbc40b0c21053a8160c56f923e1201b (5435 commits) x86_64 hpack-0.20.0
@AntouanK
Copy link

@AntouanK AntouanK commented May 3, 2018

same problem with 1.7.1

Step 10/13 : RUN         stack upgrade
 ---> Running in 6c9f76651e71
Current Stack version: 1.5.1, available download version: 1.7.1
Newer version detected, downloading
Querying for archive location for platform: linux-x86_64-static
Querying for archive location for platform: linux-x86_64
Downloading from: https://github.com/commercialhaskell/stack/releases/download/v1.7.1/stack-1.7.1-linux-x86_64.tar.gz
Download complete, testing executable
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
New stack executable available at /root/.local/bin/stack
Removing intermediate container 6c9f76651e71
 ---> df33af41e809
Step 11/13 : RUN         stack --version
 ---> Running in a0fe71ef1017
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
Removing intermediate container a0fe71ef1017
 ---> 5fc3b320f738
Step 12/13 : RUN         stack setup
 ---> Running in c4cf06967b09
Downloading lts-11.7 build plan ...
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
HttpExceptionRequest Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/fpco/lts-haskell/master//lts-11.7.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.BSD.getProtocolByName: does not exist (no such protocol name: tcp))
The command '/bin/sh -c stack setup' returned a non-zero code: 1
@AntouanK
Copy link

@AntouanK AntouanK commented May 3, 2018

The only thing that works is the binary that @borsboom posted here : #3510 (comment)
No other version of stack works in that docker image ( it's based on the Haskell one )

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Aug 20, 2018

@wowofbob @wpoosanguansit @huw Would you try running stack upgrade --git to update to the current master branch — there has been a fix applied (exponential backoff, #4109).

@sol, are you on 1.7.1 too?

@sol
Copy link
Contributor

@sol sol commented Aug 21, 2018

$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2

Yes.

@remorses
Copy link

@remorses remorses commented Aug 27, 2018

got many of these while installing haskell-ide-engine with default makefile

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/hackage.fpcomplete.com/package/text-1.2.3.0.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 6, addrAddress = <assumed to be undefined>, addrCanonName = <assumed to be undefined>}, host name: Just "s3.amazonaws.com", service name: Just "443"): does not exist (nodename nor servname provided, or not known))
make: *** [hie-8.2.2] Error 1
@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Aug 27, 2018

The master branch now includes some major breaking changes to package caches. There should be a new release very soon which will include the fix (but not break your caches).

@erjenkins29
Copy link
Contributor

@erjenkins29 erjenkins29 commented Oct 9, 2018

Just as a PSA, since I don't see anything about China in here...

stack setup fails every time for me because my server is located in China. In order to make it work, you basically have to put the following in your ~/.stack/config.yaml :

## ADD THIS IF YOU LIVE IN CHINA
setup-info: "http://mirrors.tuna.tsinghua.edu.cn/stackage/stack-setup.yaml"
urls:
  latest-snapshot: http://mirrors.tuna.tsinghua.edu.cn/stackage/snapshots.json
  lts-build-plans: http://mirrors.tuna.tsinghua.edu.cn/stackage/lts-haskell/
  nightly-build-plans: http://mirrors.tuna.tsinghua.edu.cn/stackage/stackage-nightly/
package-indices:
  - name: Tsinghua
    download-prefix: http://mirrors.tuna.tsinghua.edu.cn/hackage/package/
    http: http://mirrors.tuna.tsinghua.edu.cn/hackage/00-index.tar.gz

@NorfairKing
Copy link
Contributor Author

@NorfairKing NorfairKing commented Oct 21, 2018

Looks fixed to me!

@SalAlba
Copy link

@SalAlba SalAlba commented Oct 26, 2018

In terminall try to build Duckling project get this problems, operation system (Ubuntu 18.04.1 LTS) :

  1. first
    Warning: Retry number 1 after a total delay of 100000 us
    If you see this warning and stack fails to download, but running the command again solves the
    problem, please report here: #3510 Make sure
    to paste the output of 'stack --version'

stack --version
Version 1.9.1, Git revision f9d0042 (6168 commits) x86_64 hpack-0.31.0

  1. second

    Configuring regex-pcre-0.94.4...
    Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependency on a foreign
    library:

    • Missing C library: pcre
      This problem can usually be solved by installing the system package that
      provides this library (you may need the "-dev" version). If the library is
      already installed but in a non-standard location then you can use the flags
      --extra-include-dirs= and --extra-lib-dirs= to specify where it is.
@SalAlba
Copy link

@SalAlba SalAlba commented Oct 26, 2018

adam@adam:~/Python/duckling/3-pro/duckling$ stack build

regex-pcre-0.94.4: configure
Progress 1/2

-- While building package regex-pcre-0.94.4 using:
/home/adam/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 configure --with-ghc=/home/adam/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc --with-ghc-pkg=/home/adam/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/pkgdb --libdir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/lib --bindir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/bin --datadir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/share --libexecdir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/libexec --sysconfdir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/etc --docdir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/doc/regex-pcre-0.94.4 --htmldir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/doc/regex-pcre-0.94.4 --haddockdir=/home/adam/.stack/snapshots/x86_64-linux/lts-9.10/8.0.2/doc/regex-pcre-0.94.4 --dependency=array=array-0.5.1.1 --dependency=base=base-4.9.1.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=containers=containers-0.5.7.1 --dependency=regex-base=regex-base-0.93.2-AYjYAsBidAc8f5XNm9b2Aa
Process exited with code: ExitFailure 1
Logs have been written to: /home/adam/Python/duckling/3-pro/duckling/.stack-work/logs/regex-pcre-0.94.4.log

Configuring regex-pcre-0.94.4...
Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependency on a foreign
library:
* Missing C library: pcre
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
@rikvdkleij
Copy link

@rikvdkleij rikvdkleij commented Nov 4, 2018

I also ran into this issue on MacOS with stack 1.9.1. The files that stack wanted to download were downloadable via Chrome.

The stack build worked in a Docker container.

The next day still same problem without Docker.
After disabling the nix integration the build succeeded (while I already tried that before without success). Then after enabling the nix integration again that build also succeeded......

So now is the question: when will this happen again and how do I "solve" this issue then.

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 7, 2018

@SalAlba That looks like you need to install the relevant system library (that contains pcre).

@rikvdkleij It could be a cache issue — it would be helpful to see --verbose output.

@rikvdkleij
Copy link

@rikvdkleij rikvdkleij commented Nov 7, 2018

@dbaynard Thanks for your reply! When it happens again I will post the verbose output.

@ghost
Copy link

@ghost ghost commented Nov 13, 2018

when I execute the command:"stack build hlint",it turn out a line error like this:

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510

so I think if it is important to feeback this error?
the output is:

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
haskell-src-exts-util-0.2.3: download
haskell-src-exts-util-0.2.3: configure
conduit-1.3.1: download
haskell-src-exts-util-0.2.3: build
conduit-1.3.1: configure
aeson-1.3.1.1: copy/register
conduit-1.3.1: build
haskell-src-exts-util-0.2.3: copy/register
conduit-1.3.1: copy/register
yaml-0.8.32: download
yaml-0.8.32: configure
yaml-0.8.32: build
yaml-0.8.32: copy/register
hlint-2.1.10: download
hlint-2.1.10: configure
hlint-2.1.10: build
hlint-2.1.10: copy/register
Completed 24 action(s).

I retry it twice and finally finish it,I wonder it's because my network not well or some else thing?
I notice there is a :

         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510

so I just push this issues,hope be help。
=-=

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 13, 2018

@BearJean Would you please post the output of stack --version. What platform are you using?

@ghost
Copy link

@ghost ghost commented Nov 14, 2018

sorry I forget about it..
the version of my stack is:

Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2

and my OS is Windows10 and it;s version is 1809

and ,what I installed is HaskellPlatform-8.4.3-full-x86_64-setup

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 14, 2018

@BearJean Thanks. The changes to fix this issue have been released in stack 1.9.1 — I recommend that you download that.

@codygman
Copy link

@codygman codygman commented Nov 15, 2018

I'm using stack 1.9.1.

Codys-MBP:try-beam codygoodman$ stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0

Error:

Codys-MBP:try-beam codygoodman$ stack build
              
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 5 after a total delay of 3100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 5 after a total delay of 3100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 5 after a total delay of 3100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 5 after a total delay of 3100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 6 after a total delay of 6300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 6 after a total delay of 6300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 6 after a total delay of 6300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 6 after a total delay of 6300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
              
Warning: Retry number 7 after a total delay of 12700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
                                                                 
Warning: Retry number 7 after a total delay of 12700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
                                                                 
Warning: Retry number 7 after a total delay of 12700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
                                              
Warning: Retry number 7 after a total delay of 12700000 us
         If you see this warning and stack fails to download, but running the command again solves the problem, please
         report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack
         --version'
Progress 4/122                   
HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/hackage.fpcomplete.com/package/auto-update-0.1.4.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Protocol ("certificate rejected: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)",True,CertificateUnknown))))

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/hackage.fpcomplete.com/package/appar-0.1.4.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Protocol ("certificate rejected: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)",True,CertificateUnknown))))

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/hackage.fpcomplete.com/package/base-compat-0.9.3.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Protocol ("certificate rejected: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)",True,CertificateUnknown))))

HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/hackage.fpcomplete.com/package/Cabal-2.0.1.1.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Protocol ("certificate rejected: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)",True,CertificateUnknown))))
@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 15, 2018

Also @BearJean you may want to take a look at #4376

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 15, 2018

@codygman And to be clear, it worked the next time you tried it?

@codygman
Copy link

@codygman codygman commented Nov 15, 2018

@dbaynard No, it has failed 4 times in a row so far.

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 16, 2018

@codygman Thanks for your reply — if it hasn't succeeded then the connection is not flaky, and there is some other problem. I haven't seen that certificate error before — it looks like the issue is unlikely to be stack.

@linux0ne
Copy link

@linux0ne linux0ne commented Apr 5, 2019

brick-0.45: configure

Warning: Retry number 0 after a total delay of 0 us
If you see this warning and stack fails to download, but running the
command again solves the problem, please report here:
#3510 Make sure to
paste the output of 'stack --version'

stack --version
Version 1.9.3, Git revision 40cf7b3 (6211 commits) x86_64 hpack-0.31.1

@zmen
Copy link

@zmen zmen commented Sep 20, 2019

Stack version:

Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2

It happened when running stack ghci right after install stack

user@DESKTOP:~/code/hs% stack ghci
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download,
         but running the command again solves the problem,
         please report here:
         https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download,
         but running the command again solves the problem,
         please report here:
         https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download,
         but running the command again solves the problem,
         please report here:
         https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download,
         but running the command again solves the problem,
         please report here:
         https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'
ghc-8.6.5:  145.86 MiB / 215.78 MiB ( 67.60%) downloaded...
@prototact
Copy link

@prototact prototact commented Jan 1, 2020

Stack version:
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2

I have tried changing mirrors in ~/.stack/config.yaml but i keep getting ConnectionTimeOuts from
all sources

Warning: Exception occured when trying to perform binary upgrade: HttpExceptionRequest Request { host = "api.github.com" port = 443 secure = True requestHeaders = [("Accept","application/json"),("Accept","application/vnd.github.v3+json"),("User-Agent","The Haskell Stack")] path = "/repos/commercialhaskell/stack/releases/latest" queryString = "" method = "GET" proxy = Nothing rawBody = False redirectCount = 10 responseTimeout = ResponseTimeoutDefault requestVersion = HTTP/1.1 } ConnectionTimeout

and

Warning: Retry number 1 after a total delay of 100000 us If you see this warning and stack fails to download, but running the command again solves the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to paste the output of 'stack --version'

Apparently the issue is working with windows through WSL 2. It turnsout WSL 2 is connected through some virtual interface that is possibly blocked by Amazon S3. By reverting back to WSL 1 the issue is gone.

@mattaudesse
Copy link
Member

@mattaudesse mattaudesse commented Jan 1, 2020

Apparently the issue is working with windows through WSL 2. It turnsout WSL 2 is connected through some virtual interface that is possibly blocked by Amazon S3. By reverting back to WSL 1 the issue is gone.

Thanks for your note @orpheusgame - #5063 relates to the WSL 2 problem you mention and AFAIK we don't have a firm idea of what's going on yet.

@thuliu-yt16
Copy link

@thuliu-yt16 thuliu-yt16 commented Mar 23, 2020

Hi, I am new to haskell and some error occurred when running stack setup but two times rerunning this command solved the problem.

Error Output:

Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.6.5.

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 5 after a total delay of 3100000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 6 after a total delay of 6300000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 7 after a total delay of 12700000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'
HttpExceptionRequest Request {
  host                 = "github.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/fpco/minghc/blob/master/bin/7z.dll"
  queryString          = "?raw=true"
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Misc "Network.Socket.recvBuf: failed (No error)")))
Preparing to download 7z.dll ...


Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.
Downloaded 7z.dll.
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 5 after a total delay of 3100000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 6 after a total delay of 6300000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'

Warning: Retry number 7 after a total delay of 12700000 us
         If you see this warning and stack fails to download, but running the command again solves the
         problem, please report here: https://github.com/commercialhaskell/stack/issues/3510 Make sure to
         paste the output of 'stack --version'
HttpExceptionRequest Request {
  host                 = "github.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/fpco/minghc/blob/master/bin/7z.exe"
  queryString          = "?raw=true"
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed (Error_Misc "Network.Socket.recvBuf: failed (No error)")))

Stack version:

Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2

Platform: Windows 10 64bit
BTW, I am using Tsinghua stack mirror to accelerate downloading. Here is my config.yaml:

setup-info: "http://mirrors.tuna.tsinghua.edu.cn/stackage/stack-setup.yaml"
urls:
    latest-snapshot: http://mirrors.tuna.tsinghua.edu.cn/stackage/snapshots.json

package-indices:
  - download-prefix: http://mirrors.tuna.tsinghua.edu.cn/hackage/
    hackage-security:
        keyids:
        - 0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d
        - 1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42
        - 280b10153a522681163658cb49f632cde3f38d768b736ddbc901d99a1a772833
        - 2a96b1889dc221c17296fcc2bb34b908ca9734376f0f361660200935916ef201
        - 2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3
        - 51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921
        - 772e9f4c7db33d251d5c6e357199c819e569d130857dc225549b40845ff0890d
        - aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9
        - fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0
        key-threshold: 3 # number of keys required

        # ignore expiration date, see https://github.com/commercialhaskell/stack/pull/4614
        ignore-expiry: no

Hope this will help!

@asheshambasta
Copy link

@asheshambasta asheshambasta commented Mar 24, 2020

We're noticing the issue too:
While building in a docker image with stack version:

Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2

We're noticing that stack is unable to download GHC:

Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Preparing to download ghc-8.4.4 ...

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 2 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 3 after a total delay of 700000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'

Warning: Retry number 4 after a total delay of 1500000 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'
ghc-8.4.4: download has begun
ghc-8.4.4:    8.17 MiB / 144.87 MiB (  5.64%) downloaded...
ghc-8.4.4:   35.16 MiB / 144.87 MiB ( 24.27%) downloaded...
ghc-8.4.4:   61.75 MiB / 144.87 MiB ( 42.62%) downloaded...
ghc-8.4.4:   88.38 MiB / 144.87 MiB ( 61.00%) downloaded...
ghc-8.4.4:  115.34 MiB / 144.87 MiB ( 79.62%) downloaded...
ghc-8.4.4:  142.45 MiB / 144.87 MiB ( 98.33%) downloaded...
ghc-8.4.4:  144.87 MiB / 144.87 MiB (100.00%) downloaded...

But for some reason, the download starts to proceed after a few retries.

@stefjoosten
Copy link

@stefjoosten stefjoosten commented Dec 12, 2020

I have seen this issue too in stack version 1.9.3, Git revision 40cf7b3 (6211 commits) x86_64 hpack-0.31.1:

x509-validation-1.6.11: configure
x509-validation-1.6.11: build
x509-validation-1.6.11: copy/register
tls-1.4.1: download
tls-1.4.1: configure
tls-1.4.1: build
tls-1.4.1: copy/register
connection-0.3.1: download
connection-0.3.1: configure
connection-0.3.1: build
connection-0.3.1: copy/register

Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves
         the problem, please report here: https://github.com/commercialhaskell/stack/issues/3510
         Make sure to paste the output of 'stack --version'
xeno-0.3.5.2: download
xeno-0.3.5.2: configure
xeno-0.3.5.2: build
xeno-0.3.5.2: copy/register
xml-1.3.14: download
xml-1.3.14: configure

shortly after which the process got stuck. Just before I terminated the process, it looked like this for over an hour:
Schermafbeelding 2020-12-12 om 09 23 14

What I did

I ran a Dockerfile with the following contents:

FROM haskell:8.6 AS buildstage
RUN mkdir /opt/ampersand
WORKDIR /opt/ampersand

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git
    
# Start with a docker-layer that contains build dependencies, to maximize the reuse of these dependencies by docker's cache mechanism.
# Only updates to the files stack.yaml package.yaml will rebuild this layer; all other changes use the cache.
# Expect stack to give warnings in this step, which you can ignore.
# Idea taken from https://medium.com/permutive/optimized-docker-builds-for-haskell-76a9808eb10b
COPY stack.yaml package.yaml /opt/ampersand/
RUN stack build --dependencies-only

Running it again solved the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet