DB_VERSION_MISMATCH: Database environment version mismatch

book

Article ID: 167954

calendar_today

Updated On:

Products

XOS

Issue/Introduction

The RPM database lock files may become inconsistent under sporadic conditions and cause a failure of various CLI commands.
Running various CLI commands like  upgrade verify-system or  show current-release verify-rpm result in the following or similar messages:
 
CBS# upgrade verify-system 9.5.6-49 
Fri Jan 25 15:59:45 2013 
 
rpmdb: Program version 4.3 doesn't match environment version 
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch 
error: cannot open Packages index using db3 - (-30974) 
error: cannot open Packages database in /var/lib/rpm 
/crossbeam/bin/cbs_upgrade_check.sh: line 58: [: 9: unary operator expected 
/crossbeam/bin/cbs_upgrade_check.sh: line 60: [: 9: unary operator expected 
...
ERROR: Release 9.5.6-49 is not greater than current release 
 
%MISC-ERR: System is NOT ready for upgrade 
Detail: Release 9.5.6-49 


CBS# configure vap-group vpn xslinux_v5 
 
Are you sure you want to create a new vap-group with OS version xslinux_v5? <Y or N> [Y]: 
 
Creating vap-group vpn. May take several minutes... 
.......... 
%MISC-ERR: Unable to execute command 
Detail: Failed to create VAP group 
rpmdb: unable to join the environment 
error: db4 error(11) from dbenv->open: Resource temporarily unavailable 
error: cannot open Packages index using db3 - Resource temporarily unavailable (11) 
error: cannot open Packages database in /var/lib/rpm 
...
expr: syntax error 


Another similar messaging is observed when running the rpm command on the CPM Unix command line :

[[email protected] admin]# rpm -qa 
rpmdb: unable to join the environment 
error: db4 error(11) from dbenv->open: Resource temporarily unavailable 
error: cannot open Packages index using db3 - Resource temporarily unavailable (11) 
error: cannot open Packages database in /var/lib/rpm 

 

Cause

This issue is related to an inconsistency in the RPM (RedHat Package Manager) database lock files. 

Resolution

N/A

Workaround

To clean up the RPM lock files, run rm -f var/lib/rpm/__db.*  from the CPM Unix prompt. The files will be recreated automatically by the system.

CBS# unix su
Password: 
[[email protected] admin]# rm -f /var/lib/rpm/__db*

Then test the RPM functionality with rpm -qa. This command should display the list of installed RPMs without any DB errors and all CLI commands should work again.