PDA

View Full Version : "Unable to write tapelist" from amlabel and amdump



John
May 16th, 2007, 09:04 AM
I had a previously working Amanda installation, and then changed the server, changing the OS with it.

Now, everything is back up and running except Amanda. Running amdump with with previous tapes, tapelist, disklist, etc gives me:


FAILURE AND STRANGE DUMP SUMMARY:
MACHINENAME /home/ lev 0 FAILED [can't switch to incremental dump]
taper: FATAL could not write tapelist: Permission denied
taper: ERROR tape-error <nohandle> "[Taper syncpipe fault]"

amlabel DailySet1 DailySet11 gives me:

rewinding, reading label DailySet11
rewinding, writing label DailySet11, checking labelamlabel: couldn't write tapelist: Permission denied

Amanda 2.5.2 runs as user amandabackup, group disk.
Server is Ubuntu 6.06 Server.
tapelist *was* owned by amandabackup:disk, 600 permissions. I've tried up to 777, and get the same result. The parent directories all have at least r-x permissions for "everybody". I've tried removing the tapelist file and starting over, creating an empty one, restoring the one from the previously working installation, etc.

Any suggestions?

dustin
May 16th, 2007, 09:17 AM
Also check that amandabackup:disk has write permission on the directory -- it writes files by creating a temporary file and renaming it, so it must be able to create/rename files in that directory.

If that doesn't fix it, please post the amlabel debug file.

John
May 16th, 2007, 11:04 AM
It does have permission on the folder:

drwxr-xr-x 3 amandabackup disk 4096 2007-05-16 12:04 .
drwxr-xr-x 3 amandabackup disk 4096 2007-05-11 13:32 ..

The debug file:

amlabel: debug 1 pid 27248 ruid 1019 euid 1019: start at Wed May 16 12:03:47 2007
amlabel: debug 1 pid 27248 ruid 1019 euid 1019: rename at Wed May 16 12:03:47 2007
amlabel: Building type 2 (TAPESTART) header of size 32768 using:
amlabel: Contents of *(dumpfile_t *)0xbff21254:
amlabel: type = 2 (TAPESTART)
amlabel: datestamp = 'X'
amlabel: dumplevel = 0
amlabel: compressed = 0
amlabel: encrypted = 0
amlabel: comp_suffix = ''
amlabel: encrypt_suffix = ''
amlabel: name = 'DailySet11'
amlabel: disk = ''
amlabel: program = ''
amlabel: dumper = ''
amlabel: srvcompprog = ''
amlabel: clntcompprog = ''
amlabel: srv_encrypt = ''
amlabel: clnt_encrypt = ''
amlabel: recover_cmd = ''
amlabel: uncompress_cmd = ''
amlabel: encrypt_cmd = ''
amlabel: decrypt_cmd = ''
amlabel: srv_decrypt_opt = ''
amlabel: clnt_decrypt_opt = ''
amlabel: cont_filename = ''
amlabel: is_partial = 0
amlabel: partnum = 0
amlabel: totalparts = 0
amlabel: blocksize = 32768
amlabel: Building type 3 (TAPEEND) header of size 32768 using:
amlabel: Contents of *(dumpfile_t *)0xbff21254:
amlabel: type = 3 (TAPEEND)
amlabel: datestamp = 'X'
amlabel: dumplevel = 0
amlabel: compressed = 0
amlabel: encrypted = 0
amlabel: comp_suffix = ''
amlabel: encrypt_suffix = ''
amlabel: name = ''
amlabel: disk = ''
amlabel: program = ''
amlabel: dumper = ''
amlabel: srvcompprog = ''
amlabel: clntcompprog = ''
amlabel: srv_encrypt = ''
amlabel: clnt_encrypt = ''
amlabel: recover_cmd = ''
amlabel: uncompress_cmd = ''
amlabel: encrypt_cmd = ''
amlabel: decrypt_cmd = ''
amlabel: srv_decrypt_opt = ''
amlabel: clnt_decrypt_opt = ''
amlabel: cont_filename = ''
amlabel: is_partial = 0
amlabel: partnum = 0
amlabel: totalparts = 0
amlabel: blocksize = 32768
amlabel: time 38.075: couldn't write tapelist: Permission denied
amlabel: time 38.075: pid 27248 finish time Wed May 16 12:04:25 2007

martineau
May 16th, 2007, 11:10 AM
Did amcheck succeed?
Can you create a new file: touch newfile
Can you touch tapelist: touch tapelist
What's the complete output of: ls -al

John
May 16th, 2007, 11:44 AM
Amcheck succeeds.
Amanda Tape Server Host Check
-----------------------------
Holding disk /home/amandadump: 226 GB disk space available, using 226 GB
read label `DailySet11', date `X'
NOTE: skipping tape-writable test
Tape DailySet11 label ok
NOTE: conf info dir /usr/local/etc/amanda/DailySet1/curinfo does not exist
NOTE: it will be created on the next run.
NOTE: index dir /usr/local/etc/amanda/DailySet1/index does not exist
NOTE: it will be created on the next run.
Server check took 11.051 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 0.071 seconds, 0 problems found

(brought to you by Amanda 2.5.2)


I can create new files, yes, and I can delete and recreate tapelist.

ls -la gives:

drwxr-xr-x 3 amandabackup disk 4096 2007-05-16 14:42 .
drwxr-xr-x 3 amandabackup disk 4096 2007-05-11 13:32 ..
-rw-r--r-- 1 amandabackup disk 1471 2007-05-11 13:29 amanda-client.conf
-rw-r--r-- 1 amandabackup disk 26888 2007-05-15 16:04 amanda.conf
-rw------- 1 amandabackup disk 9013 2007-05-16 00:15 amdump.1
-rw------- 1 amandabackup disk 9020 2007-05-15 00:15 amdump.2
-rw------- 1 amandabackup disk 2 2007-05-11 13:34 changer-access
-rw------- 1 amandabackup disk 2 2007-05-11 13:34 changer-clean
-rw------- 1 amandabackup disk 2 2007-05-11 13:34 changer-slot
-rw-r--r-- 1 amandabackup disk 766 2007-05-14 14:10 disklist
-rwxr----- 1 root root 2554 2007-05-14 14:08 disklist.old
-rw------- 1 amandabackup disk 890 2007-05-15 00:15 log.20070515001501.0
-rw------- 1 amandabackup disk 889 2007-05-16 00:15 log.20070516001501.0
-rw-r--r-- 1 amandabackup disk 0 2007-05-16 14:42 newfile
drwx------ 2 amandabackup disk 4096 2007-05-15 00:15 oldlog
-rw-r--r-- 1 amandabackup disk 0 2007-05-16 14:42 tapelist
-rw------- 1 amandabackup disk 0 2007-05-16 14:06 tapelist.amlabel
-rwxr----- 1 root root 130 2007-05-14 14:08 tapelist.old
-rw------- 1 amandabackup disk 130 2007-05-16 00:15 tapelist.yesterday


disklist.old and tapelist.old are copied from the previous installation of Amanda.

martineau
May 16th, 2007, 12:09 PM
Try the attached patch, it should give a better error message.

John
May 16th, 2007, 12:29 PM
Try the attached patch, it should give a better error message.

Pulled your changes, applied them, rebuilt, and re-ran Amlabel:


rewinding, reading label DailySet11
rewinding, writing label DailySet11, checking labelerror [opening /usr/local/etc/amanda/DailySet1/tapelist.new: Permission denied]amlabel: couldn't write tapelist: Permission denied

Well, there's the problem:

-rw-r--r-- 1 amandabackup disk 0 2007-05-16 14:42 tapelist
-rw------- 1 amandabackup disk 0 2007-05-16 15:27 tapelist.amlabel
-rwxr----- 1 root root 130 2007-05-14 14:08 tapelist.new

tapelist.new is being created 700 by root:root.

Now the question is, why, and how do I fix that?

[EDIT]: No, wait, I'm an idiot. Really, truly, an idiot, in no small part because I gave you bad information in my previous post.

The config files from the previous version were named disklist.new and tapelist.new - because I'd copied them into the same folder as the default, to mark them as the ones I wanted to use instead of the existing default ones. I edited them in the ls -la above to make it "clearer" to people reading, and it wasn't until that error message popped up that I realised I'd actually picked the same name as the temporary file Amanda was trying to write - and then not given you kind folks the information you would have needed to tell me "delete that file, jackass, it's got the one single bad name you could possibly have picked".

Mea maxima culpa, and I promise to not be "helpful" that way next time.

It works now. Problem solved! Thank you kindly.

martineau
May 16th, 2007, 12:39 PM
I don't understand.
Do you have a crontab or someone running amanda as the root user?
I don't how this 2 days old file 'tapelist.new' was created, but it's not amanda.
amanda must be able to create that file.

John
May 16th, 2007, 12:43 PM
I was editing the previous post while you responded.

I'm an idiot.

The problem is fixed as soon as I stopped being an idiot.