jgm/zip-archive

receive `403 forbidden` when downloading `zip-archive` with `cabal`

Closed this issue · 1 comments

Problem

I tried to build pandoc from source:

cd ~/oss
git clone https://github.com/jgm/pandoc
cd pandoc
cabal update
cabal install pandoc-cli

The install failed with this error:

cabal: Failed to download zip-archive-0.4.3 (which is required by exe:pandoc
from pandoc-cli-0.1). The exception was:
Unexpected response 403 for
http://objects-us-east-1.dream.io/hackage-mirror/package/zip-archive-0.4.3.tar.gz

I tried cabal get with verbose output:

ben@zagreus:~/oss/pandoc$ cabal get zip-archive -v3
no user package environment file found at /home/ben/oss/pandoc
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2023-03-15T01:34:46Z
Downloading  zip-archive-0.4.3
Writing
/home/ben/.cabal/packages/hackage.haskell.org/zip-archive/0.4.3/zip-archive-0.4.3.tar.gz
Selected mirror http://hackage.haskell.org/
Downloading package zip-archive-0.4.3
Searching for curl in path.
Found curl at /usr/bin/curl
Searching for powershell in path.
Cannot find powershell on the path
Searching for wget in path.
Found wget at /usr/bin/wget
Selected http transport implementation: curl
/usr/bin/curl 'http://hackage.haskell.org/package/zip-archive-0.4.3.tar.gz' --output /tmp/transportAdapterGet39717-1 --location --write-out '%{http_code}' --user-agent 'cabal-install/3.6.2.0 (linux; x86_64)' --silent --show-error --dump-header /tmp/curl-headers39717-2.txt
Exception Unexpected response 403 for
http://hackage.haskell.org/package/zip-archive-0.4.3.tar.gz when using mirror
http://hackage.haskell.org/
Selected mirror http://hackage.fpcomplete.com/
Downloading package zip-archive-0.4.3
/usr/bin/curl 'http://hackage.fpcomplete.com/package/zip-archive-0.4.3.tar.gz' --output /tmp/transportAdapterGet39717-4 --location --write-out '%{http_code}' --user-agent 'cabal-install/3.6.2.0 (linux; x86_64)' --silent --show-error --dump-header /tmp/curl-headers39717-5.txt
Exception Unexpected response 403 for
http://hackage.fpcomplete.com/package/zip-archive-0.4.3.tar.gz when using
mirror http://hackage.fpcomplete.com/
Selected mirror http://objects-us-east-1.dream.io/hackage-mirror/
Downloading package zip-archive-0.4.3
/usr/bin/curl 'http://objects-us-east-1.dream.io/hackage-mirror/package/zip-archive-0.4.3.tar.gz' --output /tmp/transportAdapterGet39717-7 --location --write-out '%{http_code}' --user-agent 'cabal-install/3.6.2.0 (linux; x86_64)' --silent --show-error --dump-header /tmp/curl-headers39717-8.txt
Unexpected response 403 for http://objects-us-east-1.dream.io/hackage-mirror/package/zip-archive-0.4.3.tar.gz

Workaround

For now I worked around the issue by putting the following in my pandoc/cabal.project:

source-repository-package
  type: git
  -- Normally this is a git URL, but a local path works too (but I think it must be absolute?):
  location: git@github.com:jgm/zip-archive.git
  -- Replace this with the commit you want to check out:
  tag: fa62708e998bf1b4b5da4bc83fed0607fce5fbd4

Conclusion

I'm not sure if this is a problem with zip-archive or with the Hackage mirrors. I am located in Japan but also tried with a US VPN, and received the same error. Other packages seem to install just fine. This is just an FYI, feel free to close it if you think it's not a zip-archive issue.

jgm commented

This isn't a problem with zip-archive, I think. I just cabal-installed it on my system without difficulty. (And there really isn't anything I can control that would affect this.) If you continue to have the problem, I'd inquire with Hackage folks.