netatalk.io

Dev Docs Troubleshooting

Common Issues and Troubleshooting

Overview

This guide covers frequently encountered problems with Netatalk installations, their symptoms, causes, and solutions. Issues are organized by category for easy reference.

Connection Issues

Problem: Clients Cannot Connect to Server

Implementation Files

Symptoms

Diagnosis

# Check if AFP daemon is running
systemctl status netatalk
ps aux | grep afpd

# Verify network listeners
netstat -tlnp | grep :548
ss -tlnp | grep :548

# Test network connectivity
telnet server_ip 548
nc -zv server_ip 548

# Check firewall rules
iptables -L | grep 548
ufw status | grep 548

Common Causes and Solutions

1. AFP Daemon Not Running

# Start the service
systemctl start netatalk
systemctl enable netatalk

# Check for startup errors
journalctl -u netatalk -f

2. Firewall Blocking Connections

# Ubuntu/Debian with ufw
ufw allow 548

# RHEL/CentOS with firewalld
firewall-cmd --permanent --add-port=548/tcp
firewall-cmd --reload

# iptables rule
iptables -A INPUT -p tcp --dport 548 -j ACCEPT

3. Network Interface Binding Issues

# /etc/netatalk/afp.conf
[Global]
afp listen = 0.0.0.0:548     # Listen on all interfaces
# OR
afp listen = 192.168.1.100:548  # Specific interface
afp interfaces = eth0        # Limit to specific interface

4. Service Discovery Problems

# Enable Bonjour/mDNS
[Global]
zeroconf = yes

# Check Avahi daemon
systemctl status avahi-daemon

Problem: Connection Drops Frequently

Implementation Files

Symptoms

Solutions

# /etc/netatalk/afp.conf
[Global]
# Increase connection timeout
sleep time = 60

# TCP keepalive settings
tcp rcvbuf = 131072
tcp sndbuf = 131072

# Client idle timeout
disconnect time = 300

Authentication Issues

Problem: Login Failures

Implementation Files

Symptoms

Diagnosis

# Check available UAMs
afpd -V | grep UAM

# Test user account
id username
getent passwd username

# Check AFP password file
cat /etc/netatalk/afppasswd

# Debug authentication
tail -f /var/log/netatalk.log

Common Solutions

1. Missing or Incorrect UAM Modules

[Global]
uam list = uams_dhx2.so uams_dhx.so uams_pam.so uams_guest.so
uam path = /usr/local/lib/netatalk

2. PAM Configuration Issues

# Create /etc/pam.d/netatalk
cat > /etc/pam.d/netatalk << EOF
#%PAM-1.0
auth        required    pam_unix.so
account     required    pam_unix.so
EOF

3. AFP Password File Problems

# Recreate AFP password file
afppasswd -c username

# Set correct permissions
chown root:root /etc/netatalk/afppasswd
chmod 600 /etc/netatalk/afppasswd

4. Guest Access Issues

[Global]
uam list = uams_guest.so
guest account = nobody

Problem: Permission Denied Errors

Implementation Files

Symptoms

Diagnosis

# Check file system permissions
ls -la /path/to/volume/
getfacl /path/to/volume/

# Check user/group membership
groups username
id username

# Test direct file access
sudo -u username ls /path/to/volume/

Solutions

# Fix permission model
[Volume]
path = /path/to/volume
unix priv = yes
inherit perms = yes

# Set appropriate permissions
file perm = 0644
directory perm = 0755
umask = 022

# Force user/group
force user = shareuser
force group = sharegroup

Volume Issues

Problem: Volumes Not Appearing

Implementation Files

Symptoms

Diagnosis

# Verify volume paths exist
ls -la /path/to/volume/

# Check volume permissions
stat /path/to/volume/

# Test volume configuration
afpd -d -f /etc/netatalk/afp.conf

Solutions

# Create missing directories
mkdir -p /path/to/volume
chown appropriate_user:appropriate_group /path/to/volume

# Fix configuration syntax
nano /etc/netatalk/afp.conf

# Restart service
systemctl restart netatalk

Problem: Time Machine Backup Failures

Implementation Files

Symptoms

Diagnosis

# Check Time Machine volume settings
grep -A 10 "time machine" /etc/netatalk/afp.conf

# Monitor disk space
df -h /srv/timemachine/

# Check for filesystem errors
fsck /dev/disk_device

Solutions

[TimeMachine]
path = /srv/timemachine
time machine = yes
vol size limit = 1000000    # Set appropriate limit
tm used size = yes
spotlight = no
ea = ad
# Fix sparsebundle corruption
hdiutil attach /path/to/backup.sparsebundle
diskutil repairVolume /Volumes/BackupVolume
hdiutil detach /Volumes/BackupVolume

Performance Issues

Problem: Slow File Transfers

Implementation Files

Symptoms

Diagnosis

# Monitor network utilization
iftop -i eth0
netstat -i

# Check system resources
top
iostat 1

# Test network speed
iperf3 -s  # On server
iperf3 -c server_ip  # On client

Solutions

[Global]
# Optimize TCP buffers
tcp rcvbuf = 262144
tcp sndbuf = 262144
dsireadbuf = 64

# Connection tuning
max connections = 50
sleep time = 1
# Enable sendfile if available
echo 'net.core.rmem_max = 262144' >> /etc/sysctl.conf
echo 'net.core.wmem_max = 262144' >> /etc/sysctl.conf
sysctl -p

Problem: High Memory Usage

Implementation Files

Symptoms

Diagnosis

# Monitor memory usage
ps aux | grep afpd | head -20
pmap -d $(pgrep afpd)

# Check for memory leaks
valgrind --leak-check=full afpd -d

Solutions

[Global]
# Limit connections
max connections = 100

# Reduce cache sizes
cache size = 32768

[Volume]
# Disable unnecessary features
path = /path/to/volume
spotlight = no
stat vol = no

Database Issues

Problem: CNID Database Corruption

Implementation Files

Symptoms

Diagnosis

# Check database files
ls -la /var/lib/netatalk/CNID/

# Verify database integrity
db_verify /var/lib/netatalk/CNID/cnid2.db

# Check database logs
tail -f /var/log/netatalk.log | grep -i cnid

Solutions

# Stop netatalk service
systemctl stop netatalk

# Rebuild database
dbd -f /path/to/volume
systemctl start netatalk

This will rebuild all CNID databases from scratch

Note: This may change file IDs, affecting aliases and bookmarks

Spotlight Issues

Problem: Search Not Working

Implementation Files

Symptoms

Diagnosis

# Check Tracker status
tracker3 status

# Verify Spotlight configuration
grep -i spotlight /etc/netatalk/afp.conf

# Check indexing process
ps aux | grep tracker

Solutions

# Restart Tracker
tracker3 reset --hard
systemctl restart tracker-miner-fs

# Reindex volume
tracker3 index --file /path/to/volume
[Volume]
# Enable Spotlight properly
spotlight = yes
spotlight size limit = 10000

Service Discovery Issues

Problem: Server Not Appearing in Network Browser

Implementation Files

Symptoms

Diagnosis

# Check Avahi status
systemctl status avahi-daemon

# Verify service advertisement
avahi-browse -at

# Test mDNS resolution
dig @224.0.0.251 -p 5353 _afpovertcp._tcp.local

Solutions

# Enable and start Avahi
systemctl enable avahi-daemon
systemctl start avahi-daemon

# Check Avahi configuration
cat /etc/avahi/avahi-daemon.conf
[Global]
zeroconf = yes
mimic model = Xserve

Log Analysis

Enabling Debug Logging

Implementation Files

[Global]
# Maximum debug output
log level = default:debug9 afpd:debug9 cnid:debug9

# Log to separate file
log file = /var/log/netatalk-debug.log

Common Log Messages

Authentication Failures:

afpd[pid]: login authentication failed for user
afpd[pid]: UAM: uams_dhx2.so: login authentication failed

Permission Errors:

afpd[pid]: AFP_ACCESS denied: path/to/file
afpd[pid]: perm_check: Permission denied

Database Issues:

cnid_dbd[pid]: Error opening database
cnid_dbd[pid]: Berkeley DB error: Lock table is full

Log File Locations

Implementation Files

Common log locations:

This troubleshooting guide covers the most common issues encountered with Netatalk installations. For issues not covered here, consult the project documentation, community forums, or consider filing a bug report with detailed logs and system information.

Footnotes

This is a mirror of the Netatalk GitHub Wiki

Last updated 2025-12-27