Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Thursday, July 3, 2014

Troubleshooting Backuppc problems

My environment: Ubuntu 12.04 + BackupPC 3.2.1
Xfer Method: Rsync + SSH

Log file location: /var/lib/backuppc/log/LOG
Host per log: TOPDIR/pc/$host/LOG
Mine is: /data/backuppc/pc/$host/LOG


The easiest way to debug backup problems on a specific host is to run BackupPC_dump manually as the BackupPC user. This is the most important thing, run it at first to detect the source of problem
/usr/share/backuppc/bin/BackupPC_dump -v -f remote_host.vn > remote_host.log
http://backuppc.sourceforge.net/faq/

Common Backuppc Problem

Backuppc user in Visudo group of Remote host. But when the Server start sudo script it return this error

sudo: no tty present and no askpass program specified

In remote host:
visudobackuppc ALL=(root) NOPASSWD: /usr/bin/rsync, /bin/tar

In Backuppc Server
add -t option to ssh
DumpPreUserCmd  $sshPath -t -q -x -l backuppc $host /usr/bin/sudo /usr/local/bin/rsync_script.sh

no ping response

backuppc work only if it can ping the remote host, if it can not ping, you have to check your
  • Network connection to remote host
  • Firewall rules / Polices
If you can ping from backuppc console, it mean backppc ping configuration went wrong:
$Conf{Ping6Path} is not set by default in 3.2.1. The solution is easy. Set this in /etc/backuppc/config.pl
$Conf{Ping6Path} = '/bin/ping6';
If ping also not work -> try Echo (Solution from SysadminWorld.com)
In the BackupPC webinterface, click the client host name, Edit Config, go to the Backup Settings and change the setting PingCmd ($pingPath -c 1 $host by default) to/bin/echo

Don’t forget to check override and click the Save button to apply the change.

Use of qw(…) as parentheses is deprecated

Use of qw(...) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(...) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.

apply one-liner patch from www.tolaris.com
wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-CVE-2011-170886.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

BackupPC displays bogus “Last email sent” messages

BackupPC will send error message emails to the administrator or user of a host (backup target) if it cannot reach the host for a set period of time. The user interface always displays this last message, even if it doesn’t exist:
Last email sent to user@example.com was at 2012-05-01 01:23, subject “”.
apply one-liner patch from www.tolaris.com
wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-no_blank_email.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

Got fatal error during xfer (aborted by signal=PIPE)

This is the most common Backuppc error message. It can be:
Your remote script execution (Xfer script, DumpPreUserCmd, DumpPostUserCmd): it depend on which user running the script, permission to run that script, status of the script, result of the script. Make sure you run the script successfully on the console of that host as backuppc user first , then try run the script remotely on Backuppc Server console for example:
ssh -t -c blowfish -q -x -l backuppc remote_server.vn /usr/bin/sudo /usr/local/bin/rsync_script.sh
Your remote location: Check your RsyncShareName in Host Xfer setting carefully. Make sure the directory you specify are exsits and backuppc have permssion to read it, do not add any extra blank line in RsysncShareName

Timeout: possibly the remote script take long time to return. Here is a work around
Try adding -o ServerAliveInterval=300 into RsyncClientRestoreCmd, RsyncClientCmd, DumpPreUserCmd, DumpPostUserCmd
$sshPath -c blowfish -o ServerAliveInterval=300 -q -x -l backuppc $host $rsyncPath $argList+

Backuppc wrong setting: make sure you don't have any typo mistakes on any fields, select the right xfer method.

Resouces on both host while running backup: RAM, CPU, DISK, Network...Any bottle neck?

Turn on Verbose

XferLogLevel=9, RsyncArgs -vv

Waiting for your comment :D 


Wednesday, June 18, 2014

Restore a Windows Server 2008 RC2 from VMWare VDX file

I have to investigate one of the Domain Controller running Windows Server 2008 RC2 from a Backup VMware folder that contain VDX file. This is a snapshot of running Server from last month from other remote backup Datastore.

Restore a Cloned Virtual Machine

In VCenter go to the Datastore that contain VDX file
Right Click VDX file and register VM with different than the running one. EX: SrvrRecovery
After that change the Datastore from backup to our production Datastore
Now when you fire up the Machine it will have a lot of problem because the disk is Write Protected, Hidden and it has Nodefault Driver Letter so the Boot Procedure will fail. To overcome that

Change the value of the disk.EnableUUID parameter to False: Vcenter -> Host -> SrvrRecovery (PowerOFF) -> Actions -> Edit Settings -> VM Options -> Advanced -> Configuration Parameters -> Edit Configuration -> disk.EnableUUID-> False

Ajust booting flags on Primary Boot Partition

VCenter -> SrvrRecoveryPowerON -> Connect Windows Server 2008 RC2 .iso and boot into it.
Optional: change your network card to other place or temporary disable 
When Host bootup -> Esc -> Boot from CD -> Choose Repair your computer -> Select Command Prompt Option.
diskpart
list volume
select volume 1
attributes volume
attributes volume clear nodefaultdriveletter
attributes volume clear hidden
attributes volume clear readonly
exit

Rebuild Boot Configuration Data

In command Prompt 
bootrec /rebuildbcd
type Y (yes)
exit
After it complete successfully exit the prompt and restart the server 

Yeah man! the Virtual server is coming back

Reference:

Tuesday, June 10, 2014

Ubuntu Network Manager cannot connect to WPA2/PEAP/MSCHAPv2 network without CA_Certificate

Quick way to fix all the Wireless network that require Certificate, you don't have to provide your certificate.
Use incrontab to pull the trigger automatically when you connect to Wireless network that require Certificate, the script will add a mozilla External Root Certificate when your Network Manager create Wireless SSiD connection on /etc/NetworkManager/system-connections/

sudo -i
incrontab -e
/etc/NetworkManager/system-connections/ IN_CREATE sleep 3; grep -rl 'system-ca-certs=true' /etc/NetworkManager/system-connections/ | xargs sed -i '/system-ca-certs=true/a ca-cert=/usr/share/ca-certificates/mozila/AddTrust_External_Root.crt'