Community discussions

MikroTik App
 
emmdeeess
just joined
Topic Author
Posts: 8
Joined: Thu Oct 20, 2011 4:29 pm

Dude settings reverting

Wed Oct 30, 2013 4:07 pm

We have been running the Dude for quite a while now, and I've recently noticed that when I add new devices or add services to existing devices, after a couple of hours, the changes revert back. Has anyone else seen this happen, or can anyone suggest a solution?

Dude 4 beta 3 / 937 devices monitored
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Dude settings reverting

Wed Oct 30, 2013 7:19 pm

Assuming you are on windows... Make sure your database is not over 2gb, vacuum the database. Reduce the raw keep time to default, 2days.
Search the forum for vacuum instructions. The database is single user so the dude can not be running while you repair the database.

Good Luck,
Lebowski
 
emmdeeess
just joined
Topic Author
Posts: 8
Joined: Thu Oct 20, 2011 4:29 pm

Re: Dude settings reverting

Wed Oct 30, 2013 7:55 pm

Trying to vacuum DB gives me this error - The solution proposed in the vacuum thread gives me "Error: no such column: id" for each command.

Error: PRIMARY KEY must be unique

DB is only 123M, so the size limit is not the issue.

edit - I also tried dumping and recreating using the procedure from here: http://community.spiceworks.com/how_to/ ... e-database

Got hundreds of lines of Error: near line XXXXXXX: PRIMARY KEY must be unique, and when I started the dude back up with the new db, it was a completely blank DB.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Dude settings reverting

Wed Oct 30, 2013 10:16 pm

yeah that sucks :(
 
emmdeeess
just joined
Topic Author
Posts: 8
Joined: Thu Oct 20, 2011 4:29 pm

Re: Dude settings reverting

Thu Oct 31, 2013 5:42 pm

Yep, it sure did.

I fixed it, I think. Process here for posterity:

1. Stop Dude service
2. Dump DB to text with SQLite. (echo .dump | sqlite3.exe dude.db > dude.sql)
3. Rename dude.db, delete any dude.db-journal and dude.viw files.
4. Start Dude service, this should create a new, blank dude.db
5. Stop Dude service
6. Delete everything from dude.sql except for the lines that say INSERT INTO "objs" (including the lines that create the tables and indexes and stuff, just the INSERT INTO "objs" lines should be left)
7. Open dude.db with SQLite and delete everything from the objs table (DELETE FROM objs)
8. Read old objs values into new DB (.read dude.sql)
9. Start Dude service

I lost all my historical data, but oh well. Shit can happen. At least my changes stick now.

You could probably also just dump the objs table in step 2 and save yourself a hell of a lot of manual editing.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Dude settings reverting

Thu Oct 31, 2013 7:32 pm

That is great work there! You are the first person who had a corrupt database that has fixed it (that I know of). Congratulations that is impressive.

Lebowski
 
hwmonkey
Member Candidate
Member Candidate
Posts: 115
Joined: Wed Feb 08, 2012 9:50 pm

Re: Dude settings reverting

Thu Feb 20, 2014 12:08 am

This should be a sticky!!!!

Who is online

Users browsing this forum: No registered users and 31 guests