Messed up my Amanda config somehow

I had Amanda set up and working fine for a week and today I tried to edit my disklist to add a new folder to backup and it started failing with ‘amanda nak parse failed’ errors. Figuring I messed it up somehow I tried to uninstall and reinstall amanda, removed my existing openhab-dir from /etc/amanda and the slots folder on the mount point and it’s still failing after re-setting it up in openhabian-config for at least the default openhab folders again. When I run ‘amcheck openhab-dir’ I get the following report:

'/etc/amanda/openhab-dir/amanda.conf', line 11: warning: Global changerfile is deprecated, it must be set in the changer section
Amanda Tape Server Host Check
'/etc/amanda/openhab-dir/amanda.conf', line 11: warning: Global changerfile is deprecated, it must be set in the changer section
ERROR: directory '/mnt/openhab_backup/slots' does not exist
NOTE: host info dir '/var/lib/amanda/openhab-dir/curinfo/openhab' does not exist
      It will be created on the next run
NOTE: index dir '/var/lib/amanda/openhab-dir/index/openhab' does not exist
      it will be created on the next run
Server check took 0.210 seconds
Amanda Backup Client Hosts Check
ERROR: openhab: unknown response: penhab doesn't resolve to
Client check: 1 host checked in 1.090 seconds.  1 problem found.
(brought to you by Amanda 3.5.1)

I’ve checked all the amanda related config files I could find but for the life of me can’t find where it’s referencing ‘penhab’ as the amanda host - I MUST have fat fingered when I tried to reinstall it via openhabian-config but re-running through it doesn’t solve the issue so i’m lost. Does anyone know where I need to look to fix this? I’m willing to completely wipe out all traces of Amanda and start over if that’s what it takes but it seems it’s in a file somewhere I can’t find.

As a quick work around you could update /etc/hosts and hadd penhab to resolve to

I’m not familiar with Amanada (just know its a backup utility), but for some packages that have setup scripts you can use

sudo dpkg-reconfigure amanda-server

Not sure if this will resolve your typo or not, but usually removing a package doesn’t remove its configuration files, you would have to purge the package if starting over is what you end up doing.

there’s a missing ‘o’, probably in the disklist file

also try deleting (comment out) the changerfile line in amanda.conf, you seem to be running on some non-Pi.

I tried the quick and dirty adding the wrong spelled host name to my hosts file, but it just generates this error:

ERROR: NAK openhab: user backup from penhab is not allowed to execute the service noop: Please add the line "penhab backup amdump" to /var/backups/.amandahosts on the client

Doing that, the amcheck succeeds but amdump fails with this

  openhab /etc/openhab2 lev 0  FAILED [can't do degraded dump without holding disk]
  openhab /var/lib/openhab2 lev 0  FAILED [can't do degraded dump without holding disk]
  openhab /var/lib/openhab2 lev 0  FAILED [data read: recv error: shm_ring is cancelled]
  /-- openhab /var/lib/openhab2 lev 0 FAILED [data read: recv error: shm_ring is cancelled]
  sendbackup: start [openhab:/var/lib/openhab2 level 0]
  sendbackup: info BACKUP=/bin/tar
  sendbackup: info RECOVER_CMD=/bin/tar -xpGf - ...
  sendbackup: info end

  planner: Adding new disk openhab:/etc/openhab2.
  planner: Adding new disk openhab:/var/lib/openhab2.
  planner: WARNING: no history available for openhab:/var/lib/openhab2; guessing that size will be 1000000 KB
  planner: WARNING: no history available for openhab:/etc/openhab2; guessing that size will be 1000000 KB
  taper: Slot 1 without label can be labeled
  taper: while labeling new volume: Can't open file /mnt/openhab_backup/slots/slot1//00000.openHABian-openhab-dir-001: Permission denied

so trying to rig it to work with the wrong hostname doesn’t seem to be the right path to go down. I did do apt-get purge amanda-client amanda-server amanda-common, deleting the /etc/amanda/openhab-dir and slots folder from my backup destination and re-set it all up through openhabian-config but that doesn’t seem to change anything.

After purging amanda completely (or so I thought), deleting the /etc/amanda/openhab-dir and slots folders and re-setting it up through openhabian-config my disklist shows this:

openhab  /etc/openhab2             user-tar
openhab  /var/lib/openhab2         user-tar

I have also tried commenting out the changerfile line in amanda.conf but that didn’t seem to make any difference either. I’ve also been through all the other files in /etc/amanda/openhab-dir and none seem to reference this typo. You’re right, I am running Ubuntu server 18.04 on a regular PC for this.

I went back down the road of putting the typo back into my hosts and .amandahosts files and fixed the permissions problem with a chown -R backup:backup /mnt/openhab_backup and it seems to work now at least. It’s going to bug the heck out of me that there’s a config buried somewhere though but I guess I’ll have to live with it unless anyone has a new suggestion to fix it properly

You would also need to delete user backup and everything in /var/lib/amanda plus possibly you storage area as well.

not for your problem but the warning now should be gone.

I did the following:

apt-get purge amanda-client amanda-common amanda-server
sudo rm -rf /etc/amanda
sudo rm -rf /var/lib/amanda
sudo rm -rf /mnt/openhab_backup/slots
sudo userdel -r backup

and tried to re-run openhabian-config to set up backups again but it failed because the user ‘backup’ didn’t already exist. Is openhabian-config supposed to create that user? I looked at the code in github and I couldn’t find anywhere where it does. So I ran the above again, then manually created the ‘backup’ user and still getting the ‘penhab not resolving to’ error when running amcheck as backup :frowning:

Sounds like a thorough purge. Yes ‘backup’ exists on Raspbian so it’s not created by openhabian-config.
Sort of funny the issue persist. If you really want to go for it you could dissect the Amanda logs in /var/log/amanda/* plus run strace amdump ... and grep the output for ‘open’ lines to see which (other) files it’s using, your typo likely is in one of them, then. Did you check /etc/hostname ?

So it’s the damndest thing. After having it run with adding ‘penhab’ in my hosts file successfully for a while, the issue seems to have corrected itself - both amcheck and amdump work fine now. I took the entry out of my hosts file to see if I could find out where the failure is and it didn’t fail. I also checked my /var/backup/.amandahosts file and the ‘penhab’ line I had to add there seems to be missing too. I’m not sure what happened or how and I suppose we will never know now :man_shrugging: