-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: EBADF: bad file descriptor, write #250
Comments
Are you passing in the stream option to morgan in your app? It seems like the error is coming from whatever the stream that morgan is attempting to write to. |
I am sorry! I am not sure what would be the stream option. I use morgan with default configuration you get when you setup express. Currently, I have below in app.js
Here, app is |
I also tried using forever instead of PM2 to find out if there is any difference.
|
Can you provide full steps to reproduce the issue? Please include a complete app (could just use the example from the readme if it reproduces the issue) and the instructions for how to run it under pm2 and what to do to cause the error. I just tried a simple morgan app under pm2 but didn't have any error, so just need complete reproduction instructions so I can help look into the issue, thank you! |
Little bit on folder structure. Website Here is bin/www file
Here is app.js file
I use git. I pull new updates from the git repository to the production server. I start the application using EDIT: Hey! I appreciate your help with this. I have been googling and trying to find what is wrong. Thank you for your time. |
Hey, did you find any solution? I have this problem and can't find a way to fix it. |
Ei, saostad! |
I have an express server application that handles a few NodeJS API and hosts the Angular 10 app. In production, I use process manager PM2. When the user visits https://domainname.com/webpage, the app crashes with the below error. PM2 restarts the application. To continue, the user has to refresh the webpage.
If I don't use process manager PM2 and run the application like
node bin\www
, everything works with no problem. It does randomly crashes with no error on the console. I am using an error handler called strong-error-handler. Application started usingnode bin\www
crashes randomly but less frequently. Application started using PM2 crashes as soon as the user access the webpage. The PM2 logs mention about the morgan. I don't know what the error message means but I will really appreciate any assistance in the correct direction. Thank you!The text was updated successfully, but these errors were encountered: