How to fix? SQLite corrupt, so Meteor CLI is broken


#1

Right now, running locally, every action from the Meteor CLI in OSX throws this exception:

> /Users/mallorym/.meteor/packages/meteor-tool/.1.1.3.1d614zp++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245 throw(ex);

> Error: SQLITE_CORRUPT: database disk image is malformed

>  at Object.Future.wait (/Users/mallorym/.meteor/packages/meteor-tool/.1.1.3.1d614zp++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:395:18)
>     at runOnce (/Users/mallorym/.meteor/packages/meteor-tool/.1.1.3.1d614zp++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/catalog-remote.js:237:21)

If I understand, this means that the package manager uses SQLite, but mine is broken somehow :frowning:

You can see where Meteor package manager / CLI uses SQLite here.

How to fix? Can I use the SQLite CLI to reset somehow?

Thanks so much to anyone who helps. :cat2:


#2

rm -rf ~/.meteor and there you go. :slight_smile: Running meteor again will just regenerate that folder again anyway, so you’re not really losing anything important.


#3

It appears I am having a similar problem. Can you help me with the current version of meteor?

.meteor\packages\meteor-tool\1.3.2_4\mt-os.windows.x86_32\isopackets\ddp\npm\node_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:116
throw error;
^
Error: SQLITE_CORRUPT: database disk image is malformed

c:\Projects\games\mrhobs>rm -rf ~/.meteor
’rm’ is not recognized as an internal or external command,
operable program or batch file.


#4

Have you tried uninstalling meteor from the control panel -> Programs and Features?


If you want to try deleting the Windows equivalent of ~/.meteor, you would delete like this from the command line:

del %USERPROFILE%\AppData\Local\.meteor

Alternatively you could use Windows Explorer to delete .meteor from your AppData\Local folder.

Note that you will need to re-install meteor afterwards.


#5

Please take a look over here: http://sqliteviewer.com/blog/database-disk-image-malformed/


#6

Using sqlite3 you can repair the DB.

cd ~/.meteor/package-metadata/v2.0.1
sqlite3 packages.data.db .dump > backup
mv packages.data.db packages.data.db.bustedX
sqlite3 packages.data.db < backup
rm backup

Essentially, even though the DB reports as corrupt. The SQLite tool can dump it and then recreate it.

Cheers!


#7

Not that this isn’t nice and all but I’m always wondering
a) how you guys are finding these threads from years back and
b) why you bother replying to them?


#8

Google search turns it up.
why bother replying? It is still an issue that still happens in some circumstances.
It just happened to me and I found this less intrusive solution that maybe others would benefit from.