Request for help cleaning up my config.db

dommel

New Member
Dec 17, 2022
6
0
1
Hi there!
I am somewhat of a fresh home user of proxmox.
While adding a second host to my cluster, my first hostname had to change. After following the KB on this (edit /etc/hosts /etc/hostname and /etc/postfix/main.cf and the coroconf) a reboot I noticed this host with the wrong (old) name in the UI. (I did follow the same procedure on another host, and that rename went just fine...) So I tried figuring out how to fix that as well. I noticed that all my VMs were still in the folder under /etc/pve/nodes/ so I moved the qemu-server folder from the old server named folder to the new named folder.
After another reboot my server would not come back online.

I traced it to a duplicate entry in the config.db. But I am rly not db savy and confident enough to edit this...

journalctl -b -u pve-cluster gives me (among other lines):
Code:
systemd[1]: Starting The Proxmox VE cluster filesystem...
pmxcfs[1295]: [database] crit: found entry with duplicate name 'qemu-server' - A:(inode = 0x000000000030E094, parent = 0x000000000030E093, v./mtime = 0x30E094/0x1671282833) vs. B:(inode = 0x0000000000>
pmxcfs[1295]: [database] crit: found entry with duplicate name 'qemu-server' - A:(inode = 0x000000000030E094, parent = 0x000000000030E093, v./mtime = 0x30E094/0x1671282833) vs. B:(inode = 0x0000000000>
pmxcfs[1295]: [database] crit: DB load failed
pmxcfs[1295]: [main] crit: memdb_open failed - unable to open database '/var/lib/pve-cluster/config.db'
pmxcfs[1295]: [main] notice: exit proxmox configuration filesystem (-1)
pmxcfs[1295]: [database] crit: DB load failed
pmxcfs[1295]: [main] crit: memdb_open failed - unable to open database '/var/lib/pve-cluster/config.db'
pmxcfs[1295]: [main] notice: exit proxmox configuration filesystem (-1)

pmcxfs -d
Code:
[database] crit: found entry with duplicate name 'qemu-server' - A:(inode = 0x000000000030E094, parent = 0x000000000030E093, v./mtime = 0x30E094/0x1671282833) vs. B:(inode = 0x000000000030E64B, parent = 0x000000000030E093, v./mtime = 0x30E64B/0x1671283925) (database.c:430:bdb_backend_load_index)
[database] crit: DB load failed (database.c:470:bdb_backend_load_index)
[main] crit: memdb_open failed - unable to open database '/var/lib/pve-cluster/config.db' (pmxcfs.c:888:main)
[main] notice: exit proxmox configuration filesystem (-1) (pmxcfs.c:1099:main)


Could someone help me figure out how to remove the duplicate entry in there?
 
Last edited:
I did not realize and feel stupid for it, but quite some important stuff is not backed up on the vms on this host. I did not think renaming the host could actually break it this bad :( I am a little stressed now... Is there a way to extract the vm's from this host? I have other hosts I can run this on. But it being down is not something I can live with long.

Btw I noticed that
Code:
uname -a
outputs the old hostname still.
 
I tried to follow along in this topic: https://forum.proxmox.com/threads/pve-cluster-fails-to-start.82861/

Code:
# sqlite3 /var/lib/pve-cluster/config.db 'PRAGMA integrity_check'
ok
# sqlite3 /var/lib/pve-cluster/config.db .schema
CREATE TABLE tree (  inode INTEGER PRIMARY KEY NOT NULL,  parent INTEGER NOT NULL CHECK(typeof(parent)=='integer'),  version INTEGER NOT NULL CHECK(typeof(version)=='integer'),  writer INTEGER NOT NULL CHECK(typeof(writer)=='integer'),  mtime INTEGER NOT NULL CHECK(typeof(mtime)=='integer'),  type INTEGER NOT NULL CHECK(typeof(type)=='integer'),  name TEXT NOT NULL,  data BLOB);
# sqlite3 /var/lib/pve-cluster/config.db 'SELECT inode,mtime,name FROM tree WHERE parent = 0'
0|1671283999|__version__
2|1666536744|storage.cfg
6|1666536744|datacenter.cfg
8|1666536786|virtual-guest
9|1666536787|priv
11|1666536787|nodes
24|1666536787|pve-www.key
30|1666536787|pve-root-ca.pem
49|1666536787|ha
51|1666536787|sdn
112995|1666704146|replication.cfg
112999|1666704146|vzdump.cron
2232248|1669902564|user.cfg
3098910|1671202556|authkey.pub.old
3098913|1671202556|authkey.pub
3100476|1671283007|corosync.conf
# sqlite3 /var/lib/pve-cluster/config.db 'SELECT inode,mtime,name FROM tree WHERE parent = 347747 or inode = 347747'
#
 
Last edited:
Code:
sqlite3 /var/lib/pve-cluster/config.db 'SELECT inode,mtime,name FROM tree WHERE parent = 0x000000000030E093 or inode = 0x000000000030E094'
13|1671283732|lxc
15|1671283732|openvz
16|1671283732|priv
26|1671283732|pve-ssl.key
35|1671283732|pve-ssl.pem
3203220|1671282833|qemu-server
3204683|1671283925|qemu-server
3204785|1671283996|lrm_status
Schould I delete one of these? And how do I know which one is the old one?
 
Code:
# sqlite3 /var/lib/pve-cluster/config.db 'SELECT inode,parent,mtime,type,name FROM tree WHERE inode = 3203219'
3203219|11|1671282833|4|new-host-name
# sqlite3 /var/lib/pve-cluster/config.db 'SELECT inode,parent,mtime,type,name FROM tree WHERE inode = 3203220'
3203220|3203219|1671282833|4|qemu-server
I am still unsure what I am looking at. I did create a backup, so I think I'll just delete one and see what happens.
 
Code:
sqlite3 /var/lib/pve-cluster/config.db 'DELETE FROM tree WHERE inode = 3203220'

This did do something. At least it is starting now. Still had it show with the old and the new hostname in UI. But I guess I'll take it...
 
Thank you so much, this save me today.
If you still have a problem with a duplicate hostname in UI, I can help.
 
Dude, i just made this account just to say thank you. You saved my day. Thank you so much.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!