Closed vagarenko closed 5 years ago
It dies when trying to parse HTTP status code in the server response, in statusParseFail
. I'd try debugging this by running the powershell download script manually.
Maybe something funny is going on with server configuration. Looks like there's no way to force update
to use a specific mirror, unfortunately...
@vagarenko just as a workaround, what if you use cabal --http-transport=plain-http update
?
@23Skidoo how would specifiying the mirror to use help here? the same error occurs with all 3 mirrors it cycles through automatically
@hvr Thanks, I didn't catch that.
@hvr
just as a workaround, what if you use
cabal --http-transport=plain-http update ?
This works, thanks. Adding wget
or curl
to Path
also works.
@23Skidoo
I'd try debugging this by running the powershell download script manually.
Where can I find that script?
@vagarenko It's assembled on the fly by the PowerShell transport. See here: https://github.com/haskell/cabal/blob/14c25d703a84e4c30f191f6a0b501d2c34a74479/cabal-install/Distribution/Client/HttpUtils.hs#L537
So I'd make it print out the script to stdout or a file, recompile cabal-install, and then try running the saved script by hand.
@23Skidoo I'm starting to wonder if the powershell transport ever worked...
That log shows powershell-1.0 being used. I'm pretty sure the script only works with 2.0 or above. We could document this better, or add a test I suppose?
Here's a list of which powershell versions come with which oses https://4sysops.com/archives/powershell-versions-and-their-windows-version/#powershell-and-windows-versions
This seems to be fixed in cabal-install-2.0.0.1
Hmm, I wonder which commit fixed it. @AndreasPK can you actually reproduce the issue with 2.0.0.0?
Not anymore.
I replaced the executable when I upgraded and if I rebuild it now it works. So either my executable was bogus or it was a change in the Environment.
Edit: When I rebuild cabal-install-2.0.0.0 now it works as well. So most likely a Environment issue in my case. I tried rebuilding it with Cabal 2.0.0.2, 2.0.1.0 and 2.0.1.1 as well so no can't really reproduce the issue anymore sadly.
@AndreasPK Hmm, OK. Probably caused by wrong PowerShell version, as @gbaz says.
@gbaz Can we make using --transport=powershell
an error when PowerShell's version is wrong?
@23Skidoo
Edit: Fails on up to date cabal as well
... > cabal update -v3
no user package environment file found at
D:\Uni\03_bac\code\ghc_patterns\pattern_benchmarks
Downloading the latest package list from hackage.haskell.org
Searching for curl in path.
Cannot find curl on the path
Searching for powershell in path.
Found powershell at C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
Searching for wget in path.
Cannot find wget on the path
Selected http transport implementation: powershell
Selected mirror http://hackage.haskell.org/
Downloading timestamp
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Downloading snapshot
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Updating index
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Exception dieVerbatim: user error (CallStack (from HasCallStack):
die', called at .\Distribution\Client\HttpUtils.hs:744:5 in
main:Distribution.Client.HttpUtils
cabal.exe: Failed to download http://hackage.haskell.org/01-index.tar.gz : No
Status Code could be parsed from response: An exception occurred during a
WebClient request.
) when using mirror http://hackage.haskell.org/
Selected mirror http://hackage.fpcomplete.com/
Downloading timestamp
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Downloading snapshot
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Updating index
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Exception dieVerbatim: user error (CallStack (from HasCallStack):
die', called at .\Distribution\Client\HttpUtils.hs:744:5 in
main:Distribution.Client.HttpUtils
cabal.exe: Failed to download http://hackage.fpcomplete.com/01-index.tar.gz :
No Status Code could be parsed from response: An exception occurred during a
WebClient request.
) when using mirror http://hackage.fpcomplete.com/
Selected mirror http://objects-us-west-1.dream.io/hackage-mirror/
Downloading timestamp
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Downloading snapshot
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
Updating index
"C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" "-InputFormat" "None" "-ExecutionPolicy" "bypass" "-NoProfile" "-NonInteractive" "-Command" "-"
dieVerbatim: user error (CallStack (from HasCallStack):
die', called at .\Distribution\Client\HttpUtils.hs:744:5 in main:Distribution.Client.HttpUtils
cabal.exe: Failed to download
http://objects-us-west-1.dream.io/hackage-mirror/01-index.tar.gz : No Status
Code could be parsed from response: An exception occurred during a WebClient
request.
)
This is however on Windows10.
While the directory is called v1.0 the Powershell version is 5.1
$Host.Version
Major Minor Build Revision
----- ----- ----- --------
5 1 16299 64
Cabal version:
cabal-install version 2.0.0.1
compiled using version 2.0.1.1 of the Cabal library
@AndreasPK
$Host.Version
According to https://stackoverflow.com/questions/1825585/determine-installed-powershell-version, $Host.Version
is not reliable and one should apparently use $PSVersionTable.PSVersion
.
@23Skidoo PSVersion reports the same version.
$PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 16299 64
same for
Major Minor Build Revision
----- ----- ----- --------
5 1 16299 248
cabal --http-transport=plain-http update
did work
For me using cabal --http-transport=plain-http update
broke it. cabal.exe got moved from AppData\Roaming\local\bin
to AppData\Roaming\cabal\bin
which isn't on the path. Workaround is to add a symlink %AppData%\local\bin\cabal.exe %AppData%\cabal\bin\cabal.exe
.
for the record, the latest cabal-install-2.2.0.0
is supposed to have its powershell transport mode fixed and work out of the box as expected.
I couldn't update the cabal in windows 10. I am getting the below error
cabal update
Warning: The update command is a part of the legacy v1 style of cabal usage.
Please switch to using either the new project style and the new-update command
or the legacy v1-update alias as new-style projects will become the default in
the next version of cabal-install. Please file a bug if you cannot replicate a
working v1- use case with the new-style commands.
For more information, see: https://wiki.haskell.org/Cabal/NewBuild
Downloading the latest package list from hackage.haskell.org
To revert to previous state run:
cabal update --index-state='2019-10-16T11:31:42Z'
After updating the cabal and I have to install yesod.
@Annapooraniqxf2 That is not an error message, just a warning.
This error is showing up and preventing CircleCI+nix+Haskell builds for me on cabal-install-2.4.1.0
.
@tysonzero 2.4 is very old, could you update to 3.6?
@fgaz Possibly? We're locked on older versions of many things due to compile time perf regressions and TH bugs in GHCJS 8.10. Will get back to you.
On my windows 7 machine
cabal update
command failswhile
cabal get
command works fine:I tried this with firewall turned off and on with no difference