amrecover - can't talk to tape server: service amidxtaped:

Bug #1077105 reported by Kevin Zimmerman on 2012-11-09
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
amanda (Ubuntu)
Undecided
Unassigned

Bug Description

Same info as reported in bug 1074574.

I can't edit that bug (won't save my changes) so I can't follow Logan's advice to request a backport.

[Impact]
Amanda 1:3.3.0-1ubuntu1.1 in the Ubuntu 12.04.1 Server release has a bug where restores from backup cannot be executed. This is fixed in Ringtail, but needs to make it back to the LTS release.

[Test Case]
Following the guides that zwingo listed in 1074574 will get you there.
But, in a nutshell:

amrecover <config>
sethost <client_name>
setdisk <path>
add *
extract

Resultant error:
amrecover - can't talk to tape server: service amidxtaped:

Lindsay (fmouse) wrote :

This is a perl issue, and a fix has been available since June of 2011. See http://old.nabble.com/amrecover---can%27t-talk-to-tape-server%3A-service-amidxtaped%3A-td31861008.html where patches for this problem are posted. This problem is related to Bug #1056641 which deals with the perl issue, but doesn't provide a fix.

I'm running Ubuntu 12.04 LTS on two different servers and have applied the patches from the above URL and can attest to the fact that they do indeed fix the problem. I'm attaching the relevant patches since I haven't seen them posted on Ubuntu Launchpad in relation to this problem. Since these were drawn from a copy and paste from the Nabble website, you'll have to dissect this diff and apply each patch with -l.

I'm running an LTS version of Ubuntu with the understanding that problems of this sort will be addressed as fixes become available for the next 4+ years. Since backup and restore are mission critical administrative tasks for servers used in business environments, I would hope that this matter would be given some priority attention. My guess is that this may not have been a problem in the original release of 12.04 and that an upgrade to perl during the past year may have caused this bug to surface. The problem is especially nasty since there's no problem making backups with amanda as it's distributed, but it fails when the backups are needed in a hurry to restore lost data.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in amanda (Ubuntu):
status: New → Confirmed

The attachment "Patches for several perl modules in amanda" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Lindsay (fmouse) wrote :

My understanding is that this bug has already been squashed in Raring Ringtail (see bug #1074574), so it's a known issue with a known fix going forward. My concern is that it hasn't been backported to Precise Pangolian (12.04 LTS). LTS versions of Ubuntu are the ones used in production environments, on mission-critical servers, where the maintenance of a rock solid backup and restore system is a basic system administration duty. The procedure for getting a bug on a released version of Ubuntu onto the SRU track is not well documented online (which is probably a bug in itself) and I ended up emailing one of the SRU team administrators about it in the hope of moving it in that direction.

I've already fixed this bug on my servers, so the patch is as much as anything for the convenience of others who may be having the same problem in Precise. My concern is that someone installing the lastest LTS version of Ubuntu Server shouldn't have to deal with a disabling bug in a major backup and restore suite for which a fix was available a year and a half ago and which is already fixed in the latest non-LTS releases.

Klaus Müller (k-mueller) wrote :

Here a set of workarounds from a PERL programmer:

Version: Ubuntu LTS 12.04 or Kubuntu LTS 12.04 (tested on Kubuntu)
Amada package version 1:3.3.0 (Ubuntun package reference)

First the issue related on http://old.nabble.com/amrecover---can%27t-talk-to-tape-server%3A-service-amidxtaped%3A-td31861008.html is not related to a particular PERL version. It is just poor programming. This may happen... especially if the programmer is in a hurry.

Next: we are professionals so we are able to fix. Accordingly: DO IT!

===> Detecting the bug:

If you are affected the following statement issued in /usr/lib/amanda/perl/Amanda will return mor than just one line with Scribe.pm:

find . -type f -exec egrep -l "param +qw" {} \;

===> Workaround A:

The bug on is only concerning only a few files located in /usr/lib/amanda/perl/Amanda. The list of the files to fix in order to have a proper work around are:

/usr/lib/amanda/perl/Amanda/Recovery/Clerk.pm
/usr/lib/amanda/perl/Amanda/Recovery/Planner.pm
/usr/lib/amanda/perl/Amanda/Taper/Scribe.pm

For each of these files secure the lines hodling [param qw..] . become param ( qw... ) <= two parenthesis to add that is it. Example: Clerk.pm - line 231

Initial: for my $rq_param qw(dump xfer_src_cb) {...
Corrected: for my $rq_param ( qw(dump xfer_src_cb) ) {

Once this is done Amanda's perl code will match the PERL specifications for loops: (from perldoc.perl.org) :

LABEL for (EXPR; EXPR; EXPR) BLOCK ### Notice the parenthesis after the keyword for
LABEL for VAR (LIST) BLOCK ### Our case and we just fix the parenthesis around LIST
LABEL for VAR (LIST) BLOCK continue BLOCK

===> Workaround B:

Download the PERL modules above from the Amanda code repository and copy them in the locations of workaround A. They will work unless you use a very old PERL version.

For both workaround: add the services definition for amindexd and amidxtaped and you will be able to restore.

Have a nice restore.

Lindsay (fmouse) wrote :

Yes, this fix is essentially the the same as the one posted on old.nabble.com. According to this bug, the problem is due to newer versions of perl enforcing stricter syntax conformity which exposes the program sloppiness to which the programmer is probably referring.

Thanks for posting the workaround, which will help until this is fixed in an officially distributed release of amanda, either by Ubuntu, or upstream, and the fix is backported to 12.04 LTS - which it should be. System administrators obviously shouldn't have to patch up a poorly written perl script in order to have a fully functional amanda for a task as critical as backup/restore, much less go out and research the bug when an amanda restore fails and they need to get lost data back online in a hurry. The boss will NOT be happy!

I fixed this bug because I could. I grok perl well enough that I could, once I found the solution. Not every system administrator is as fortunate, nor should he or she need to be :)

One way or another, Canonical/Ubuntu needs to get this fix into a Stable Release Upgrade process for 12.04 LTS. Rocket science this ain't.

Klaus Müller (k-mueller) wrote :

=>This issue has nothing to do with a given PERL version <= There are perlish ways to do things. Goes under to motto TIMTOWTDI! It is inherent to PERL the language. The code was written so that it worked, but the perlish way. It was just not written according to best practices the PERL developper try to promote since years. That'is it.

So please do not forget: Amanda is one of the best backup software around and its is free... almost... you just have to copy 3 files in their correct location if you perform minor upgrades, what you should definitely not do: it is a backup software! Don't touch it if it works!

Jörg Hänsel (joerg-haensel) wrote :

now it's already July and there are still no updated packages for 12.04 LTS.

The upstream tar archive of the 3.3.1 version (pool/universe/a/amanda/amanda_3.3.1.orig.tar.gz) already contains patched pm-files:

test@test:~/temp/test$ diff amanda-3.3.1/perl/Amanda/Recovery/Planner.pm /usr/lib/amanda/perl/Amanda/Recovery/Planner.pm
231c231
< for my $rq_param (qw(changer plan_cb dumpspecs)) {
---
> for my $rq_param qw(changer plan_cb dumpspecs) {
342c342
< for my $rq_param (qw(holding_file plan_cb)) {
---
> for my $rq_param qw(holding_file plan_cb) {
393c393
< for my $rq_param (qw(filelist plan_cb)) {
---
> for my $rq_param qw(filelist plan_cb) {
test@test:~/temp/test$ diff amanda-3.3.1/perl/Amanda/Recovery/Clerk.pm /usr/lib/amanda/perl/Amanda/Recovery/Clerk.pm
72c72
< This package is the counterpart to L<Amanda::Taper::Scribe>, and handles
---
> This package is the counterpart to L<Amanda::Recovery::Scribe>, and handles
231c231
< for my $rq_param (qw(dump xfer_src_cb)) {
---
> for my $rq_param qw(dump xfer_src_cb) {
265c265
< for my $rq_param (qw(xfer recovery_cb)) {
---
> for my $rq_param qw(xfer recovery_cb) {

Why don't you just use them as patches in the 3.3.0 in 12.04 LTS?

AlexanderYT (arcam) wrote :

The patch is works for me. Thank!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers