unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: John Darrington <john@darrington.wattle.id.au>
Cc: guix-devel@gnu.org
Subject: Zero-length files cached by nginx
Date: Tue, 03 Jan 2017 14:16:23 +0100	[thread overview]
Message-ID: <87a8b85lnc.fsf@gnu.org> (raw)
In-Reply-To: <20170103081718.GA1660@jocasta.intra> (John Darrington's message of "Tue, 3 Jan 2017 09:17:18 +0100")

John Darrington <john@darrington.wattle.id.au> skribis:

> and if I try to manually download https://mirror.hydra.gnu.org/nar/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import
>
> I get a zero length file. :(

Indeed:

--8<---------------cut here---------------start------------->8---
$ wget -q -O - https://mirror.hydra.gnu.org/nar/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import |wc -c
0
$ wget -q -O - https://hydra.gnu.org/nar/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import |wc -c
0
--8<---------------cut here---------------end--------------->8---

So the problem is that nginx on hydra.gnu.org cached a zero-length file,
and then nginx on mirror.hydra.gnu.org cached that too.

On hydra.gnu.org, we have:

--8<---------------cut here---------------start------------->8---
/var/cache/nginx/nar# cat 09/87d4a93959df3b0c82baed615b578109
X��������:kX`��
KEY: http://127.0.0.1:3000/nar/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import
HTTP/1.1 200 OK
Content-Type: application/x-nix-archive
Set-Cookie: hydra_session=437ad1277e047114d0a49212805fd1867c0cf914; path=/; expires=Tue, 10-Jan-2017 05:43:20 GMT; HttpOnly
Transfer-Encoding: chunked
Date: Tue, 03 Jan 2017 05:43:43 GMT
Connection: close

--8<---------------cut here---------------end--------------->8---

Hydra (the software) produces HTTP chunked-encoded nars, as can be seen
above.

Rereading <https://tools.ietf.org/html/rfc2616#section-3.6.1>, it seems
that HTTP clients can detect truncated chunks, but they cannot detect
missing chunks since the total number of chunks is unknown and the
trailer is optional.

Presumably, what happened is that hydra.gnu.org was loaded and Hydra
dropped the connection, and then nginx cached what it got (i.e.,
nothing.)

Seems like the only way to fix it is by using ‘Content-Length’.  At the
very least, we should do that in ‘guix publish’.

For now, I’ve removed the faulty cached item from the nginx cache on
both machines.

Thanks,
Ludo’.

      parent reply	other threads:[~2017-01-03 13:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03  8:17 Empty file in hydra store? John Darrington
2017-01-03 12:57 ` Jan Synáček
2017-01-03 13:16 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8b85lnc.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=john@darrington.wattle.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).