Article ID: 119874, created on Jan 29, 2014, last review on Jun 17, 2016

  • Applies to:
  • Virtuozzo 6.0
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor
  • Virtual Automation


It is impossible to restore a container from a backup, the error points to missing packages:

[root@vz ~]# vzarestore -B -e 3a267ea4-989b-5547-b138-5ca2ab46f99c/20131226112006 --storage root@backup-server
Restore container: #101 from 3a267ea4-989b-5547-b138-5ca2ab46f99c/20131226112006...
* Operation with the  #101 is finished with errors: Failed to check template consistency, code 52. See vzpkg(8) manpage for more information.
2014-01-29T04:24:39+0100 : Error: The next package(s) are not available:
2014-01-29T04:24:39+0100 : python.i386                              2.4.3-43.el5
2014-01-29T04:24:39+0100 : python-elementtree.i386                  1.2.6-5
2014-01-29T04:24:39+0100 : rpm-python.i386                
2014-01-29T04:24:39+0100 : libxml2-python.i386                      2.6.26-
2014-01-29T04:24:39+0100 : python-sqlite.i386                       1.1.7-1.2.1
2014-01-29T04:24:39+0100 : m2crypto.i386                            0.16-6.el5.8
2014-01-29T04:24:39+0100 : python-libs.i386                         2.4.3-43.el5
2014-01-29T04:24:39+0100 : yum-metadata-parser.i386                 1.1.2-3.el5.centos
2014-01-29T04:24:39+0100 : elfutils.i386                            0.137-3.el5
Restore failed: Failed to check template consistency, code 52. See vzpkg(8) manpage for more information.


The restored VPS contains packages, which are not available in the template area /vz/template on the local hardware node and on the repositories, configured for the OS template the container is based on.

Mostly such situations arise when the packages belong to old OSes, which were moved to archive repositories. E.g. CentOS versions, different from the most recent ones, are normally available on and Ubuntu stores its older releases on



Get the OS template from the backup:

[root@vz ~]# vzarestore --print-ve-config 3a267ea4-989b-5547-b138-5ca2ab46f99c/20131226112006 | grep OSTEMPLATE

Add all possible repositories for this version. For example, for centos-5-x86_64 the following list of repositories will allow to fetch all required packages:

[root@vz ~]# cat /vz/template/centos/5/x86_64/config/os/default/repositories
# Commented out due to inconsistency of dirrerent mirrors. Now we use mirrorlist

WAY 2 (possible with PVA Agent >= 4.6 only)

  1. Restore the container with --force flag, as it skips the errors about missing packages:

    [root@vz ~]# vzarestore --force -B -e 3a267ea4-989b-5547-b138-5ca2ab46f99c/20131226112006 --storage root:*****@backup-server
    Restore container: #101 from 3a267ea4-989b-5547-b138-5ca2ab46f99c/20131226112006...
    * Operation with the  3a267ea4-989b-5547-b138-5ca2ab46f99c is started
    * Restoring backup 3a267ea4-989b-5547-b138-5ca2ab46f99c/20131226112006 from backup-server
    * Backup storage: preparing to restore operation
    * Backup storage: getting private backup data
    * Initializing restore operation
    * Backup storage: sending backup file
    * Restoring private area
     100% |**************************************************************|
    * Finalizing restore
    * Operation with the  #101 is finished successfully.
    Container #101 restored successfully.
  2. Scan the private area of the container and fetch the required packages:

    [root@vz ~]# grep SCAN /etc/vztt/vztt.conf
    [root@vz ~]# sed -i 's~#SCAN~SCAN~' /etc/vztt/vztt.conf
    [root@vz ~]# grep SCAN /etc/vztt/vztt.conf
    [root@vz ~]# vzpkg sync_vzpackages 101
    [root@vz ~]# vzpkg repair /vz/private/101{,/ve.conf}
    Total download size: 45 M
    Downloading Packages:
    (1/3): sendmail-8.13.8-8.el5.x86_64.rpm     | 637 kB     00:01
    (2/3): psa-courier-imap-3.0.8-cos5.build109101029.18.x86_64.rpm     | 1.6 MB     00:02
    (3/3): pp-sitebuilder-5.0.0-33387.10092415.noarch.rpm     |  43 MB     00:03
    Total 5.8 MB/s |  45 MB     00:07
  3. Ensure there are no more missing files, i.e. broken VZFS links, inside the container:

    • mount the container:

      [root@vz ~]#  vzctl mount 101
    • the following command should not produce any errors:

      [root@vz ~]# find /vz/root/101 -xdev -ls >/dev/null
      [root@vz ~]#

Search Words

VPS backup use for recovery

vps restore template consistency

code 52

Failed to check template consistency

Restore failed: Failed to check template consistency, code 52.

a26b38f94253cdfbf1028d72cf3a498b 2897d76d56d2010f4e3a28f864d69223 d02f9caf3e11b191a38179103495106f 319940068c5fa20655215d590b7be29b e8e50b42231236b82df27684e7ec0beb 0dd5b9380c7d4884d77587f3eb0fa8ef c62e8726973f80975db0531f1ed5c6a2

Email subscription for changes to this article
Save as PDF