Subject: Weird error on guix download ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz

From: Danny Milosavljevic <[email-masked]>
Date: Wed, 19 Aug 2020 13:17:58 +0200

Hi,

I get the following weird error on

  guix download ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz

Starting download of /tmp/guix-file.PnA5jm
From ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz...
In procedure connect*: Permission denied
failed to download "/tmp/guix-file.PnA5jm" from "ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz"
guix download: error: ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz: download failed

strace -f -s 0:

[pid 16141] connect(16, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0
[pid 16141] sendto(16, ""..., 21, MSG_NOSIGNAL, NULL, 0) = 21
[pid 16141] poll([...], 1, 5000)        = 1 ([...])
[pid 16141] recvmsg(16, {msg_name=NULL, msg_namelen=0, msg_iov=[...], msg_iovlen=2, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[...]}], msg_controllen=20, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 17
[pid 16141] mmap(NULL, 217032, PROT_READ, MAP_SHARED, 17, 0) = 0x7f8ad32db000
[pid 16141] close(17)                   = 0
[pid 16141] close(16)                   = 0
[pid 16141] openat(AT_FDCWD, "/etc/gai.conf", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid 16141] futex(0x7f8ad809b5c4, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid 16141] socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 16
[pid 16141] connect(16, {sa_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr("8.43.85.97")}, 16) = 0
[pid 16141] getsockname(16, {sa_family=AF_INET, sin_port=htons(57279), sin_addr=inet_addr("192.168.10.207")}, [28->16]) = 0
[pid 16141] close(16)                   = 0
[pid 16141] socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 16
[pid 16141] connect(16, {sa_family=AF_INET6, sin6_port=htons(21), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2620:52:3:1:0:246e:9693:128c", &sin6_addr), sin6_scope_id=0}, 28) = 0
[pid 16141] getsockname(16, {sa_family=AF_INET6, sin6_port=htons(42412), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2a02:8388:281:94f0::93b", &sin6_addr), sin6_scope_id=0}, [28]) = 0
[pid 16141] close(16)                   = 0
[pid 16141] socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 16
[pid 16141] fcntl(16, F_GETFL)          = 0x2 (flags O_RDWR)
[pid 16141] fcntl(16, F_SETFL, O_RDWR|O_NONBLOCK) = 0
[pid 16141] connect(16, {sa_family=AF_INET6, sin6_port=htons(21), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2620:52:3:1:0:246e:9693:128c", &sin6_addr), sin6_scope_id=0}, 28) = -1 EINPROGRESS (Operation now in progress)
[pid 16141] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16141] select(17, [3], [16], [16], {tv_sec=10, tv_usec=0}) = 1 (out [16], left {tv_sec=9, tv_usec=880026})
[pid 16141] fcntl(16, F_SETFL, O_RDWR)  = 0
[pid 16141] getsockopt(16, SOL_SOCKET, SO_ERROR, [0], [8->4]) = 0
[pid 16141] fstat(16, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
[pid 16141] read(16, ""..., 4096)       = 40
[pid 16141] brk(0x1385000)              = 0x1385000
[pid 16141] brk(0x137d000)              = 0x137d000
[pid 16141] brk(0x1375000)              = 0x1375000
[pid 16141] brk(0x136d000)              = 0x136d000
[pid 16141] write(16, ""..., 16)        = 16
[pid 16141] read(16, ""..., 4096)       = 34
[pid 16141] write(16, ""..., 23)        = 23
[pid 16141] read(16, ""..., 4096)       = 23
[pid 16141] write(16, ""..., 8)         = 8
[pid 16141] read(16, ""..., 4096)       = 31
[pid 16141] write(16, ""..., 33)        = 33
[pid 16141] read(16, ""..., 4096)       = 13
[pid 16141] write(16, ""..., 7)         = 7
[pid 16141] read(16, ""..., 4096)       = 37
[pid 16141] write(16, ""..., 9)         = 9
[pid 16141] read(16, ""..., 4096)       = 37
[pid 16141] write(16, ""..., 10)        = 10
[pid 16141] read(16, ""..., 4096)       = 37
[pid 16141] write(16, ""..., 8)         = 8
[pid 16141] read(16, ""..., 4096)       = 31
[pid 16141] write(16, ""..., 6)         = 6
[pid 16141] read(16, ""..., 4096)       = 45
[pid 16141] socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP) = 17
[pid 16141] fcntl(17, F_GETFL)          = 0x2 (flags O_RDWR)
[pid 16141] fcntl(17, F_SETFL, O_RDWR|O_NONBLOCK) = 0
[pid 16141] connect(17, {sa_family=AF_INET6, sin6_port=htons(27421), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2620:52:3:1:0:246e:9693:128c", &sin6_addr), sin6_scope_id=0}, 28) = -1 EINPROGRESS (Operation now in progress)
[pid 16141] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16141] select(18, [3], [17], [17], {tv_sec=10, tv_usec=0}) = 1 (out [17], left {tv_sec=9, tv_usec=880751})
[pid 16141] fcntl(17, F_SETFL, O_RDWR)  = 0
[pid 16141] getsockopt(17, SOL_SOCKET, SO_ERROR, [EACCES], [8->4]) = 0
[pid 16141] write(2, ""..., 41In procedure connect*: Permission denied
)         = 41
[pid 16141] write(2, ""..., 97failed to download "/tmp/guix-file.X4QpoI" from "ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz"
)         = 97

This error is 100% reproducible every time on my laptop.

But:

$ ping6 2620:52:3:1:0:246e:9693:128c
PING 2620:52:3:1:0:246e:9693:128c (2620:52:3:1:0:246e:9693:128c): 56 data bytes
64 bytes from server2.sourceware.org: icmp_seq=0 ttl=49 time=119,991 ms
$ telnet 2620:52:3:1:0:246e:9693:128c ftp
Trying 2620:52:3:1:0:246e:9693:128c...
Connected to 2620:52:3:1:0:246e:9693:128c.
Escape character is '^]'.
220 Welcome to sourceware FTP service.
$ ncftpget ftp://sourceware.org/pub/lvm2/LVM2.2.03.10.tgz
This one succeeds, but it also uses IPv4 and doesn't use the same IPv6 address 2620:52:3:1:0:246e:9693:128c from above.