reshufflehq/reshuffle

leveldb-server: Cannot assign to read only property 'message' of object 'ReadError: Database is not open'

Closed this issue · 2 comments

vogre commented

err.message = `[${debugId}] ${err.message}`;

Reproducible when running npm start in the same directory from two different terminals - error should highlight that database is already open.

Easy enough to reproduce and likely fix, but this is actually the second error. The first is about not being able to connect to the DB (hence "Database is not open"):

  Unhandled rejection in dist/test/db.spec.js

  /Users/ariels/Google Drive/Work/Dev/reshuffle/common/temp/node_modules/.registry.npmjs.org/levelup/4.2.0/node_modules/levelup/lib/levelup.js:96

  OpenError: IO error: lock /var/folders/k7/8lqpw3ws3ybd5_rm_1jvzlj00000gn/T/test-state-vSftNV/root.db/LOCK: already held by process

  /Users/ariels/Google Drive/Work/Dev/reshuffle/common/temp/node_modules/.registry.npmjs.org/levelup/4.2.0/node_modules/levelup/lib/levelup.js:96:23
  /Users/ariels/Google Drive/Work/Dev/reshuffle/common/temp/node_modules/.registry.npmjs.org/abstract-leveldown/6.1.1/node_modules/abstract-leveldown/abstract-leveldown.js:30:14
  /Users/ariels/Google Drive/Work/Dev/reshuffle/common/temp/node_modules/.registry.npmjs.org/deferred-leveldown/5.2.1/node_modules/deferred-leveldown/deferred-leveldown.js:22:21
  /Users/ariels/Google Drive/Work/Dev/reshuffle/common/temp/node_modules/.registry.npmjs.org/abstract-leveldown/6.1.1/node_modules/abstract-leveldown/abstract-leveldown.js:30:14

That one will be harder to fix. Luckily we'll still get this one, and be able to report a nice message slightly later in the game.

Well, above error occurs inside the *-leveldown packages and I cannot see how to catch it.

PR will improve the quoted message in the issue title.