Dude issue with Malformed database

Dude issue after router upgrade with Dude on-board to V 6.42.3 my dude is connecting for about a minute than i receive error:
“server status: db failure: database disk image is malformed: stopped”
First of all Dude server is installed on x86 virtual machine.
While there is Quick temporary fix to login using winbox and go to new terminal to put commands.

/dude set enabled=no
/dude set enabled=yes

That will bring Dude to live for another minute in case you need quick access but the fix is only temporary.
Permanent fix involve downloading “sqllite3” and using text editor

Recommended Downloads.

sqlite3 >>> Download A bundle of command-line tools from Precompiled Binaries for Wondows section
TxtPad >>> My favorite TXT Editor – You may use notepad++

FIX PROCEDURE: ( historical data will be gone after fixing Dude issue)

  • On C drive create folder “sqlite3” and unpack files there from sqlite3 download link listed above.
  • Move 3 unpacked files from thier folder to “c:\sqlite3\” folder.
  • Login to dude server with Winbox and disable dude by terminal command /dude set enabled=no
  • Go to files , right click on dude.db file and select download. destination should be your c:\sqlite3 folder
  • Open command prompt as administrator and navigate to your folder by using “cd c:\sqlite3” command
  •  run commands:
    sqlite3.exe dude.db
    pragma integrity_check;
    At this stage you probably will be able to see errors like Error: “database disk image is malformed”
    .output dude.sql
    check your folder sqlite3 you should see there dude.sql file much bigger than database file. at this stage we can exit sqllite3
  • Raname “dude.db” to “dude.db.old” in “sqlight3” folder to make sure you have copy.
  • login back to Dude server with Winbox software and delete “dude.db” file from “dude” folder.
  • In terminal use commands to recreate empty database
    /dude set enabled=yes
    /dude set enabled=no
    Download new dude.db file to sqlite3 folder, then delete it from router hence we will need space for new database file later.
  • Open dude.sql in your favorite editor and delete all lines except the once that starts with:
    INSERT INTO objs
    Save file as objs.sql
  • Go back to command prompt window same as at start and use commands below.
    sqlite3.exe dude.db
    pragma integrity_check;
    This time there should be no error because we use clean database.
    delete from objs;
    .read objs.sql

Final Steps which as a result will bring your Dude server back to live

  • Upload “dude.db” file to your router by going to “files” option in Winbox and pressing “upload…” button.
    Move file to dude subfolder otherwise it will not work. ( I sort files by type and move file over yellow dude folder)
  • In terminal type command
    /dude set enabled=no

Your Dude software should work now as expected. I do not see historical outages but Map backgrounds are still working

Dude issue with database

For more MikroTik scripts visit https://www.abit.ie/mikrotik-useful-scripts-and-commands/