• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue filemng failed: filemng: Error occurred during /bin/mkdir command. when restarting Node.JS app

Luuk Wuijster

New Pleskian
Hi,

I have Plesk Onyx 17.5 installed and I have a Node app running on it.
But I am getting an "Incomplete response received from application" message, so I wanted to take a look at the passenger logs by setting the application to development mode. But I have to restart the app for that, atleast, I think so because I still get that message.
Only problem: When trying to restart I get the message:
filemng failed: filemng: Error occurred during /bin/mkdir command.

upload_2017-5-2_22-21-50.png

How do I solve this?

Thanks in advance,

Luuk
 
Still having this problem, spend an other hour googling trying to find something to fix it.
Can't find anything thats related to my problem.
Please help!
Would be greatly appreciated!
 
Hi,
Thanks for your reply.
But I fixed it already.
I just had to reinstall the Node.JS extension, restart my server, come to the conclusion it wasn't a smart idea to remove PHP5, reinstalled PHP5, restarted my server, run the `plesk repair web` command. And then it finaly worked! :D

Still having the "Incomplete response received from application" message.
Any idea how I can fix that?

The app works fine on localhost.
 
Hi Luuk Wuijster,

pls. investigate the root cause of an error with the help of log - files. In your case, you would certainly inspect the domain - specific apache/nginx - log for possible issues/errors/problems regarding your message "Incomplete response received from application".


You might be interested in the informations from this Plesk KB - article:


If a log - file doesn't show much, which may point you to a root cause, you are always able to change the log - level to get a more verbose output.
 
Hi,
Thanks for your reply.
I took a look at the logs and there was nothing usefull in it.
So I started to experiment a bit and I came to the conclusion node.js skipped bits of my code.

Code:
const compression = require('compression');
const express = require('express');
const mysql = require('mysql');
const fs = require('fs');
const NodeCache = require( "node-cache" );
const Cache = new NodeCache();

const port = process.env.PORT || 3000;
var app = express();

app.use(compression());
app.set('view cache', true);

app.use((req, res, next) => {
    var now = new Date().toString();
    var log = `${now}: ${req.method} ${req.url}`;

    console.log(log);
    fs.appendFile('server.log', log + '\n');
    next();
});

app.get('/', (req, res) => {

    Cache.get( "data", function( err, value ){
        if( !err ){
            if(value == undefined){

                var con = mysql.createConnection({
                    host: "localhost",
                    user: "******",
                    password: "******",
                    database: "bier"
                });

                con.connect(function(error){
                    if(error){
                        console.log('DB connectie error');
                        return;
                    }
                    console.log('DB connected');
                });

                con.query('SELECT * FROM bier', function (err, rows) {
                    if(err) throw err;

                    res.set('Access-Control-Allow-Origin', '*');
                    res.json(rows);

                    Cache.set( "data", rows, 10000 );

                    console.log("Nieuwe cache gemaakt");
                    var now = new Date().toString();
                    var log = `${now}: Nieuwe cache gemaakt`;
                    fs.appendFile('server.log', log + '\n');
                });

                con.end(function(error) {
                    console.log('DB disconnected');
                });

            }else{
                res.set('Access-Control-Allow-Origin', '*');
                res.json(value);
            }
        }
    });

    //TEST
    var value = {"test": "test"}
    res.set('Access-Control-Allow-Origin', '*');
    res.json(value);
    //ENDTEST

});


app.listen(port, () => {

    console.log(`server started. on ${port}`);

});


For some reason it skips all the functions except app.get
If you look at the test block I made a the bottom you can see it returns something.
Well, if I have that, it works and returns that object.
But If I don't have it I get the same error again.
And that's kinda logical since it skips all the other functions.
So it can't make a res.

I also noticed it does not write anything to the log file.
So i think it skips that one as well.

Any idea how to fix this?

It worked fine on my other server and localhost.

Looking forward to your reply,

Luuk

EDIT:

I thought it might be a code error, but it just works fine.
I started the app manualy by running `node server.js`

And it worked just fine, so it must have something to do with Plesk.
 
Last edited:
Hello from 2019
in case someone new comes to this topic, I had the same issue, thanks for @Luuk Wuijster for sharing his code, I got the idea.
We both are using "compression", and this is the problem, just remove it from your app and all will work as expected.
I think there is already a compression going on in Apache/Nginx layer, so what is happening is compressing twice
 
Back
Top