Skip to content

Boltdb breaks drive with (panic: invalid page type:) or (panic: above high water mark)

Aaron Nel edited this page Mar 9, 2017 · 8 revisions

@odeke says that boltdb is present to locally keep a copy of remote metadata information about each file so that it can detect conflicts as well as give it more information when a file changes.

There are two options, The first option is now the recommended, and fastest.

  1. removes the corrupt / broken boltdb file.

  2. restores the boltdb libraries and file into a working state.

Remove the corrupt boltdb file

Update to the latest version

$ go get -u -v github.com/odeke-em/drive/drive-gen && drive-gen

As per this issue 844 You can remove your boltdb database file. cd to your drive directory

$ cd some_drive_dir
$ rm .gd/drivedb

This will reset the state of your drive and any new push or pull, will affect lots of files. Be careful so as not to lose any local or remote changes.

$ drive push or $ drive pull After your next push or pull the .gd/drivedb file will be recreated.

Get it working with boltdb

For those who are pulling a fresh code base on a new system using

go get -u github.com/odeke-em/drive/cmd/drive

You may encounter error reported in the following issues.

  • #824 boltdb panics with above high water mark on drive pull
  • #828, #844 panic: invalid page type: X: X
  • #839 Pull fails with status 404

These can be solved by forcing the version of boltdb that is used. The latest updated versions of boltdb, and drive work without issues.

$ cd $GOPATH/src/github.com/boltdb/bolt && git reset --hard 852d3024fa8d89dcc9a715bab6f4dcd7d59577dd
$ drive-gen

Then doing a new fresh drive init to pull the google drive account that you are interested in.

$ cd ~/Documents
$ mkdir new_drive_dir $ cd new_drive_dir
$ drive init

Please use whichever paths make sense for your setup instead of "~/Documents" and "new_dirve_dir" Paste the URL into a web browser, copy initialisation token back into prompt.

A drive pull now will correctly initialize the path

$ drive pull