Used_serial: schema check failed: database disk image is malformed [SOLVED]

Oh. I see. You have tried this command in the sqlite command prompt.
type ; and hit Enter. It will throw the error.
Then type .exit and hit Enter.

Then execute the command with cat in the Powershell prompt.

oh, yes, just like You said.
And now he dont like “grep” term and “sls” term

The grep only for Linux systems. The sls alias for the Select-String cmdlet was introduced in PowerShell 3.0
Looks like a very old Powershell. Windows 7 I suppose?
Please, upgrade it: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-7#upgrading-existing-windows-powershell

Or try to use a Select-String instead of sls

lo, its win 10 64bit, w8 im tryin Select-String.
man… "A parameter cannot be found that matches parameter name “NoMatch”
im about to try that poweshell3 for a moment

Just curious - If it’s a 64 bit, why you use a x86 Powershell?
I have a mistake. It’s -NotMatch

i got

CLRVersion 2.0.50727.5420
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatible {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1

its 64bit i opened “Windows Powershell (x86)” as administator

I corrected the typo in the command

Get-Content dump_all.sql | Select-String -NotMatch TRANSACTION | Select-String -NotMatch ROLLBACK | Select-String -NotMatch COMMIT >dump_all_notrans.sql

“oh u little”

its doing something ! its processing something!

Edit: it did, it dumped 34,849KB dump_all_notrans.sql from a 17,228KB dump_all.sql!

lol and Your right, its windows 7 sp1

now points 11 to 15, can You review please?

    1. Remove the corrupted database (make sure that you have a backup!)

rm /storage/bandwidth.db

    1. Now we will load the unloaded data into the new database

sqlite3 /storage/bandwidth.db “.read /storage/dump_all_notrans.sql”
(this here i try .\sqlite3 bandwidth.db “.read dumpl_all_notrans.sql” but got error:
“near line 1: near “??”: syntax error”
(Shouldnt i use something like from point 9? some .mode insert and .dump inside bandwidth.db"?)

    1. Check that the new bandwidth.db has the size larger than 0

ls -l /storage/bandwidth.db

    1. Exit from the container (skip this step, if you use a direct installed sqlite3)

exit

Seems your Windows codepage is not the ANSI… It converted the UTF8 to something like UTF16…
That’s a problem.

Get-Content dump_all_notrans.sql | Set-Content -Encoding utf8 dump_all_notrans2.sql

Please, try to import the dump_all_notrans2.sql

I did dump_all_notrans2.sql its now 17,425KB (not 34,849KB, as previously)
and i did:
.\sqlite3 bandwidth.db “.read dump_all_notrans2.sql”
And i got like 201740 errors like this:

Is your bandwidth.db empty?

Get-ChildItem bandwidth.db

i guess no, it got like: 16KB
after Get Child its sas some like Lenght 16384, file name, and thats it, and lastWrite time, 2:40 (now). And i started with bandwidth.db file 0 KB, (BUT the orginal bandwitd.db file i backeuped is 8,572KB)

Hm. Please, delete bandwidth.db and dump_all_notrans2.sql and dump_all_notrans.sql
Try the cut not needed lines like this:

Get-Content dump_all.sql | Select-String -NotMatch TRANSACTION | Select-String -NotMatch ROLLBACK | Select-String -NotMatch COMMIT | Set-Content -Encoding utf8 dump_all_notrans.sql

Then try to import again.
If no luck, but bandwidth.db would not be empty, then try to run your node with that database. In this case the bandwidth usage on the dashboard will be wrong.

okay i did.
resulted a dump_all_notrans.sql file with the same 17,228KB (as dump_all.sql)
next, i did
.\sqlite3 bandwidth.db “.read dump_all_notrans.sql”
and got Error: near line 1: near “?PRAGMA”: syntax error, but it processed and made me a 19,012KB bandwidth.db file (and the oryginal was 8,572KB)

Get-Childitem shows that it has got Lenght: 19468288

EDIT: F***, why we do bandwidth.db its used_serial.db omg and its oruginal sieze was 20,856KB !

got discracted by the instruction example wich operated on “bandwidth.db” example!
dump_all.sql was done in CMD from used_serial.db !

I checked in CMD on that new file, i renamed it to used_serial.db:
sqlite3 used_serial.db “PRAGMA integrity_check;”
now its says ok
(before it was malformed)
So Do You think its safe to try to run a node on this now? @Alexey

The node is online on this file, Thank You, guess all worked out.

Please, do not swear.
If you have a backup of the database, as recommended, then you can restore the original file, even if you selected a wrong one.
I glad that you fixed that.
And thank you for troubleshooting the specific Windows case, I updated the documentation.

1 Like