Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

HTTP error 100 shown when uploading large store paths #19

Open
flokli opened this issue Dec 11, 2021 · 4 comments
Open

HTTP error 100 shown when uploading large store paths #19

flokli opened this issue Dec 11, 2021 · 4 comments

Comments

@flokli
Copy link
Owner

flokli commented Dec 11, 2021

Moved from #17 (comment) (cc @ajs124)

warning: error: unable to upload 'http://[::1]:9000/nar/1yfga509smsrx1l8a4dnri551qy3kw0859w5gmc0j3vcxvwbdkvk.nar': HTTP error 100 ('Continue') (curl error: Server returned nothing (no headers, no data)); retrying in 253 ms
warning: error: unable to upload 'http://[::1]:9000/nar/1yfga509smsrx1l8a4dnri551qy3kw0859w5gmc0j3vcxvwbdkvk.nar': HTTP error 100 ('Continue') (curl error: Server returned nothing (no headers, no data)); retrying in 532 ms
warning: error: unable to upload 'http://[::1]:9000/nar/1yfga509smsrx1l8a4dnri551qy3kw0859w5gmc0j3vcxvwbdkvk.nar': HTTP error 100 ('Continue') (curl error: Server returned nothing (no headers, no data)); retrying in 1183 ms
warning: error: unable to upload 'http://[::1]:9000/nar/1yfga509smsrx1l8a4dnri551qy3kw0859w5gmc0j3vcxvwbdkvk.nar': HTTP error 100 ('Continue') (curl error: Server returned nothing (no headers, no data)); retrying in 2625 ms
error: while uploading to HTTP binary cache at 'http://[::1]:9000': error: unable to upload 'http://[::1]:9000/nar/1yfga509smsrx1l8a4dnri551qy3kw0859w5gmc0j3vcxvwbdkvk.nar': HTTP error 100 ('Continue') (curl error: Server returned nothing (no headers, no data))

That might be Nix starting the HTTP PUT, but then not sending any data (presumably as it's still busy assembling the .nar file), and nix-casync nagging the client to keep sending data.

I've seen these error messages before, but they disappeared after increasing some timeouts.

I'm not sure if there's much that can be done on the nix-casync side, or whether that needs to be fixed in Nix.

@dasJ
Copy link

dasJ commented Jan 12, 2022

I dug into this a bit. Looks like go respects the Expect header [1] [2] and libcurl (used by nix as a HTTP client) sends it by default.

@dasJ
Copy link

dasJ commented Jan 12, 2022

Maybe you can immediately do r.Header.Del("Expect")?

@flokli
Copy link
Owner Author

flokli commented Jan 12, 2022

Maybe you can immediately do r.Header.Del("Expect")?

I'm not sure I can, from inside a individual handler - that's too late, and I can't edit the request before https://cs.opensource.google/go/go/+/refs/tags/go1.17.6:src/net/http/server.go;l=1904;drc=refs%2Ftags%2Fgo1.17.6 is run, no?

@dasJ
Copy link

dasJ commented Feb 3, 2022

Probably easiest to open a Nix issue about this. Saying to expect a 100 response while not being able to properly handle it sounds like a bug to me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants