backuppc errors: "Tar exited with error 512 ()" due to read permission failures

Bug #497732 reported by Jim Tarvid
68
This bug affects 13 people
Affects Status Importance Assigned to Milestone
backuppc (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

A default install of backuppc produces fails on an hourly basis like this:

 Backup failed on localhost (Tar exited with error 512 () status)

because it is trying to back up /etc and several files there are not readable by the user which is doing the backup (id backuppc).

Workaround: you can either ignore the failures via the --ignore-failed-read option to tar, or grant superuser privileges to backuppc and do the backup via sudo as described in comment #15.

----

Binary package hint: backuppc

ntents of file /var/lib/backuppc/log/LOG, modified 2009-12-17 06:00:16

2009-12-17 01:00:00 Running 2 BackupPC_nightly jobs from 0..15 (out of 0..15)
2009-12-17 01:00:00 Running BackupPC_nightly -m 0 127 (pid=24875)
2009-12-17 01:00:00 Running BackupPC_nightly 128 255 (pid=24876)
2009-12-17 01:00:00 Next wakeup is 2009-12-17 02:00:00
2009-12-17 01:00:01 Started full backup on localhost (pid=24877, share=/etc)
2009-12-17 01:00:19 Finished admin1 (BackupPC_nightly 128 255)
2009-12-17 01:00:22 BackupPC_nightly now running BackupPC_sendEmail
2009-12-17 01:00:23 Finished admin (BackupPC_nightly -m 0 127)
2009-12-17 01:00:23 Pool nightly clean removed 0 files of size 0.00GB
2009-12-17 01:00:23 Pool is 0.00GB, 0 files (0 repeated, 0 max chain, 0 max links), 1 directories
2009-12-17 01:00:23 Cpool nightly clean removed 3 files of size 0.00GB
2009-12-17 01:00:23 Cpool is 0.01GB, 2914 files (0 repeated, 0 max chain, 24 max links), 2373 directories
2009-12-17 01:00:36 Backup failed on localhost (Tar exited with error 512 () status)
2009-12-17 01:00:36 Running BackupPC_link localhost (pid=24893)
2009-12-17 01:00:36 Finished localhost (BackupPC_link localhost)
2009-12-17 02:00:01 Next wakeup is 2009-12-17 03:00:00
2009-12-17 02:00:01 Started full backup on localhost (pid=24927, share=/etc)
2009-12-17 02:00:16 Backup failed on localhost (Tar exited with error 512 () status)
2009-12-17 02:00:16 Running BackupPC_link localhost (pid=24934)
2009-12-17 02:00:16 Finished localhost (BackupPC_link localhost)
2009-12-17 03:00:00 Next wakeup is 2009-12-17 04:00:00
2009-12-17 03:00:00 Started full backup on localhost (pid=24968, share=/etc)
2009-12-17 03:00:15 Backup failed on localhost (Tar exited with error 512 () status)
2009-12-17 03:00:15 Running BackupPC_link localhost (pid=24984)
2009-12-17 03:00:16 Finished localhost (BackupPC_link localhost)
2009-12-17 04:00:00 Next wakeup is 2009-12-17 05:00:00
2009-12-17 04:00:00 Started full backup on localhost (pid=25024, share=/etc)
2009-12-17 04:00:15 Backup failed on localhost (Tar exited with error 512 () status)
2009-12-17 04:00:15 Running BackupPC_link localhost (pid=25031)
2009-12-17 04:00:15 Finished localhost (BackupPC_link localhost)
2009-12-17 05:00:00 Next wakeup is 2009-12-17 06:00:00
2009-12-17 05:00:01 Started full backup on localhost (pid=25067, share=/etc)
2009-12-17 05:00:16 Backup failed on localhost (Tar exited with error 512 () status)
2009-12-17 05:00:16 Running BackupPC_link localhost (pid=25074)
2009-12-17 05:00:16 Finished localhost (BackupPC_link localhost)
2009-12-17 06:00:00 Next wakeup is 2009-12-17 07:00:00
2009-12-17 06:00:01 Started full backup on localhost (pid=25134, share=/etc)
2009-12-17 06:00:16 Backup failed on localhost (Tar exited with error 512 () status)
2009-12-17 06:00:16 Running BackupPC_link localhost (pid=25141)
2009-12-17 06:00:16 Finished localhost (BackupPC_link localhost)

ProblemType: Bug
Architecture: amd64
Date: Thu Dec 17 06:57:25 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: backuppc 3.1.0-6ubuntu4
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-16.52-generic
SourcePackage: backuppc
Uname: Linux 2.6.31-16-generic x86_64

Revision history for this message
Jim Tarvid (tarvid) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

I was wondering if you were still having this problem?

Regards
chuck

Changed in backuppc (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Jim Tarvid (tarvid) wrote : Re: [Bug 497732] Re: Tar exited with error 512 () status

Yes.

2010-01-09 01:00:15 Backup failed on localhost
<http://localhost/backuppc/index.cgi?host=localhost> (Tar exited with
error 512 () status)

I do get email messages

Message 27:

From <email address hidden> Thu Jan 7 01:00:05 2010
X-Original-To: backuppc
To: <email address hidden>
cc:
Subject: BackupPC: no recent backups on localhost
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Date: Thu, 7 Jan 2010 01:00:04 -0500 (EST)
From: <email address hidden> (BackupPC)

Dear BackupPC,,,,

Your PC (localhost) has not been successfully backed up for 14616.3 days.
Your PC has been correctly backed up 1 times from 0.1 to 14616.3
ago. PC backups should occur automatically when your PC is connected
to the network.

If your PC has been connected for more than a few hours to the
network during the last 14616.3 days you should contact IS to find
out why backups are not working.

Otherwise, if you are out of the office, there's not much you can
do, other than manually copying especially critical files to other
media. You should be aware that any files you have created or
changed in the last 14616.3 days (including all new email and
attachments) cannot be restored if your PC disk crashes.

Regards,
BackupPC Genie
http://backuppc.sourceforge.net

Logs contain dpkg messages from installation, mail logs and two entries in
popularity-contest.

Any suggestions?

On Mon, Jan 4, 2010 at 9:32 AM, Chuck Short <email address hidden>wrote:

> Hi,
>
> I was wondering if you were still having this problem?
>
> Regards
> chuck
>
> ** Changed in: backuppc (Ubuntu)
> Importance: Undecided => Low
>
> ** Changed in: backuppc (Ubuntu)
> Status: New => Incomplete
>
> --
> Tar exited with error 512 () status
> https://bugs.launchpad.net/bugs/497732
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Rev. Jim Tarvid, PCA
Abajo Y A La Izquierda Esta El Corazon

Revision history for this message
Chuck Short (zulcss) wrote : Re: Tar exited with error 512 () status

Can you check your xferlog in your /var/lib/backup?

Thanks
chuck

Revision history for this message
Jim Tarvid (tarvid) wrote : Re: [Bug 497732] Re: Tar exited with error 512 () status
Download full text (3.8 KiB)

On Mon, Jan 11, 2010 at 2:19 PM, Chuck Short <email address hidden>wrote:

> Can you check your xferlog in your /var/lib/backup?
>
> Thanks
> chuck
>
> There is a directory /var/lib/backuppc/log and a file LOG but no xferlog.
I don't think it gets that far.

root@venus:/var/lib/backuppc/log# cat LOG
2010-01-11 01:00:00 Running 2 BackupPC_nightly jobs from 0..15 (out of
0..15)
2010-01-11 01:00:00 Running BackupPC_nightly -m 0 127 (pid=24842)
2010-01-11 01:00:00 Running BackupPC_nightly 128 255 (pid=24843)
2010-01-11 01:00:00 Next wakeup is 2010-01-11 02:00:00
2010-01-11 01:00:01 Started full backup on localhost (pid=24844, share=/etc)
2010-01-11 01:00:04 Finished admin1 (BackupPC_nightly 128 255)
2010-01-11 01:00:04 BackupPC_nightly now running BackupPC_sendEmail
2010-01-11 01:00:05 Finished admin (BackupPC_nightly -m 0 127)
2010-01-11 01:00:05 Pool nightly clean removed 0 files of size 0.00GB
2010-01-11 01:00:05 Pool is 0.00GB, 0 files (0 repeated, 0 max chain, 0 max
links), 1 directories
2010-01-11 01:00:05 Cpool nightly clean removed 2 files of size 0.00GB
2010-01-11 01:00:05 Cpool is 0.01GB, 2916 files (0 repeated, 0 max chain, 24
max links), 2416 directories
2010-01-11 01:00:15 Backup failed on localhost (Tar exited with error 512 ()
status)
2010-01-11 01:00:15 Running BackupPC_link localhost (pid=24853)
2010-01-11 01:00:16 Finished localhost (BackupPC_link localhost)
2010-01-11 02:00:00 Next wakeup is 2010-01-11 03:00:00
2010-01-11 02:00:00 Started full backup on localhost (pid=24890, share=/etc)
2010-01-11 02:00:14 Backup failed on localhost (Tar exited with error 512 ()
status)
2010-01-11 02:00:14 Running BackupPC_link localhost (pid=24897)
2010-01-11 02:00:14 Finished localhost (BackupPC_link localhost)
2010-01-11 03:00:00 Next wakeup is 2010-01-11 04:00:00
2010-01-11 03:00:01 Started full backup on localhost (pid=24935, share=/etc)
2010-01-11 03:00:14 Backup failed on localhost (Tar exited with error 512 ()
status)
2010-01-11 03:00:14 Running BackupPC_link localhost (pid=24951)
2010-01-11 03:00:14 Finished localhost (BackupPC_link localhost)
2010-01-11 04:00:00 Next wakeup is 2010-01-11 05:00:00
2010-01-11 04:00:01 Started full backup on localhost (pid=24992, share=/etc)
2010-01-11 04:00:14 Backup failed on localhost (Tar exited with error 512 ()
status)
2010-01-11 04:00:14 Running BackupPC_link localhost (pid=24999)
2010-01-11 04:00:14 Finished localhost (BackupPC_link localhost)
2010-01-11 05:00:01 Next wakeup is 2010-01-11 06:00:00
2010-01-11 05:00:01 Started full backup on localhost (pid=25069, share=/etc)
2010-01-11 05:00:15 Backup failed on localhost (Tar exited with error 512 ()
status)
2010-01-11 05:00:15 Running BackupPC_link localhost (pid=25080)
2010-01-11 05:00:15 Finished localhost (BackupPC_link localhost)
2010-01-11 06:00:00 Next wakeup is 2010-01-11 07:00:00
2010-01-11 06:00:00 Started full backup on localhost (pid=25595, share=/etc)
2010-01-11 06:00:16 Backup failed on localhost (Tar exited with error 512 ()
status)
2010-01-11 06:00:16 Running BackupPC_link localhost (pid=25602)
2010-01-11 06:00:16 Finished localhost (BackupPC_link localhost)
2010-01-11 07:00:00 Next wakeup is 2010-01-11 08:00:00
2010-01-11...

Read more...

Revision history for this message
Chuck Short (zulcss) wrote : Re: Tar exited with error 512 () status

Can you attach your backup configuration files so I can try to reproduce this?

Thanks
chuck

Revision history for this message
Chuck Short (zulcss) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? Thanks!

Revision history for this message
Marcelo Fernandez (fernandezm) wrote :

Hi, I'm having the same problem right after installing backuppc from Karmic repositories... the xfer log says "permission denied" when it access to some /etc/ files:

Contenido del archivo de registro /var/lib/backuppc/pc/localhost/XferLOG.bad.z, modificado 2010-02-17 13:48:06 (Extrayendo sólo Errores)

Running: /usr/bin/env LC_ALL=C /bin/tar -c -v -f - -C /etc --totals --newer=2010-02-16 06:00:01 --exclude=./proc --exclude=./sys --exclude=./tmp --exclude=./dev --exclude=./media .
incr backup started back to 2010-02-16 06:00:01 (backup #249) for directory /etc
Xfer PIDs are now 2296,2295
[ saltadas 10 lineas ]
/bin/tar: ./shadow: Cannot open: Permission denied
[ saltadas 37 lineas ]
/bin/tar: ./passwd-: Cannot open: Permission denied
[ saltadas 123 lineas ]
/bin/tar: ./gshadow: Cannot open: Permission denied
[ saltadas 12 lineas ]
/bin/tar: ./fuse.conf: Cannot open: Permission denied
[ saltadas 35 lineas ]
/bin/tar: ./apparmor.d/cache/usr.sbin.tcpdump: Cannot open: Permission denied
/bin/tar: ./apparmor.d/cache/sbin.dhclient3: Cannot open: Permission denied
[ saltadas 112 lineas ]
/bin/tar: ./ppp/peers: Cannot open: Permission denied
[ saltadas 7 lineas ]
/bin/tar: ./group-: Cannot open: Permission denied
[ saltadas 96 lineas ]
/bin/tar: ./X11/Xwrapper.config: Cannot open: Permission denied
[ saltadas 10 lineas ]
/bin/tar: ./shadow-: Cannot open: Permission denied
[ saltadas 89 lineas ]
/bin/tar: ./sudoers: Cannot open: Permission denied
[ saltadas 127 lineas ]
/bin/tar: ./gshadow-: Cannot open: Permission denied
[ saltadas 9 lineas ]
/bin/tar: ./ufw/before.rules: Cannot open: Permission denied
/bin/tar: ./ufw/after.rules: Cannot open: Permission denied
/bin/tar: ./ufw/before6.rules: Cannot open: Permission denied
[ saltadas 1 lineas ]
/bin/tar: ./ufw/after6.rules: Cannot open: Permission denied
[ saltadas 1 lineas ]
/bin/tar: ./chatscripts: Cannot open: Permission denied
[ saltadas 47 lineas ]
/bin/tar: ./ssl/private: Cannot open: Permission denied
[ saltadas 419 lineas ]
/bin/tar: Exiting with failure status due to previous errors
Tar exited with error 512 () status
[ saltadas 126 lineas ]
tarExtract: Done: 0 errors, 218 filesExist, 229782 sizeExist, 82888 sizeExistComp, 478 filesTotal, 1411070 sizeTotal
Got fatal error during xfer (Tar exited with error 512 () status)
Backup aborted (Tar exited with error 512 () status)

Sorry for the spanish message logs...

Maybe Apparmor is getting in the middle?

Regards

Revision history for this message
Marcelo Fernandez (fernandezm) wrote :

This error logs one Full backup with problems, right after installing backuppc:

Contents of file /var/lib/backuppc/pc/localhost/XferLOG.0.z, modified 2010-02-17 14:00:09 (Extracting only Errors)

Running: /usr/bin/env LC_ALL=C /bin/tar -c -v -f - -C /etc --totals .
full backup started for directory /etc
Xfer PIDs are now 5932,5931
/bin/tar: ./shadow-: Cannot open: Permission denied
/bin/tar: ./apt/secring.gpg: Cannot open: Permission denied
/bin/tar: ./apt/trustdb.gpg: Cannot open: Permission denied
[ skipped 74 lines ]
/bin/tar: ./passwd-: Cannot open: Permission denied
[ skipped 74 lines ]
/bin/tar: ./chatscripts: Cannot open: Permission denied
/bin/tar: ./fuse.conf: Cannot open: Permission denied
/bin/tar: ./apparmor.d/cache/usr.sbin.tcpdump: Cannot open: Permission denied
/bin/tar: ./apparmor.d/cache/sbin.dhclient3: Cannot open: Permission denied
[ skipped 147 lines ]
/bin/tar: ./X11/Xwrapper.config: Cannot open: Permission denied
[ skipped 140 lines ]
/bin/tar: ./.pwd.lock: Cannot open: Permission denied
[ skipped 123 lines ]
/bin/tar: ./gshadow: Cannot open: Permission denied
/bin/tar: ./shadow: Cannot open: Permission denied
/bin/tar: ./mysql/debian.cnf: Cannot open: Permission denied
[ skipped 121 lines ]
/bin/tar: ./ppp/chap-secrets: Cannot open: Permission denied
/bin/tar: ./ppp/pap-secrets: Cannot open: Permission denied
/bin/tar: ./ppp/peers: Cannot open: Permission denied
/bin/tar: ./sudoers: Cannot open: Permission denied
[ skipped 74 lines ]
/bin/tar: ./group-: Cannot open: Permission denied
/bin/tar: ./gshadow-: Cannot open: Permission denied
/bin/tar: ./ssh/ssh_host_dsa_key: Cannot open: Permission denied
/bin/tar: ./ssh/ssh_host_rsa_key: Cannot open: Permission denied
/bin/tar: ./security/opasswd: Cannot open: Permission denied
[ skipped 76 lines ]
/bin/tar: ./ufw/after.rules: Cannot open: Permission denied
/bin/tar: ./ufw/before6.rules: Cannot open: Permission denied
/bin/tar: ./ufw/before.rules: Cannot open: Permission denied
/bin/tar: ./ufw/after6.rules: Cannot open: Permission denied
[ skipped 260 lines ]
/bin/tar: ./ssl/private: Cannot open: Permission denied
/bin/tar: ./at.deny: Cannot open: Permission denied
[ skipped 1 lines ]
/bin/tar: Exiting with failure status due to previous errors
Tar exited with error 512 () status
[ skipped 288 lines ]
tarExtract: Done: 0 errors, 1224 filesExist, 1877487 sizeExist, 679246 sizeExistComp, 1224 filesTotal, 1877487 sizeTotal
Got fatal error during xfer (Tar exited with error 512 () status)
Backup aborted (Tar exited with error 512 () status)
Saving this as a partial backup

Revision history for this message
Jim Tarvid (tarvid) wrote : Re: [Bug 497732] Re: Tar exited with error 512 () status

Presuming you mean config.pl

Thanks

Jim

On Mon, Jan 25, 2010 at 9:55 AM, Chuck Short <email address hidden>wrote:

> Can you attach your backup configuration files so I can try to reproduce
> this?
>
> Thanks
> chuck
>
> --
> Tar exited with error 512 () status
> https://bugs.launchpad.net/bugs/497732
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Rev. Jim Tarvid, PCA
http://ls.net
http://drupal.ls.net
http://crossleft.org

Revision history for this message
Chuck Short (zulcss) wrote : Re: Tar exited with error 512 () status

Yes but those permission errors mean you cant access those files what about running with sudo.

chuck

Revision history for this message
Marcelo Fernandez (fernandezm) wrote :

Well, to avoid the error state in backuppc I added "--ignore-failed-read" to the tar command in localhost.pl [1]:

$Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C $tarPath -c -v -f - -C $shareName'
                        . ' --totals --ignore-failed-read';

The fact is backuppc makes backup of localhost under "backuppc" system user, not a sudoer one, not root (see the comment in localhost.pl...). I don't know if this is right or not, but it's good to know that those files (passwd, shadow, group, etc.), aren't copied in the process.

[1] http://www.backupcentral.com/phpBB2/two-way-mirrors-of-external-mailing-lists-3/backuppc-21/tar-error-512-68957/

Regards

Chuck Short (zulcss)
Changed in backuppc (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Jim Tarvid (tarvid) wrote : Invitation to connect on LinkedIn

LinkedIn
------------

Bug,

I'd like to add you to my professional network on LinkedIn.

- Jim

Jim Tarvid
Internet Engineer at LSNet
Johnson City, Tennessee Area

Confirm that you know Jim Tarvid
https://www.linkedin.com/e/-lkitxg-goaoyyyh-6t/isd/3040031598/ECP8Fgp5/

--
(c) 2011, LinkedIn Corporation

Revision history for this message
Jim Patterson (jimp-launchpad-rs9z) wrote : Re: Tar exited with error 512 () status

This seems to be a very nasty bug to me. Anyone installing backupc and expecting a no hassle backup of 'localhost' will be in for a shock, as the default tar arguments simply won't work under the default 'backuppc' user. There will always be at least a few files that don't give world-read access. What's worse is that backuppc will just keep trying to do its first full backup, trashing performance on that pc.

Including --ignore-failed-read as a default argument to tar seems to be a simple and effective fix. If users do want a full backup including protected files and take steps to do so e.g. run as 'sudo', it will have no effect.

Revision history for this message
Wayne Law (wayne-law) wrote :

Just installed 10.04 LTS on a new box and had the exact same problem. The following seems to fix this error.

In the localhost.pl file located in /etc/backuppc change the tarClientCmd from

$Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C $tarPath -c -v -f - -C $shareName'
                        . ' --totals';

to

$Conf{TarClientCmd} = '/usr/bin/sudo $tarPath -c -v -f - -C $shareName --totals';

in the sudoers file located in /etc add the following

backuppc ALL = NOPASSWD: /bin/tar

I am assuming you are still using the default user "backuppc" and this will allow backuppc to run sudo in the /bin/tar directory without a password.

Seemed to work ok for me.

/Wayne

Neal McBurnett (nealmcb)
description: updated
summary: - Tar exited with error 512 () status
+ backuppc errors: "Tar exited with error 512 ()" due to read permission
+ failures
Revision history for this message
Neal McBurnett (nealmcb) wrote :

This seems much higher-priority than "low" to me. To have the default install mysteriously fail hourly provides no confidence in backuppc, and saving critical system configuration data like password hashes is one of the main jobs of a backup tool.

Revision history for this message
Reinier (reinier-koops) wrote :

#15, Wayne Law, the problem is still recurring. Your solution helped me fix it, just wanted to say thanks that it worked for me! :D

Revision history for this message
Michael Mess (michael-michaelmess) wrote :

You should not remove the environment setting (/usr/bin/env LC_ALL=C ) as this is important for backuppc to understand the output of tar, if the system language is not English.

In localhost.pl you should have:

$Conf{TarClientCmd} = '/usr/bin/env LC_ALL=C /usr/bin/sudo $tarPath -c -v -f - -C $shareName'
                        . ' --totals';

Otherwise, if your systems default language is not English, backuppc will not understand what tar is saying in your language and you will see an error like:

Running: /usr/bin/sudo /bin/tar -c -v -f - -C /etc --totals .
full backup started for directory /etc
Xfer PIDs are now 11679,11678
[ skipped 2977 lines ]
Gesamtzahl geschriebener Bytes: 10465280 (10MiB, 2,7MiB/s)
[ skipped 240 lines ]
tarExtract: Done: 0 errors, 2828 filesExist, 7357656 sizeExist, 2282752 sizeExistComp, 2877 filesTotal, 8329812 sizeTotal
Got fatal error during xfer (Gesamtzahl geschriebener Bytes: 10465280 (10MiB, 2,7MiB/s))
Backup aborted (Gesamtzahl geschriebener Bytes: 10465280 (10MiB, 2,7MiB/s))
Saving this as a partial backup

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.