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.

Open Error: IO error Invalid argument

See original GitHub issue

Hi, this is my first time using and learning about LevelDB with Node.js, and my simple app, can’t run, this is my simple code:

var
  level = require('level'),
  express = require('express'),
  uuid = require('node-uuid'),
  db = level('./users.db', {valueEncoding: 'json'}),
  app = module.exports = express();

app.use(express.logger('dev'));
app.use(app.router);

app.get('/users', function(req, res) {
  db.get('users', function(err, users) {
    if (err) return res.json(404, err);
    return res.json(200, users);
  });
});

app.post('/user', function(req, res) {
  db.put('users', req.body.user, function(err) {
    if (err) return res.json(404, err);
    return res.json(200);
  });
});

app.listen(5000, function() {
  console.log('LevelDB API running on port 5000');
});

And when I run: node app It throws the error:

OpenError: IO error: ./users.db/MANIFEST-000001: Invalid argument

I am using latest stable: Node.js 0.10.23

Does anybody can help me? Thanks!

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:23 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
eugenewarecommented, Mar 30, 2016

Great news everyone (/cc @groundwater), the latest version of docker (you can register for at https://beta.docker.com/) which does NOT require virtualbox (uses xhyve under the hood - with the native hypervisor that comes with OS X) - doesn’t suffer from this mmap bug. You can happily create databases on your OS X host operating system, and volume map them to the xhyve docker host and it works beautifully! Woo!

You can read more about the new docker here and get the full docs here

It is a glorious day!

1reaction
eugenewarecommented, Jun 27, 2016

Hmm. Not sure what it could be. Most likely not an mmap() issue then which is the focus of this issue thread. I’d open up a new issue with some clear steps and code to replicate the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

xslt - xsltproc on windows: I/O error: invalid argument if ...
It seems that xsltproc is not aware of drive letters (" C:\path\to\output\output.html "). The spaces and backslashes are no problem. If I remove ......
Read more >
Error Codes (The GNU C Library)
“Invalid argument.” This is used to indicate various kinds of problems with passing the wrong argument to a library function. Macro: int EMFILE...
Read more >
Copying files from USB drive fails - I/O error or Invalid Argument
Based on the cp commands output, it looks like you listed the fdisk output of the disk you are recovering files to, rather...
Read more >
SERVER STARTUP HANGS WITH JAVA.IO.IOEXCEPTION
It appears to hang and eventually times out. The exception "java.io.IOException: Invalid argument at sun.nio.ch.DevPollArrayWrapper.poll0" is seen in FFDC. The ...
Read more >
Resolving "File open error (Invalid argument(22))"
This error occurs when there is a problem with the filename being opened. There are two known causes, the file location being invalid...
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