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

[ERROR] Could not update repository "default": OpamDownload.Download_fail Curl failed #6162

Closed
winds365 opened this issue Aug 18, 2024 · 3 comments

Comments

@winds365
Copy link

<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><> 🐫
02:44.937 PARALLEL Iterate over 1 task(s) with 3 process(es)
02:44.937 PARALLEL Starting job 0 (worker 1/3): 0
02:44.937 REPOSITORY update default from https://opam.ocaml.org
02:44.937 CURL pull-repo-update
02:44.938 SYSTEM mkdir C:\Users\winds\AppData\Local\opam\repo\default.new
02:44.939 SYSTEM mkdir C:\Users\winds\AppData\Local\Temp\opam-15492-bb96f1
02:44.940 PARALLEL Next task in job 0: C:\WINDOWS\system32\curl.exe --write-out %{http_code}\n --retry 3 --retry-delay 2 --user-agent opam/2.2.0 -L -o C:\Users\winds\AppData\Local\Temp\opam-15492-bb96f1\index.tar.gz.part -- https://opam.ocaml.org/index.tar.gz
Processing 1/1: [default: http]

  • C:\WINDOWS\system32\curl.exe "--write-out" "%{http_code}\n" "--retry" "3" "--retry-delay" "2" "--user-agent" "opam/2.2.0" "-L" "-o" "C:\Users\winds\AppData\Local\Temp\opam-15492-bb96f1\index.tar.gz.part" "--" "https://opam.ocaml.org/index.tar.gz"
  • 000
  • % Total % Received % Xferd Average Speed Time Time Time Current
  •                              Dload  Upload   Total   Spent    Left  Speed
    
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
  • curl: (43) A libcurl function was given a bad argument
    02:45.529 PARALLEL Collected task for job 0 (ret:43)
    02:45.529 SYSTEM rm C:\Users\winds\AppData\Local\Temp\opam-winds-15492\dl-15492-be8644
    02:45.529 CURL Could not download file at https://opam.ocaml.org/index.tar.gz.
    02:45.529 SYSTEM rmdir C:\Users\winds\AppData\Local\Temp\opam-15492-bb96f1
    02:45.530 SYSTEM rmdir C:\Users\winds\AppData\Local\opam\repo\default.new
    [ERROR] Could not update repository "default": OpamDownload.Download_fail(_, "Curl failed:
    "C:\\WINDOWS\\system32\\curl.exe --write-out %{http_code}\\n --retry 3 --retry-delay 2 --user-agent
    opam/2.2.0 -L -o C:\\Users\\winds\\AppData\\Local\\Temp\\opam-15492-bb96f1\\index.tar.gz.part --
    https://opam.ocaml.org/index.tar.gz\" exited with code 43")
    02:45.530 PARALLEL Job 0 finished
    02:45.530 SYSTEM rmdir C:\Users\winds\AppData\Local\opam
    [ERROR] Initial download of repository failed.
    'opam init -vvv --debug-level=3' failed.

C:\Users\winds>curl -V
curl 8.8.0 (Windows) libcurl/8.8.0 Schannel zlib/1.3 WinIDN
Release-Date: 2024-05-22
Protocols: dict file ftp ftps http https imap imaps ipfs ipns mqtt pop3 pop3s smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets

@winds365
Copy link
Author

Windows version 22631.4037

@elazarg
Copy link

elazarg commented Aug 18, 2024

See #6120

@kit-ty-kate
Copy link
Member

As mentioned in #6142 (comment) the issue is that Windows 11 currently ships with a broken curl binary and doesn't work for opam at all. You can fix that by either installing a newer version of curl (8.9.0 fixes the issue) manually or removing your opam root and calling:

opam init --cygwin-internal-install --cygwin-extra-packages=curl

I'll close this since it's a duplicate of #6120 but if you still have issues with those fixes feel free to add a comment on that issue. Thanks for the report!

@kit-ty-kate kit-ty-kate closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants