Node.js: EBADF, invalid file descriptor

If I reload the application (from the browser with the restart button) many times, for example 50 reload/10 seconds , it gives me this error:

 events.js:45 throw arguments[1]; // Unhandled 'error' event ^ Error: EBADF, Bad file descriptor 

It seems to me that this is a bandwidth error or something like that, initially I had an error when I played with the HTML 5 Audio API, and if I downloaded the audio file 10-15 times in a row, then I have an error, but now I found that I get the error without the Audio API too simply by reloading the site many times, also Safari gives me the error much faster than Chrome (WTF?)

I am using Node.js 0.4.8 with express + jade , and I am also connected to a MySQL database with the db-mysql module.

I cannot find any articles on the Internet on this subject, which helps, so pleeease will tell me what might cause this error because it really is confusing :(

+7
source share
2 answers

Under "rebooting your application", do you want to refresh the home page of your application from a browser or actually stop and restart the node.js server process? I assume that the first one, and in this case, if you cannot reliably reproduce this, it will be quite difficult to debug, especially since you do not have a good stack trace to determine the exact source. But if you use the trigger express.js app.error ( docs here ), you will want to write the error path from the "Bad file descriptor" "error, which we hope will tell you if this is a temporary file that was deleted or what As for the actual reason, we can only speculate, since the Bad File Descriptor is a very general low-level error, which basically means that you are invoking an operation on a file descriptor that is no longer in the correct state to handle this operation (e.g. h ix closed the file, opening a file that was deleted, etc.).

+3
source

@CIRK, take a look at this: https://github.com/joyent/node/issues/1189

this is not a node problem, but a system configuration problem.

edit: or maybe this is due to this 1.4.3 connection error: https://github.com/senchalabs/connect/issues/297

if this is your case, just try updating it

0
source

All Articles