Netatalk debugging and logging tips and tricks

Posted: November 26th, 2010 | Author: | Filed under: netatalk, Ubuntu | Tags: , , , , , , | No Comments »

Lately I have been having problems logging into my TimeMachine disc. My iMac works, but my macbook doesn’t, even though they run the exact same OS (10.6.5). I looked it up and here are the instructions to seperate the netatalk messages from the general message logs.

In /etc/netatalk/afpd.conf
add -setuplog “default log_info /var/log/afpd.log” to the long line of setup parameters.

If you run CNID server:
In /etc/default/netatalk
add CNID_CONFIG=”-l log_info -f /var/log/cnid.log”

You then run /etc/init.d/netatalk restart in your terminal.

Add the log files in Log File Viewer (under System -> Administration). Use File -> Open and select the log files in the appropriate place. Now whenever the logs are updated the log files will be in bold.

Now I get error messages when my macbook tries to log onto the Time Machine disc:
afpd[2081] {uams_dhx2_pam.c:350} (I:UAMSDaemon): DHX2 login: useruser
afpd[2081] {uams_dhx2_pam.c:228} (I:UAMSDaemon): PAM DHX2: PAM Success
afpd[2081] {uams_dhx2_pam.c:647} (I:UAMSDaemon): DHX2: PAM_Error: Authentication failure

However my iMac works fine:
afpd[2280] {uams_dhx2_pam.c:350} (I:UAMSDaemon): DHX2 login: useruser
afpd[2280] {uams_dhx2_pam.c:228} (I:UAMSDaemon): PAM DHX2: PAM Success
afpd[2280] {uams_dhx2_pam.c:684} (I:UAMSDaemon): DHX2: PAM Auth OK!

Netatalk fixes after Ubuntu 10.10 upgrade from Ubuntu 10.04

Posted: October 11th, 2010 | Author: | Filed under: netatalk, Ubuntu | Tags: , , , , | No Comments »

If you had followed the previous instructions and have just upgraded from 10.04 to 10.10 aka Maverick Meerkat; you might have noticed that Netatalk has ceased to function. Basically it won’t let you login and in the System Log Viewer you see error messages like below.

I got the following error messages in daemon.log.

afpd[3523]: Setting uid/gid to 1000/1000
afpd[3523]: CNID DB initialized using Berkeley DB 4.8.30: (April  9, 2010)
afpd[3523]: cnid_open: dbenv->open (rw) of /storage/dirname/.AppleDB failed: DB_VERSION_MISMATCH: Database environment version mismatch
afpd[3523]: Fatal error: cannot open CNID or invalid CNID backend for /storage/dirname: cdb

What I come to realize that Netatalk 2.1.2 (that is now default in the Meerkat software repository), doesn’t support the cdb option in the cnidscheme. It only supports last, dbd and tdb.

Steps to uninstall Netatalk (if you had followed the previous instructions)
Remember to backup your copies of your conf files in your /etc/netatalk directory first.

echo "netatalk purge" | sudo dpkg --set-selections
sudo apt-get remove netatalk
sudo apt-get autoremove

You can then follow the same instructions in the previous post and compile the latest version (2.1.2) with the proper authentication modules built in from the Maverick Meerkat repository.

Once you have started the dpkg installation of the new netatalk. You will be asked if you want the new conf files to be installed. I selected No and changed the cnidscheme manually.

Remember to change the cnidscheme setting from cdb to either dbd or tdb in your AppleVolumes.default files. For more information on selecting / changing please refer to here.