PouchDB Failing within Atom #4514

Closed
ShMcK opened this Issue Oct 27, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@ShMcK

ShMcK commented Oct 27, 2015

I'm getting the following error when trying to startup PouchDB within an Atom package.

This is likely an Atom issue, however, I thought I should check here first for any obvious errors. Atom does not allow write permissions within a package. However, there is talk of PouchDB working within Atom on the discussion boards.

err {type: "OpenError", name: "OpenError", cause: Error: IO error: database/LOCK: No such file or directory at Error (native), message: "IO error: database/LOCK: No such file or directory"}

Simple code, taken from the demo:

const PouchDB = require('pouchdb');

let db = new PouchDB('database');

function dbInit() {
  console.log('seeding db...');
  console.log(db);

  let todo = {
    _id: 'mydoc',
    title: 'test'
  };
  db.put(todo).then(function(response) {
    // handle response
  }).catch(function(err) {
    console.log(err);
  });

  db.get('mydoc').then(function(doc) {
    console.log(doc);
  }).then(function(response) {
    // handle response
  }).catch(function(err) {
    console.log(err);
  });
}

dbInit();
@nickcolley

This comment has been minimized.

Show comment
Hide comment
@nickcolley

nickcolley Oct 27, 2015

Member

Hey @ShMcK !

Did you check out https://github.com/nolanlawson/pouchdb-electron ?

I've also had LOCK issues when trying to open the database when a instance of my app is already running, could you check that your database isn't already being used by something else?

Member

nickcolley commented Oct 27, 2015

Hey @ShMcK !

Did you check out https://github.com/nolanlawson/pouchdb-electron ?

I've also had LOCK issues when trying to open the database when a instance of my app is already running, could you check that your database isn't already being used by something else?

@ShMcK

This comment has been minimized.

Show comment
Hide comment
@ShMcK

ShMcK Oct 27, 2015

Yes, I've applied the postInstall script from pouchdb-electron, though I'm not sure if it's necessary.

Under resources in Chrome Dev Tools there are no IndexedDB, Web SQL or Session Storage instances. Is there another way to check if any databases are already running?

ShMcK commented Oct 27, 2015

Yes, I've applied the postInstall script from pouchdb-electron, though I'm not sure if it's necessary.

Under resources in Chrome Dev Tools there are no IndexedDB, Web SQL or Session Storage instances. Is there another way to check if any databases are already running?

@ShMcK

This comment has been minimized.

Show comment
Hide comment
@ShMcK

ShMcK Oct 27, 2015

After restarting Atom (rather than reloading it), it seems to be working now.

Thank you!

ShMcK commented Oct 27, 2015

After restarting Atom (rather than reloading it), it seems to be working now.

Thank you!

@ShMcK ShMcK closed this Oct 27, 2015

@ShMcK ShMcK reopened this Oct 27, 2015

@ShMcK

This comment has been minimized.

Show comment
Hide comment
@ShMcK

ShMcK Oct 27, 2015

Strangely, it worked once, and after restarting the same error came back.

The error originates from node_modules/pouchdb/node_modules/levelup/lib/levelup.js:119 Uncaught (in promise).

ShMcK commented Oct 27, 2015

Strangely, it worked once, and after restarting the same error came back.

The error originates from node_modules/pouchdb/node_modules/levelup/lib/levelup.js:119 Uncaught (in promise).

@ShMcK

This comment has been minimized.

Show comment
Hide comment
@ShMcK

ShMcK Oct 29, 2015

Fixed. It seems the issue was with the database path not compiling correctly from Typescript to JS.

ShMcK commented Oct 29, 2015

Fixed. It seems the issue was with the database path not compiling correctly from Typescript to JS.

@ShMcK ShMcK closed this Oct 29, 2015

@BrunoBernardino BrunoBernardino referenced this issue in nolanlawson/pouchdb-electron May 22, 2017

Closed

IO Error with electron-packager after electron-rebuild #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment