PDA

View Full Version : chg-multi errors after upgrading server 2.5.1p3 to 2.5.2p1



Andrew Rakowski
July 15th, 2007, 03:22 PM
Hi folks, I had another one of those "all amandabackup" processes dying errors, and decided it was time to upgrade from amanda-backup_server-2.5.1p3-1.rhel4 to version 2.5.2p1-1.rhel4 . The first problem was that I had both client and server software installed on the server, and that seems not to be needed now. I removed the 2.5.1p3 client, then did an "rpm -Uvh" to the server-2.5.2p1 software downloaded from the Zmanda.com site.

However, without changing any configuration files, I now seem to be getting an error with the "vtape" tape changer (I'm using chg-multi glue script). When I try an "amtape XXXXdaily current" command (I first noticed the problem doing an "amcheck XXXXdaily") I get an error:

....
[amandabackup@amanda01 XXXXdaily]$ amtape XXXXdaily current
amtape: scanning current slot in tape-changer rack:
amtape: could not load slot <error>: could not read result from "/usr/lib/amanda/chg-multi"
[amandabackup@amanda01 XXXXdaily]$
....

I thought that was odd, so I checked the debug files in /tmp/amanda, and find this:



/tmp/amanda/server/XXXXdaily/amtape.20070715154831.debug
::::::::::::::
amtape: debug 1 pid 16204 ruid 20680 euid 20680: start at Sun Jul 15 15:48:31 2007
amtape: debug 1 pid 16204 ruid 20680 euid 20680: rename at Sun Jul 15 15:48:31 2007
changer_query: changer return was 40 1
changer_query: searchable = 0
/usr/lib/amanda/chg-multi: line 446: unexpected EOF while looking for matching ``'
/usr/lib/amanda/chg-multi: line 449: syntax error: unexpected end of file
changer: got exit: 2 str: <error> could not read result from "/usr/lib/amanda/chg-multi"
amtape: time 0.066: could not load slot <error>: could not read result from "/usr/lib/amanda/chg-mul
ti"
amtape: time 0.066: pid 16204 finish time Sun Jul 15 15:48:31 2007
::::::::::::::


The changer.debug file itself shows:



arguments -> -info
MT -> /usr/sbin/ammt -f
Note: setting multieject to a default of zero
Note: setting posteject to a default of "true"
Exit -> 21 40 1
arguments -> -slot current
MT -> /usr/sbin/ammt -f
Note: setting multieject to a default of zero
Note: setting posteject to a default of "true"


The lines in question are at the end of the script, so it looks like the script just ran off the end for some reason.

Here's the amanda.conf entries dealing with the virtual tape changer, and these have NOT changed in over three months, working just fine until this upgrade. I suspect there's a minor change that I need to make, but don't know what it is. Anyhow, here's what amanda.conf has in it for the changer:



# Virtual tape changer definitions...
#
tpchanger "chg-multi" # the multi-tape drive tape-changer glue script
changerfile "/etc/amanda/XXXXdaily/changer.conf" # Defines changer for chg-multi scripts

#tapedev "file:/home/amanda-vtapes/XXXXdaily/slots" # ignored with chg-multi .vtape changer [AER]
tapedev "/dev/null" # NOT ignored with chg-multi as of 2.5.1p2 [AER/14nov2006]
#changerdev "/dev/null" # ignored with chg-multi .vtape changer [AER]
rawtapedev "/dev/null" # the raw device to be used (ftape only)
label_new_tapes XXXXdaily-%%%"
maxdumpsize -1 # Maximum number of bytes the planner will schedule
tapetype "HARD-DISK-LARGE" # what kind of tape it is (see tapetypes below)


Regards,

-Andrew

Andrew Rakowski
July 16th, 2007, 03:22 PM
However, without changing any configuration files, I now seem to be getting an error with the "vtape" tape changer (I'm using chg-multi glue script). When I try an "amtape XXXXdaily current" command (I first noticed the problem doing an "amcheck XXXXdaily") I get an error:

....
[amandabackup@amanda01 XXXXdaily]$ amtape XXXXdaily current
amtape: scanning current slot in tape-changer rack:
amtape: could not load slot <error>: could not read result from "/usr/lib/amanda/chg-multi"
[amandabackup@amanda01 XXXXdaily]$
....


Well, it turns out that there IS a problem. I found the answer on the amanda-hackers mailing list. The script /usr/lib/amanda/chg-multi has a typo in it that Paul Bijnens found and provided a patch for. Unfortunately, I don't directly receive amanda-hackers e-mails (I guess I need to change that), so I didn't see it when it was sent, but Jean-Louis managed to copy it in his reply (which did make it into the message archive) and I wandered across it.

The patch, which consists of deleting the extra back-tick, is:

....
[root@amanda01 amanda-2.5.2p1]# diff -u /var/tmp/chg-multi.2.5.2p1 /usr/lib/amanda/chg-multi
--- /var/tmp/chg-multi.2.5.2p1 2007-06-06 23:52:03.000000000 -0700
+++ /usr/lib/amanda/chg-multi 2007-07-16 15:51:52.000000000 -0700
@@ -325,7 +325,7 @@
echo $answer
exit 2
fi
- echo `_ ' -> offline'` "$device"` >> $logfile
+ echo `_ ' -> offline'` "$device" >> $logfile
$MT $MTF $device offline >> $logfile 2>&1
if [ $? -ne 0 ]; then
answer=`_ '%s %s: %s: unable to change to slot %s' "$newslot" "$pname" "$device" "$curslot"`
[root@amanda01 amanda-2.5.2p1]#
....

Hopefully, this will save somebody else some time, and let them upgrade to 2.5.2p1 with one less problem. We'll do a backup run with 2.5.2p1 tonight and see how things go.

Cheers (and a big *thank you* for finding that bug, Paul),

-Andrew