Skip to content

git freezes for 2 minutes. ipv6 disabled

UPD1: strace log 0.5MB here. Probably shoud've included microseconds.

UPD2: fucking systemd-resolved

UPD3: look at the end

Hi.

On my new install git behaves strangely. It freezes for 2 minutes on every run and it's not clear to me why, because there are no such problems on the other two machines (desktop and notebook).

My isp doesn't offer ipv6 and i don't need it either. So i disabled it (ipv6.disabled=1) using kernel parameters.

On desktop and notebook i use networkmanager, on new pc systemd-networkd and systemd-resolved (just to make /etc/resolv.conf from dhcp offered dns ips). My local network dns server (which is used on all machines) blocks ipv6 also.

Here is debug output from git on new pc (GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone https://aur.archlinux.org/systemd-numlockontty). Adding more git debug environment variables does not make the log more helpful.

Adding --ipv4 doesn't help either (git clone --ipv4 https://aur.archlinux.org/systemd-numlockontty).

/etc/resolv.conf:

$ cat /etc/resolv.conf 
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 192.168.1.1

resolving aur.archlinux.org:

$ dig aur.archlinux.org

; <<>> DiG 9.14.10 <<>> aur.archlinux.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14434
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1220
;; QUESTION SECTION:
;aur.archlinux.org.		IN	A

;; ANSWER SECTION:
aur.archlinux.org.	25445	IN	A	5.9.250.164

;; Query time: 0 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Mon Feb 03 15:47:57 MSK 2020
;; MSG SIZE  rcvd: 62

This is how it should be

$ time git clone https://aur.archlinux.org/systemd-numlockontty
Cloning into 'systemd-numlockontty'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 15 (delta 1), reused 15 (delta 1)
Unpacking objects: 100% (15/15), 3.02 KiB | 1.51 MiB/s, done.

real	0m0.415s
user	0m0.029s
sys	0m0.018s

And this is a problem:

$ time git clone https://aur.archlinux.org/systemd-numlockontty
Cloning into 'systemd-numlockontty'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 15 (delta 1), reused 15 (delta 1)
Unpacking objects: 100% (15/15), 3.02 KiB | 515.00 KiB/s, done.

real	2m0.575s
user	0m0.117s
sys	0m0.091s

#######################################

#######################################

"the end"

I don't remember exactly (bad memory; started digging this problem this morning) but i probably could ping archlinux.org . Now i can't. Anyway installing programs using pacman worked just fine - that's for sure.

Stopping systemd-resolved.service instantly solved freezing git and ping.

I used systemd-resolved only for creating resolv.conf using dhcp dns offering.

My router's dhcp server offers ip addresses, dns server and ntp server. What network config manager should i use? NetworkManager, dhcpcd? (only wired, no wifi).

Or maybe i should troubleshoot systemd-resolved? If only i know how to do this. Any ideas? (don't suggest to enable ipv6)

Edited 3 Feb 2020. We only hold this version.

2 points18 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
2 · 100% up
Kind
Text
ID
ey71ll

Author

5
posts
108
comments
0
media
View profile

23 comments

  1. Don't disable v6. Even if your ISP doesn't currently offer it, there's no good reason to be breaking v6 socket support in your kernel, or indeed to be filtering your DNS results. Just leave it alone.
  2. dig isn't a good debugger for name resolution issues, because it just does DNS queries. Use getent ahosts.
  3. Run git under strace -f and see where it hangs.
3 points
  1. Why not? Some programs will freeze for some time trying to connect to ipv6. Or someone could fuck with your system. I remember a few months ago there were a ton of lines in my router's firewall logs about someone else's router trying to advertise dlna services to me.

  2. Never heard of this getent. Only that on linux and *bsds dns servers should be in /etc/resolv.conf . Good to know.

  3. It's output looks like gibberish to me.

systemd-resolved is the one to blame.

1 points

If you aren't using systemd for network, make sure systemd-resolved isn't enabled/running. That's been the cause of 90% of the recent networking issues that I've seen.

2 points

systemd-networkd is not required to use systemd-resolved. OP says he's using networkd anyway.

EDIT: s/it/networkd/ for clarity.

2 points
unknown author6 hidden

Deleted before we saved it.

1 points

What network config manager should i use?

​

it's personal preference and use-case

I mean i was not aware of "make sure systemd-resolved isn't enabled/running. That's been the cause of 90% of the recent networking issues that I've seen". it makes no sense to use a program prone to breaking.

1 points

Or maybe i should troubleshoot systemd-resolved? If only i know how to do this. Any ideas?

You can use whatever works for you.

If you want to debug sd-resolved,resolvectl status is a good tool to inspect the state of sd-resolved.

You can enable debug reporting within the resolver by adding a a drop-in service file sudo systemctl edit systemd-resolved with the following content:

[Service]
Environment=SYSTEMD_LOG_LEVEL=debug

and recreate your query with resolvectl query.

The first thing to do is isolate where the problem actually occurs. Tools like ping might produce more queries than you expect. For example, does ping -n archlinux.org also exhibit the slow behavior? What if you disable dnssec, or the mDNS or LLMNR scopes in sd-resolved?

Your journal has timestamps. If you don't learn the reason for the delay with the above you should be able to see what queries sd-resolved tries and when in your journal when debugging is enabled.

1 points

You can use whatever works for you.

Answer. Sorry, it's hard to write in english. I think I spend as much time writing answers as I do actually solving a problem.

​

If you want to debug sd-resolved,resolvectl status is a good tool to inspect the state of sd-resolved.

I thought systemd-resolved creates resolv.conf (nameserver 192.168.1.1 from dhcp) and stub-resolv.conf (nameserver 127.0.0.53) and acts like local dns resolver if you symlink second file to /etc/resolv.conf. I've created symlink to first file. But why some programs don't respect /etc/resolv.conf? Why they are trying to use systemd-resolved as a dns resolver? aria2c can download files with no problems, but git, ping, getent ahosts archlinux.org freezing for 2min and then continue their job.

$ time ping -Onc3 archlinux.org
PING archlinux.org (138.201.81.199) 56(84) bytes of data.
64 bytes from 138.201.81.199: icmp_seq=1 ttl=63 time=39.9 ms
64 bytes from 138.201.81.199: icmp_seq=2 ttl=63 time=40.1 ms
64 bytes from 138.201.81.199: icmp_seq=3 ttl=63 time=39.8 ms

--- archlinux.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 39.830/39.920/40.061/0.100 ms

real	2m2.083s
user	0m0.017s
sys	0m0.006s

2min freeze, then 3 pings sent in 2 seconds, no lost packets (-O option).

​

What if you disable dnssec

Dunno, my router's dns server working just fine.

dig @192.168.1.1 sigok.verteiltesysteme.net +dnssec return ip address and signature

dig @192.168.1.1 sigok.verteiltesysteme.net +dnssec gives SERVFAIL

Browser based tests (https://dnssec.vs.uni-due.de/ and http://www.dnssec-or-not.com/) are ok, http://www.dnssec-failed.org/ does not open. Browser tests from my desktop, not from troublesome pc, don't have gui there.

​

OK, i'll add debugging variable to service.

1 points

I thought systemd-resolved creates resolv.conf (nameserver 192.168.1.1 from dhcp) and stub-resolv.conf (nameserver 127.0.0.53) and acts like local dns resolver if you symlink second file to /etc/resolv.conf. I've created symlink to first file. But why some programs don't respect /etc/resolv.conf? Why they are trying to use systemd-resolved as a dns resolver?

Err, not quite.

Most applications, but not all, perform their hostname requests through the libc getaddrinfo(3) call, which on Arch is provided by glibc. glibc implements getaddrinfo through a complex set of shared libraries called the Name Service Switch which defines a set of databases to be queried and services to fulfill those queries.

sd-resolved provides an nss service "resolve" which you should use if you are intend to use sd-resolved as your system resolver. The relevant configuration is the hosts line in your /etc/nsswitch.conf. See man nss-resolve.

/etc/resolv.conf does not matter to sd-resolved, but it does provide resolv.conf for basic compatibility with other software that does not use getaddrinfo. resolv.conf is normally referenced by the standard dns nss service, but resolved can provide more functions than the dns service can so it creates a dynamic resolv.conf which is useful for symlinking from /etc/resolv.conf.

getent ahosts does the nss lookup for you with getaddrinfo, whereas dig just constructs it's own dns query to whatever server you specify. So getent ahosts more closely matches the expected behavior of your applications.

1 points

I’ve also disabled ipv6 and it works without problem. That should not be a problem I think

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.