Error: database disk image is malformed

Mecanik

Member
Mar 2, 2017
77
2
8
28
Following up my previous thread ( which has no solution at the moment ), I started searching what actually failed in my attempt to create clustering with running virtual machines.

Commands run adn output:

Code:
root@xxxxx:~# sqlite3 /var/lib/pve-cluster/config.db
SQLite version 3.8.7.1 2014-10-29 13:59:56
Enter ".help" for usage hints.
sqlite> .databases
seq  name             file
---  ---------------  ----------------------------------------------------------
0    main             /var/lib/pve-cluster/config.db
sqlite> .tables
tree
sqlite> .headers on
sqlite> select * from tree;
And the error is: "Error: database disk image is malformed"

So I run:
Code:
sqlite> PRAGMA integrity_check;
And the result is:

Code:
integrity_check
*** in database main ***
On tree page 25 cell 1: Rowid 8160904 out of order (previous was 8160915)
On tree page 25 cell 1: 2nd reference to page 85
Page 21 is never used
Is someone which has experienced this issue, can provide me a solution before I try fixing it myself, I would really appreciate it.
 

Mecanik

Member
Mar 2, 2017
77
2
8
28
I fixed this issue with the following:

sqlite> .mode insert
sqlite> .output config.sql
sqlite> .dump
sqlite> .exit

root@xxxxx:~# mv /var/lib/pve-cluster/config.db config.db.original
root@xxxxx:~# sqlite3 /var/lib/pve-cluster/config.db < config.sql

root@xxxxx:~# sqlite3 /var/lib/pve-cluster/config.db
sqlite> analyze;
sqlite> PRAGMA integrity_check;
ok

Enjoy if you encounter this issue...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!