stack new command failing to download build plan for lts-14.1
Asked Answered
K

3

25

Stack fails with a 404 HTTP status to download a build plan for lts-14.1:

$ stack new my-project

[...]

Downloading lts-14.1 build plan ...
RedownloadInvalidResponse Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-14.1.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 "/home/michid/.stack/build-plan/lts-14.1.yaml" (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Content-Security-Policy","default-src 'none'; style-src 'unsafe-inline'; sandbox"),("Strict-Transport-Security","max-age=31536000"),("X-Content-Type-Options","nosniff"),("X-Frame-Options","deny"),("X-XSS-Protection","1; mode=block"),("X-GitHub-Request-Id","10DA:4457:1D507:285B9:5D55DA2D"),("Content-Length","15"),("Accept-Ranges","bytes"),("Date","Thu, 15 Aug 2019 22:18:21 GMT"),("Via","1.1 varnish"),("Connection","keep-alive"),("X-Served-By","cache-mxp19828-MXP"),("X-Cache","MISS"),("X-Cache-Hits","0"),("X-Timer","S1565907502.529821,VS0,VE176"),("Vary","Authorization,Accept-Encoding"),("Access-Control-Allow-Origin","*"),("X-Fastly-Request-ID","9f869169dd207bbd8bb8a8fd4b274acf6580ba4f"),("Expires","Thu, 15 Aug 2019 22:23:21 GMT"),("Source-Age","0")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose})

Everything works fine if I specify --resolver lts-13.19 on the command line so I'm assuming this is a bug.

  • Anything I can do locally to work around this problem?
  • What is the best place to report the issue or check whether it is a known one? I came across https://github.com/commercialhaskell/stack but am not sure whether this is the right place.
Kenric answered 15/8, 2019 at 22:29 Comment(1)
that link is the right place to report problems with stack.Boole
K
50

To answer my own question:

Turns out I was using an old version of stack. After upgrading via

stack upgrade 

everything works as expected.

Kenric answered 16/8, 2019 at 9:13 Comment(2)
It would be very useful if you could tell us why that worked, e.g. which version of stack you used before, and which newer one fixed it, as we still have that problem here.Livia
Maybe this leading to this announcement?Livia
E
4

The error message is confusing because it doesn't say anything about the cause of the 404 error. It might be due to a wrong version of Stack. To check this, type:

stack --version

Not only this command will tell you which version is installed, but it will also tell you what is the most up to date version. If your version is not the most up to date, and moreover if your version is an "unsupported" one, it might display a message such as

Warning: this is an unsupported build that may use different versions of
dependencies and GHC than the officially released binaries, and therefore may
not behave identically.  If you encounter problems, please try the latest
official build by running 'stack upgrade --force-download'.

Just do as indicated and you should be OK:

stack upgrade --force-download

You might get a message saying that there had been an error while copying to /usr/bin, and asking if you want to retry with sudo. Just accept and enter you sudo password.

Check that the new upgraded version is now up to date by typing:

stack -version
Ectoblast answered 21/5, 2020 at 6:48 Comment(2)
Thanks for mentioning stack --version. This led me to figuring this out eventually. However, the error message is not helpful nor user friendly. There should be a clear message that the current version is not supported any more instead.Kenric
I really don't know how I ended with a non supported, out of date, hybrid version since I only installed stack about a week ago, on three different computers, all running the same OS (Ubuntu 20.4), following what seemed to me to be the same procedure. I had the problem on two computers and not on the third one. But in any case, it was the error message that made me found the solution. Certainly not friendly, but somewhat helpful, though.Ectoblast
C
-1

I had a similar case to OP, but after stack upgrade I still got the error; it went away only after starting a fresh terminal (on macOS).

Client answered 10/3, 2021 at 15:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.