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.
About this post
- Posted
- Archived
- Edited
- Score
- 2 · 100% up
- Kind
- Text
- ID
- ey71ll
23 comments
digisn't a good debugger for name resolution issues, because it just does DNS queries. Usegetent ahosts.strace -fand see where it hangs.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.
Never heard of this
getent. Only that on linux and *bsds dns servers should be in /etc/resolv.conf . Good to know.It's output looks like gibberish to me.
systemd-resolved is the one to blame.
Deleted before we saved it.
If you aren't using systemd for network, make sure
systemd-resolvedisn't enabled/running. That's been the cause of 90% of the recent networking issues that I've seen.systemd-networkd is not required to use systemd-resolved. OP says he's using networkd anyway.
EDIT: s/it/networkd/ for clarity.
That's my entire point. If resolved is running it conflicts with others such as NetworkManager.
Deleted before we saved it.
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.
Deleted before we saved it.
You can use whatever works for you.
If you want to debug sd-resolved,
resolvectl statusis 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-resolvedwith the following content:and recreate your query with
resolvectl query.The first thing to do is isolate where the problem actually occurs. Tools like
pingmight produce more queries than you expect. For example, doesping -n archlinux.orgalso 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.
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.
I thought systemd-resolved creates resolv.conf (
nameserver192.168.1.1from dhcp) and stub-resolv.conf (nameserver127.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?aria2ccan download files with no problems, butgit,ping,getent ahostsarchlinux.orgfreezing for 2min and then continue their job.2min freeze, then 3 pings sent in 2 seconds, no lost packets (-O option).
Dunno, my router's dns server working just fine.
dig @192.168.1.1sigok.verteiltesysteme.net+dnssecreturn ip address and signaturedig @192.168.1.1sigok.verteiltesysteme.net+dnssecgives SERVFAILBrowser 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.
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 implementsgetaddrinfothrough 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
hostsline in your/etc/nsswitch.conf. Seeman 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.confis 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 ahostsdoes the nss lookup for you withgetaddrinfo, whereasdigjust constructs it's own dns query to whatever server you specify. Sogetent ahostsmore closely matches the expected behavior of your applications.I’ve also disabled ipv6 and it works without problem. That should not be a problem I think