ZeroNetX / ZeroNet

ZeroNetX - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.dev
Other
212 stars 32 forks source link

Unhandled exception: DatabaseError: database disk image is malformed #130

Closed rex4539 closed 1 year ago

rex4539 commented 2 years ago

zeronet-enhanced branch

Unhandled exception: DatabaseError: database disk image is malformed in <gevent>/greenlet.py line 906 > util/helper.py line 234 > OptionalManager/ContentDbPlugin.py line 383 > 297 > Db.py line 150 > DbCursor.py line 107
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/Users/rex/ZeroNet/src/util/helper.py", line 234, in timerCaller
    func(*args, **kwargs)
  File "/Users/rex/ZeroNet/plugins/OptionalManager/ContentDbPlugin.py", line 383, in checkOptionalLimit
    for row in self.queryDeletableFiles():
  File "/Users/rex/ZeroNet/plugins/OptionalManager/ContentDbPlugin.py", line 297, in queryDeletableFiles
    res = self.execute("%s LIMIT %s, 50" % (query, limit_start))
  File "/Users/rex/ZeroNet/src/Db/Db.py", line 150, in execute
    return self.cur.execute(query, params)
  File "/Users/rex/ZeroNet/src/Db/DbCursor.py", line 107, in execute
    res = cursor.execute(query)
sqlite3.DatabaseError: database disk image is malformed
slrslr commented 2 years ago

I have seen these db malformed errors on original ZN too, zn dev. said:

"There is a --db_mode configuration argument that could prevent situations like this. Maybe we should consider to switch it to secure mode by default:"

and for the long time in my zeronet.conf is line: db_mode = security maybe @canewsin consider adding by default if not done already?

also on similar (not same) error dev. said:

" try to shut down zeronet, delete data/content.db and start again (it will take some time to re-index the content)"

"there is no way to fix malformed sqlite databases, so you have to delete data/chart.db and data/bootstrapper.db."