Netatalk has stopped working on a server that I support for my parents. I'm not sure what has changed to cause it. From my investigation it looks like getaddrinfo() cannot lookup localhost
This is an extract from /var/log/netatalk.log that shows that netatalk can't connect to the CNID backend due to being unable to resolve localhost
I can ping localhost and host works
However if I use python's interactive prompt getaddrinfo clearly doesn't return the right value
/etc/hosts is configured as:
/etc/nsswitch.conf is configured as
I'm running freebsd-10.3-RELEASE and netatalk version 3.1.10
I'm not sure why getaddrinfo() can't resolve localhost, but can resolve other hosts. Can anyone help me understand what might be misconfigured.
Many thanks
This is an extract from /var/log/netatalk.log that shows that netatalk can't connect to the CNID backend due to being unable to resolve localhost
Code:
Dec 10 19:49:51.186774 afpd[1557] {ad_flush.c:486} (debug:ad): ad_close(DF|HF|SHRMD): END: 0 {d: 0, m: 0, r: 0} [dfd: -1 (ref: 0), mfd: -1 (ref: 0), rfd: -1 (ref: 0)]
Dec 10 19:49:51.186799 afpd[1557] {ad_conv.c:124} (debug:ad): ad_conv_v22ea_hf("/media/backup"): END: -1
Dec 10 19:49:51.186826 afpd[1557] {ad_conv.c:191} (debug:ad): ad_conv_v22ea_hf("/media/backup"): deleting adouble:v2 file: "/media/backup/.AppleDouble/.Parent"
Dec 10 19:49:51.186907 afpd[1557] {ad_conv.c:226} (debug:ad): ad_conv_dehex("/media/backup"): BEGIN
Dec 10 19:49:51.186938 afpd[1557] {ad_conv.c:294} (debug:ad): ad_convert("/media/backup"): END: 0
Dec 10 19:49:51.186976 afpd[1557] {ad_open.c:1849} (debug:ad): ad_open("/media/backup", HF|DIR|O_RDWR|O_CREAT): BEGIN {d: 0, m: 0, r: 0}[dfd: -1 (ref: 0), mfd: -1 (ref: 0), rfd: -1 (ref: 0)]
Dec 10 19:49:51.187066 afpd[1557] {ad_open.c:1205} (debug:ad): ad_open_hf_ea("/media/backup", HF|DIR|O_RDWR|O_CREAT): BEGIN [dfd: -1 (ref: 0), mfd: -1 (ref: 0), rfd: -1 (ref: 0)]
Dec 10 19:49:51.187109 afpd[1557] {ad_open.c:1230} (debug:ad): ad_open_hf_ea("/media/backup"): opening base file for meta adouble EA
Dec 10 19:49:51.233343 afpd[1557] {ad_open.c:1279} (debug:ad): ad_open_hf_ea("/media/backup", HF|DIR|O_RDWR|O_CREAT): END: 0 [dfd: 5 (ref: 1), mfd: 5 (ref: 1), rfd: -1 (ref: 0)]
Dec 10 19:49:51.233415 afpd[1557] {ad_open.c:1912} (debug:ad): ad_open("/media/backup"): END: 0 {d: 0, m: 1, r: 0}[dfd: 5 (ref: 1), mfd: 5 (ref: 1), rfd: -1 (ref: 0)]
Dec 10 19:49:51.233451 afpd[1557] {ad_flush.c:423} (debug:ad): ad_close(HF): BEGIN: {d: 0, m: 1, r: 0} [dfd: 5 (ref: 1), mfd: 5 (ref: 1), rfd: -1 (ref: 0)]
Dec 10 19:49:51.233486 afpd[1557] {ad_flush.c:486} (debug:ad): ad_close(HF): END: 0 {d: 0, m: 0, r: 0} [dfd: -1 (ref: 0), mfd: -1 (ref: 0), rfd: -1 (ref: 0)]
Dec 10 19:49:51.233515 afpd[1557] {cnid_dbd.c:238} (debug:CNID): connecting to CNID server: localhost:4700
Dec 10 19:50:02.271874 afpd[1557] {cnid_dbd.c:81} (error:Default): tsock_getfd: getaddrinfo: CNID server localhost:4700 : hostname nor servname provided, or not known
Dec 10 19:50:02.272053 afpd[1557] {cnid_dbd.c:238} (debug:CNID): connecting to CNID server: localhost:4700
Dec 10 19:50:13.312479 afpd[1557] {cnid_dbd.c:81} (error:Default): tsock_getfd: getaddrinfo: CNID server localhost:4700 : hostname nor servname provided, or not known
Dec 10 19:50:14.321157 afpd[1557] {cnid_dbd.c:238} (debug:CNID): connecting to CNID server: localhost:4700
Dec 10 19:50:25.363216 afpd[1557] {cnid_dbd.c:81} (error:Default): tsock_getfd: getaddrinfo: CNID server localhost:4700 : hostname nor servname provided, or not known
Dec 10 19:50:25.363432 afpd[1557] {cnid_dbd.c:414} (error:CNID): transmit: Request to dbd daemon (volume Backup) timed out.
Dec 10 19:50:25.363488 afpd[1557] {volume.c:865} (error:AFPDaemon): afp_openvol(/media/backup): Fatal error: Unable to get stamp value from CNID backend
Dec 10 19:50:25.363554 afpd[1557] {cnid_dbd.c:498} (debug:CNID): closing database connection for volume 'Backup'
I can ping localhost and host works
% ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.040 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.060 ms
% host localhost
localhost has address 127.0.0.1
However if I use python's interactive prompt getaddrinfo clearly doesn't return the right value
Code:
>>> import socket
>>> socket.getaddrinfo('localhost',4077)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
socket.gaierror: [Errno 8] hostname nor servname provided, or not known
>>> socket.getaddrinfo('127.0.0.1',4077)
[(2, 2, 17, '', ('127.0.0.1', 4077)), (2, 1, 6, '', ('127.0.0.1', 4077)), (2, 5, 132, '', ('127.0.0.1', 4077))]
>>> socket.getaddrinfo('www.google.com','www')
[(2, 1, 6, '', ('150.101.161.236', 80))]
/etc/hosts is configured as:
Code:
127.0.0.1 localhost localhost.my.domain
/etc/nsswitch.conf is configured as
Code:
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD: releng/10.3/etc/nsswitch.conf 224765 2011-08-10 20:52:02Z dougb $
#
group: compat
group_compat: nis
hosts: file dns
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
I'm running freebsd-10.3-RELEASE and netatalk version 3.1.10
% freebsd-version
10.3-RELEASE-p14
% netatalk-config --version
3.1.10
I'm not sure why getaddrinfo() can't resolve localhost, but can resolve other hosts. Can anyone help me understand what might be misconfigured.
Many thanks