-
Notifications
You must be signed in to change notification settings - Fork 710
cabal upload
throwing curl errors
#10252
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Thanks for the report! Does it reproduce with 3.10? |
yes |
Good. We should be catching more errors from auxiliary tools, for sure. But it's hard to do anytime meaningful if we don't understand the underlying issue. Are you behind any kind of proxy? Cf. curl/curl#6760 If we find what curl command cabal tried to execute, we could experiment further. Perhaps, running cabal with -v (-v3?) would reveal the exact command. If we know the command, running the same command with --trace log.txt as suggested in the ticket above could bring an insight... |
No. |
I just hit the same error while trying to upload documentation for a candidate release of
|
Possibly relatedly, my Ubuntu system just received updates to both BTW, |
I think in my case it would have helped to say "Hint: This curl error can occur when uploading haddocks for a package before uploading the package." |
TBH I think the technically correct thing here is to see if the server outputs error text before it runs its side of the transaction — but I'm not sure that's practical unless it is changed to always output text of some kind (which will of course break every older version of |
I triggered the error again this morning. See haskell/hackage-server#1070. I think it would be great to sort this out; I don't think I made an error while typing in my password because it came from the clipboard (from my password manager), and that same password worked while uploading the code of the package candidate. |
Yes, this is a major UX issue. Can we expedite this? |
FWIW it just reproduced fully for me locally when trying to upload a candidate for one of my packages:
(the |
When I googled this error earlier, it often appeared in conjunction with newlines in some request header. |
It may also depend on what's in any error message hackage-server might be throwing. It would be interesting to see the output of that |
@geekosaur I fail to run the copy-pasted If I remove the
|
When I run cabal with -v3 it gives away the stdin it provides curl with:
|
Running |
Well, at least it seems like the server rejects the request as unauthorised, and curl reports multiple issues, one of which is the one that I got:
It seems a bit weird that there is a newline in
. can you try without? Edit: Oh, that may just be the width of your terminal emulator window... |
mm, which line says that?
very true: my terminal is a little junky when it comes to breaking up lines so copy-pasting with it does not always work nicely. I updated the gist after running without the spurious newline as you suggest. |
@ulysses4ever, https://gist.github.com/ulysses4ever/602014e347df797f2f16a14edc0a9272#file-gistfile1-txt-L46. Note however that it's just doing an HTTP POST, so indeed it's not going to get that response until after the server receives it. The weird part there is that |
@sgraf812 re: the newline in http code: it does come from how
of course, it's not clear to me why it's there. But at least it's not an artifact of copy-pasting... |
Getting the same issue. Any solutions? |
Meanwhile this command can be used: curl -X PUT \
--header "Authorization: X-ApiKey <API Token>" \
-H "Content-Type: application/x-tar" \
-H 'Content-Encoding: gzip' \
--data-binary "@dist-newstyle/docs/XXXX-0.1.0.0-docs.tar.gz" \
https://hackage.haskell.org/package/XXXX-0.1.0.0/docs |
Hopefully this works around: haskell/cabal#10252
Hopefully this works around: haskell/cabal#10252
The workaround from @tusharad works also with |
And the following mutation of the workaround works for package candidates (sometimes?):
You may need
to see the docs without waiting forever. |
Same issue here @Mikolaj work around worked |
We should really open a hackage-server issue. The one referenced above (haskell/hackage-server#1070) has nothing to do with what we see here (that one is about .tar vs. .tgz mishmash, which also was fixed recently). |
if its an issue with how the server parses newlines in headers, then likely the non-cabal fix will have to be not in hackage itself, but upstream in happstack. |
This isn't going to be fixable on hackage-server -- its about curl args that don't affect the actual communication with the server. looks like the newline dates to here: 9591d95 The --write-out is to capture the resultant http code. Curl likely changed its behavior here. The issue the patch addressed was the http code didn't always have a newline. I suggest that we remove the newline before http_code (which new curl doesn't parse) and just fixup the processing in reading in the file with the resultant http status code. |
Describe the bug
Happens reproducibly.
To Reproduce
cabal v2-haddock --haddock-for-hackage --enable-doc --haddock-options=--quickjump
cabal upload --publish -d dist-newstyle/file-io-0.1.3-docs.tar.gz
Expected behavior
cabal upload
should work or have actual error handling.System information
cabal
3.12.1.0,ghc
9.8.2The text was updated successfully, but these errors were encountered: