-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: invalid freelist page: 0, page type is unknown<00> #446
Comments
Thanks @gandarez for raising this issue and sorry for the inconvenience. Copied the call stack from wakatime/wakatime-cli#848 below. The error message indicates that the meta page 0 might be corrupted (but the checksum is somehow correct). Is is possible to provide the db file? ( I saw your message Do you have a detailed step to reproduce this issue?
|
Or execute commands below if you can't provide the db file,
|
Note that bbolt always loads the freelist in write mode, no matter what value is set for EDIT:
NO, we can't. Freelist management is the most crucial part of bbolt, and it's always needed in write mode, and definitely always necessary to load freelist in write mode. |
Sorry, I didn't tell the whole thing. What I meant was, if the user switches I'm proposing changing: Lines 253 to 255 in 3e560db
to
|
It isn't correct. |
Sorry for my misunderstanding. Currently, there is no way to skip loading freelist from the disk if meta page points to an existing freelist. Is that correct? |
Correct. bbolt will always read from disk (either from synced freelist or scan the whole db to restructure the freelist) to get the freelist in write mode. The most important thing for now is to reproduce the issue ourselves. It would be great if @gandarez can provide some clues. |
I can't promise anything as I said it runs in our user's machines, but I'll try to get a copy of it. |
With Current freelist loading logic does not take Lines 371 to 383 in e6563ee
By setting it to The loading behavior currently depends only on the existence of freelist on the db file. I have a proposal for adding if !db.hasSyncedFreelist() || db.NoFreeListSync {
// Reconstruct free list by scanning the DB.
db.freelist.readIDs(db.freepages())
} else {
// Read free list from freelist page.
db.freelist.read(db.page(db.meta().Freelist()))
} This may help to open the database by changing an option if the corruption is just in the freelist. |
@gandarez is there any update on this? thx |
I haven't heard anything from nobody, is this issue still on track? |
Based on all the info we have so far, most likely the db file is somehow corrupted. The suggestion I can think of for now is to regularly backup the db file [your application is a standalone client]. For distributed systems, single points of failure are usually tolerated. It would be great if you can provide the db file next time when you run into similar issue, so that I can double check. I can also try to fix the corrupted db file using the surgery commands. BTW, how many times have you run into such corruption issue in your application? |
Running as a standalone application it's hard to say how many users were affected but it seems only one is still running with this issue. I tried to contact but didn't get any reply from them. |
I've been using bbolt (already updated to latest version v1.3.7)since two years ago and started getting some weird panic when opening database file. I can't debug it neither get the db file to test it out since I distribute my application as a standalone client. Why it panics and do not return an error? Does that error happens because there's a corrupted db?
bbolt/freelist.go
Line 265 in da2f2a5
wakatime/wakatime-cli#848
The text was updated successfully, but these errors were encountered: