Skip to content

stack new requires network to work #3850

@vincenthz

Description

@vincenthz

General summary/comments (optional)

without a network connection, stack new just fails to download a template, even though the template already exists in the template directory.

Expected

stack new try to download (update ? refresh cache ?) the template, but fallback to the existing template

 ls ~/.stack/templates/ -lh
total 8.0K
-rw-------. 1 user user 3.8K Feb  5 18:58 new-template.hsfiles
-rw-------. 1 user user   42 Feb  5 18:58 new-template.hsfiles.etag

Actual

$ stack new bla
Downloading template "new-template" to create project "bla" in bla/ ...

Warning: Retry number 0 after a total delay of 0 us
....
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","\"20199ac22a46c1b88a1e7e93f6555f4243430c44\"")]
  path                 = "/commercialhaskell/stack-templates/master/new-template.hsfiles"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo: does not exist (Try again))

Stack version

$ stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions