From: ludo@gnu.org (Ludovic Courtès)
To: David Thompson <dthompson2@worcester.edu>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Invalid nar signature
Date: Thu, 15 Jan 2015 10:51:16 +0100 [thread overview]
Message-ID: <87zj9k74ob.fsf@gnu.org> (raw)
In-Reply-To: <87mw5kkbue.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Wed, 14 Jan 2015 21:38:01 -0500")
[-- Attachment #1: Type: text/plain, Size: 3389 bytes --]
David Thompson <dthompson2@worcester.edu> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
[...]
>> 2. strace the substituter and/or ‘guix publish’ to see exactly what
>> happens on the wire. Is the end-of-file marker string sent? Is it
>> received? etc.
>
> Here's a snippet of the strace output:
>
> http://192.168.1.157/.../iw3jn6a1avv78pp5v2cv42vyh0d8zi0g-guile-toxcore-0.1-6a9fbe0 94.1% of 127.5 KiB) = 104
> read(10, "vector tox-max-status-message-le"..., 7728) = 117
> read(10, " "..., 7611) = 1448
> read(10, "t-last-online (unwrap-tox tox) f"..., 6163) = 1448
> read(10, "tox tox) nospam))\n\n(define/unwra"..., 4715) = 1448
> read(10, " friend-number group-number)))\n\n"..., 3267) = 1448
> read(10, ")))\n (if (negative? result)\n "..., 1819) = 1819
> http://192.168.1.157/.../iw3jn6a1avv78pp5v2cv42vyh0d8zi0g-guile-toxcore-0.1-6a9fbe0 100.0% of 127.5 KiB) = 104
> http://192.168.1.157/.../iw3jn6a1avv78pp5v2cv42vyh0d8zi0g-guile-toxcore-0.1-6a9fbe0 100.0% of 127.5 KiB) = 104
> brk(0x41875000) = 0x41875000
> mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3d2aaaf000
> mremap(0x7f3d2aaaf000, 135168, 266240, MREMAP_MAYMOVE) = 0x7f3d2aa6e000
> mremap(0x7f3d2aa6e000, 266240, 528384, MREMAP_MAYMOVE) = 0x7f3d2a9ed000
> mremap(0x7f3d2a9ed000, 528384, 430080, MREMAP_MAYMOVE) = 0x7f3d2a9ed000
> munmap(0x7f3d2a9ed000, 430080) = 0
> http://192.168.1.157/.../iw3jn6a1avv78pp5v2cv42vyh0d8zi0g-guile-toxcore-0.1-6a9fbe0 100.0% of 127.5 KiB) = 104
> open("/gnu/store/72qm7kc9phvsiw6j7xgn1ii0f6s9mx8i-guix-0.8.3b09332/share/locale/en_US.UTF-8/LC_MESSAGES/guix.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/gnu/store/72qm7kc9phvsiw6j7xgn1ii0f6s9mx8i-guix-0.8.3b09332/share/locale/en_US.utf8/LC_MESSAGES/guix.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/gnu/store/72qm7kc9phvsiw6j7xgn1ii0f6s9mx8i-guix-0.8.3b09332/share/locale/en_US/LC_MESSAGES/guix.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/gnu/store/72qm7kc9phvsiw6j7xgn1ii0f6s9mx8i-guix-0.8.3b09332/share/locale/en.UTF-8/LC_MESSAGES/guix.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/gnu/store/72qm7kc9phvsiw6j7xgn1ii0f6s9mx8i-guix-0.8.3b09332/share/locale/en.utf8/LC_MESSAGES/guix.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/gnu/store/72qm7kc9phvsiw6j7xgn1ii0f6s9mx8i-guix-0.8.3b09332/share/locale/en/LC_MESSAGES/guix.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
> write(2, "guix substitute-binary: error: i"..., 62guix substitute-binary: error: invalid nar end-of-file marker
> ) = 62
> exit_group(1) = ?
> +++ exited with 1 +++
Normally, when the error happens, the substituter has already created at
least one file in the target directory,
/gnu/store/iw3jn6a1avv78pp5v2cv42vyh0d8zi0g-guile-toxcore-0.1-6a9fbe0.
Could you apply the patch below, and then run:
rm -rf foo
./pre-inst-env guix substitute-binary --substitute \
/gnu/store/iw3jn6a1avv78pp5v2cv42vyh0d8zi0g-guile-toxcore-0.1-6a9fbe0 \
$PWD/foo > stdout
ls -lRa foo > ls-R
and then send ‘stdout’ and ‘ls-R’?
Could you also check if the files in ‘foo’ look corrupt or anything?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1387 bytes --]
diff --git a/guix/serialization.scm b/guix/serialization.scm
index 64eacf9..d3bdea3 100644
--- a/guix/serialization.scm
+++ b/guix/serialization.scm
@@ -292,19 +292,21 @@ Restore it as FILE."
(define (read-eof-marker)
(match (read-string port)
(")" #t)
- (x (raise
+ (x
+ (pk 'bad-eof x)
+ (raise
(condition
(&message (message "invalid nar end-of-file marker"))
(&nar-read-error (port port) (file file) (token x)))))))
(match (list (read-string port) (read-string port) (read-string port))
(("(" "type" "regular")
- (call-with-output-file file (cut read-contents port <>))
+ (call-with-output-file (pk 'reg file) (cut read-contents port <>))
(read-eof-marker))
(("(" "type" "symlink")
(match (list (read-string port) (read-string port))
(("target" target)
- (symlink target file)
+ (symlink target (pk 'symlink file))
(read-eof-marker))
(x (raise
(condition
@@ -312,7 +314,7 @@ Restore it as FILE."
(&nar-read-error (port port) (file file) (token x)))))))
(("(" "type" "directory")
(let ((dir file))
- (mkdir dir)
+ (mkdir (pk 'dir dir))
(let loop ((prefix (read-string port)))
(match prefix
("entry"
[-- Attachment #3: Type: text/plain, Size: 623 bytes --]
> Despite that, I tried to compress the nar with bzip2 just for fun, but I
> ran into another problem:
>
> warning: call to primitive-fork while multiple threads are running;
> further behavior unspecified. See "Processes" in the
> manual, for more information.
>
> I'm running a REPL server in addition to the web server, but I imagine
> the web server also spawns additional threads to handle requests, so
> either way 'filtered-output-port' won't work here.
(web server http) does not use threads so it should be OK. But we’ll
see that afterwards. :-)
Thanks,
Ludo’.
next prev parent reply other threads:[~2015-01-15 9:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 2:22 Invalid nar signature David Thompson
2014-12-15 2:33 ` David Thompson
2014-12-15 17:19 ` Ludovic Courtès
2014-12-15 20:08 ` Thompson, David
2014-12-15 21:20 ` Ludovic Courtès
2014-12-15 21:24 ` Thompson, David
2014-12-15 22:49 ` David Thompson
2014-12-16 17:07 ` Ludovic Courtès
2015-01-15 2:38 ` David Thompson
2015-01-15 9:51 ` Ludovic Courtès [this message]
2015-01-15 13:39 ` Thompson, David
2015-01-15 16:22 ` Ludovic Courtès
2015-01-15 17:23 ` Thompson, David
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zj9k74ob.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=dthompson2@worcester.edu \
--cc=guix-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.