openHABian AMANDA Installation Failure

I’m struggling with AMANDA setup from openHABian. I’m trying to use Amazon AWS and it crashes when it tries to make the virtual containers. See log below. I can’t find any information on amlabel, so I don’t know how to debug. Please point me in the right direction.

Thanks,
Marty

+ [[ 15 -le 0 ]]                                                                                                                                          
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-15 slot 15'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-15 slot 15 \033[39;49;00m'

$ su - backup -c amlabel openhab-AWS openhab-AWS-15 slot 15 
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-15 slot 15'

Wi-Fi is currently blocked by rfkill.
Use raspi-config to set the country before use.

Reading label...
Found an empty tape.
Label 'openhab-AWS-15' doesn't match the labelstr 'openHABian-openhab-AWS-%%%'.
Label 'openhab-AWS-15' doesn't match the labelstr 'openHABian-openhab-AWS-%%%'.
+ return 1
+ echo 'FAILED (amlabel)'
FAILED (amlabel)
+ return 1
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "50 | Backup/Restore"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80

@mstormi said…
There’s a manpage for amlabel.
Your problem seems to be that the autolabel line in /etc/amanda/openhab-AWS/amanda.conf is wrong so it does not match the two-digit tape number. Delete one ‘%’. You need to do that in the template file so restart openhabian-config

I changed autolabel line in /etc/amanda/openhab-AWS/amanda.conf to several different things and restarted each time. After retrying for each, I get the same error. I tried the following:

  • autolabel “openHABian-openhab-AWS-%%” empty
  • autolabel “openhab-AWS-%%%” empty

After I rerun the AMANDA setup in openHABian the tool is putting autolabel back to it’s default value of “openHABian-openhab-AWS-%%%” empty

Am I changing the wrong file?

Well sort of. It’s the right file but (re)generated when you reinstall. Upgrade openhabian (use main branch) to get the template changed.

I upgraded to the Main branch and tried again. I can see the %%% was changed to %%, but it still fails. See log below. From the error message, it seems like the openHABian- part of the labelstr shouldn’t be there. Any thoughts?

+ [[ 15 -le 0 ]]                                                                                                                                                                                                                                
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\d\i\r ]]
+ [[ openhab-AWS == \o\p\e\n\h\a\b\-\A\W\S ]]
+ cond_redirect su - backup -c 'amlabel openhab-AWS openhab-AWS-15 slot 15'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ su - backup -c amlabel openhab-AWS openhab-AWS-15 slot 15 \033[39;49;00m'

$ su - backup -c amlabel openhab-AWS openhab-AWS-15 slot 15 
+ su - backup -c 'amlabel openhab-AWS openhab-AWS-15 slot 15'

Wi-Fi is currently blocked by rfkill.
Use raspi-config to set the country before use.

Reading label...
Found an empty tape.
Label 'openhab-AWS-15' doesn't match the labelstr 'openHABian-openhab-AWS-%%'.
Label 'openhab-AWS-15' doesn't match the labelstr 'openHABian-openhab-AWS-%%'.
+ return 1
+ echo 'FAILED (amlabel)'
FAILED (amlabel)
+ return 1
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "50 | Backup/Restore"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80

Right, I removed it as well. Update and try again.

I haven’t tried to setup Amanda/S3 in a long time though so if you still get stuck set please debug yourself. A link that might be of help is Backup with Amanda: tape, NAS, Amazon S3 - MyWiki .

If all you need is the openHABian install to proceed you can edit /opt/openhabian/functions/backup.bash and remove the return 1 from the amlabel line.
(beware updating openHABian on start will overwrite your changes)

So I upgraded and reran AMANDA setup. amlabel worked as expected for slots 15 to 10 and failed at 9. It failed because the script fed it openhab-AWS-9 and the labelstr was expecting openhab-AWS-09. I ended up creating openhab-AWS-01 through openhab-AWS-09 manually, removing the return 1 as you suggested, and ran the setup again. All the amlabel commands failed as expected because they already existed, but the remaining portion of the script ran. I verifed with amcheck and it was fine, and I ran amdump successfully. So in my case I’m assuming what I have will work going forward, but for others trying to install, it will continue to fail.

Actions needed:

  • Change labelstr in souce code to openhab-AWS-% instead of openhab-AWS-%% (I’m assuming this will cause the script to expect 1 … 15 and not 01 … 15)

Thanks for your help.

Marty

I changed that once more update and retry please. Not sure if it’s still matching 2-digit numbers now.

I’m not sure how to test it now that it’s setup. The script will fail because the labels already exist. Is there a trick to completely removing everything AMANDA related? If so, I’ll do that and retest from the beginning.

just do to see if it issues the command with the correct label, they need not succeed

I upgraded and now it works. All the correct amlabel commands are issued. It’s good to go now. Thanks for your help.