git ssb

0+

Dominic / flumeview-level



error when rebuilding indexes after updating the index version

%JmsEi5uanOVkqdBPvO4ap991hzmt3ogkg3vCr/CSvdI=.sha256
Opencel opened this issue on 6/13/2017, 5:46:20 PM

error when rebuilding indexes after updating the index version

+/home/cel/node_modules/leveldown/leveldown.js:84
    throw new Error('destroy() requires a location string argument')
    ^

Error: destroy() requires a location string argument
    at Function.LevelDOWN.destroy (/home/cel/node_modules/leveldown/leveldown.js:84:11)
    at Function.Level.(anonymous function) [as destroy] (/home/cel/node_modules/level-packager/level-packager.js:18:21)
    at /home/cel/src/flumeview-level/index.js:37:15
    at /home/cel/node_modules/level-packager/node_modules/levelup/lib/levelup.js:141:18
    at /home/cel/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:65:7

it looks like the destroy method takes a pathname argument instead of a db instance. i applied this patch:

diff --git a/index.js b/index.js
index 1210888..893313d 100644
--- a/index.js
+++ b/index.js
@@ -34,7 +34,7 @@ module.exports = function (version, map) {

     function destroy (cb) {
       close(function () {
-        Level.destroy(db, function () {
+        Level.destroy(db.location, function (err) {
           db = create(); cb()
         })
       })

however, then i get this error:

events.js:163
      throw er; // Unhandled 'error' event
      ^
OpenError: IO error: lock /home/cel/.ssb/flume/backlinks/LOCK: already held by process
    at /home/cel/node_modules/level-packager/node_modules/levelup/lib/levelup.js:119:34
    at /home/cel/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16

when starting sbot a second time though, it successfully rebuilds the index.

cel mentioned this issue in get DTS index working work around %b+…

Built with git-ssb-web