question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error while loading database file

See original GitHub issue

i have a database file which i load using your sample code:

var Datastore = require('nedb')
  , db = new Datastore({ filename: 'p.nedb' });
db.loadDatabase(function (err) {
  // Callback is optional
  // Now commands will be executed
    console.log("finished", err);
});

then i get this error:

⇒  node nedbtest.js
finished Error: "toString()" failed
    at Buffer.toString (buffer.js:528:11)
    at tryToString (fs.js:445:15)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436:12)

any ideas? i could send you the file if it helps (it is 35mb zipped, 639mb unzipped, but i previously had the error with smaller files as well). the error is not catchable…

thanks for looking into this

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesMGreenecommented, Aug 16, 2017

This would probably be relieved with PR #463.

0reactions
Danielv123commented, May 10, 2017

@KeitIG I call update at line 60 in this file. I can confirm that the items does update and are registered with the same ID in the database file, with older versions towards the top of the file and the newer copy on the bottom.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"An error occurred while opening the database file. The ...
"An error occurred while opening the database file. The database may be corrupted or you may be out of hard disk space.
Read more >
How To Fix The "Error Establishing a Database Connection" in ...
The first thing to do is check to ensure your database login credentials are correct. This is by far the most common reason...
Read more >
SQL Syntax Error when Loading Database File (Possible ...
1 Answer 1 · Navigate to your MySQL config file. This SO question is an excellent reference for finding it. · Find the...
Read more >
Troubleshooting database import errors
Most SQL files contain a CREATE DATABASE and a USE statement, which are created when you export the contents of an existing database....
Read more >
Error while loading database | SAP Community
Error while loading database · 1.Generated the ddl statements in the source system. · 2.dropped the target database · 3.dropped the devices in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found