ivdbackup as well as other commands that accept the --dbg option require three parameters.
usually those are looking like this:
--dbg D . TCEI
for detailed debugging. The parameters are described in /etc/opt/ivd/trace.cfg file.
Regarding the problem:
TarFile is usually a class exported by tarfile.py which has a Copyright notice by Lars Gustäbl.
OA is using version 0.7.9 of this file currently. If a newer Python or tarfile.py version is being used, it may be required to adjust ivdbackup source ( in directory backupsrv) for that.
Hi,
thanks for the answer.
I have installed tarfile and python-bz2 from the 3rd party directory. When running the backup toole with the debug options I get the following error messages:
[L 2010/01/15 12:06:18] Creating tar archive...
[N 2010/01/15 12:06:18] Tar archive name: /var/opt/ivd/diskbuf/01/backup-20100115-120607.tar.bz2
[L 2010/01/15 12:06:18] ERROR: Creating tar archive failed.
[E BCKP, 007054 2010/01/15 12:06:18; root@localhost; CreateTar, /opt/ivd/lbin/ivdbackup.py :777]
Name Error (NameError): INTERNAL ERROR global name 'TarFile' is not defined
Execution stack dump :
2: CreateTar::tarObj = os_spec.cmn_Tarfile(a_cmnParamObj.m_tmptarfName "/opt/ivd/lbin/ivdbackup.py": 757
1: __init__::self.tar = TarFile.open(a_tarFileName "/opt/ivd/lbin/os_spec/__init__.py": 108
[D 2010/01/15 12:06:18] <== CreateTar()
[N 2010/01/15 12:06:18] Exception was thrown. Message:
Name Error (NameError): INTERNAL ERROR global name 'TarFile' is not defined
Execution stack dump :
4: main::CreateTar(cmnParamObj) "/opt/ivd/lbin/ivdbackup.py": 1054
3: CreateTar::a_cmnParamObj.m_logObj.ElogThrow(excerr "/opt/ivd/lbin/ivdbackup.py": 777
2: ElogThrow::self.m_elog.WriteReThrow(a_exception "/opt/ivd/lbin/common/cmn_log.py": 785
1: WriteReThrow::raise a_exception "/opt/ivd/lbin/common/cmn_log.py": 606
[D 2010/01/15 12:06:18] ==> SuspendIvdMgr()
regards,
Martin Schuppert
Hi Martin
please check the PYTHONPATH environment in your installation.
Python offers the pdb module. To use it put
import pdb
pdb.set_trace()
The last statement is a hard coded breakpoint.
For details on pdb see the python documentation.
Once in pdb you may use all python commands in the environment of the script under debug.
If e.g. the sys module has been loaded already , the PYTHONPATH could be checked by the following command:
sys.path
This prints a list of all path the modules are searched in.
sys.modules
prints the list of all modules currently loaded.
import tarfile
should import the module tarfile if not loaded already
dir(tarfile) shows everything that is inside the module.
If
from tarfile import *
was used, you should see the content with dir() besides the build in objects.
I hope that helps.
Happy debugging :)
Hi,
thanks for the hints! With these I've done some debugging and reverse engineering on the ivdbackup problem.
The TarFile variable is declared in the python script /opt/ivd/lbin/os_spec/psxtarfile.py - but this file is an empty file. A deeper look at the build process shows that this file is originally the wintarfile.py.
In the ivd-tools/build/ivdscriptlist file is the link between wintarfile.py and psxtarfile.py:
/backupsrv/os_spec/wintarfile.py /opt/ivd/lbin/os_spec/psxtarfile.py
But there is no /backupsrv/os_spec/wintarfile.py. The wintarfile.py is located in the 3rd-party directory. When you replace the empty psxtarfile.py with wintarfile.py the ivdbackup works. Why is the wintarfile.py needed under linux? In /backupsrv/os_spec is a wintarfile-0.7.9.patch. Do we need this patch?
Regards,
Martin
Hi,
tried to use the ivdbackup tool on a test implementation of OpenArchive to get a backup to a local file. But as result I always get the error messages:
[2010/01/04 14:53:33] ERROR: Creating tar archive failed.
...
[2010/01/04 14:53:40] ERROR: Backup failed: -1, INTERNAL ERROR global name 'TarFile' is not defined
I also tried to use the --dbg option to get more information but I can't find any help of the Level and Flags properties.
--dbg
platform: ia32
OS: sles9 up3
Thanks!
# ivdbackup -f /tmp/test.tar.bz2 --nomedia
[2010/01/04 14:53:22] Backup started.
[2010/01/04 14:53:22] Backup parameters: /opt/ivd/lbin/ivdbackup.py -f /tmp/test.tar.bz2 --nomedia
[2010/01/04 14:53:22] Connected to server: localhost.
[2010/01/04 14:53:22] Backup job started. (JobID: 20100104000020).
[2010/01/04 14:53:24] Suspending partition...
[2010/01/04 14:53:24] Partition ivdfs01: Suspended.
[2010/01/04 14:53:24] Deleting HSMDB journal files...
[2010/01/04 14:53:24] Partition ivdfs01: HSMDB journal files deleted.
[2010/01/04 14:53:24] Finished suspending for all partitions.
[2010/01/04 14:53:24] Finished deleting of HSMDB journal files for all partitions.
[2010/01/04 14:53:24] RMDB is suspended!
[2010/01/04 14:53:24] Restoring /var/opt/ivd/rmdb/rmdb.gdb to shrink the database
[2010/01/04 14:53:28] Volume /dev/vg_ivd/ivdfri: Creating snapshot...
[2010/01/04 14:53:29] Volume /dev/vg_ivd/ivdfri: Snapshot created.
[2010/01/04 14:53:29] Volume /dev/vg_ivd/ivdlog: Creating snapshot...
[2010/01/04 14:53:31] Volume /dev/vg_ivd/ivdlog: Snapshot created.
[2010/01/04 14:53:31] Volume /dev/vg_ivd/ivdpart: Creating snapshot...
[2010/01/04 14:53:32] Volume /dev/vg_ivd/ivdpart: Snapshot created.
[2010/01/04 14:53:32] Volume /dev/vg_ivd/ivdvar: Creating snapshot...
[2010/01/04 14:53:33] Volume /dev/vg_ivd/ivdvar: Snapshot created.
[2010/01/04 14:53:33] RMDB is resumed!
[2010/01/04 14:53:33] Unsuspending partition...
[2010/01/04 14:53:33] Partitions ivdfs01: Unsuspended.
[2010/01/04 14:53:33] Finished unsuspending for all partitions.
[2010/01/04 14:53:33] Collecting backup statistics...
[2010/01/04 14:53:33] Backup (files: 31, size: 435 KB).
[2010/01/04 14:53:33] Disk buffer: Allocate free space...
[2010/01/04 14:53:33] Creating tar archive...
[2010/01/04 14:53:33] ERROR: Creating tar archive failed.
[2010/01/04 14:53:33] Deleting FSC journal files...
[2010/01/04 14:53:33] Partitions ivdfs01: FSC journal files deleted.
[2010/01/04 14:53:33] Finished deleting FSC journal files for all partitions.
[2010/01/04 14:53:35] Snapshot /dev/vg_ivd/ivdfri_snap: Released.
[2010/01/04 14:53:37] Snapshot /dev/vg_ivd/ivdlog_snap: Released.
[2010/01/04 14:53:38] Snapshot /dev/vg_ivd/ivdpart_snap: Released.
[2010/01/04 14:53:40] Snapshot /dev/vg_ivd/ivdvar_snap: Released.
[2010/01/04 14:53:40] Backup job stopped.
[2010/01/04 14:53:40] ERROR: Backup failed: -1, INTERNAL ERROR global name 'TarFile' is not defined