Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error starting nodejs: openssl config failed

Got the following error starting Express node:

openssl config failed: error:02001003:system library:fopen:No such process

The node start anyway. I am not attempting to use SSL.

Here the starting code:

...
app = Express;
app.set('port', process.env.PORT || config.port);
try {

    var server = app.listen(app.get('port'), function () {
        console.log('Express server listening on port ' + server.address().address + ':' + server.address().port);
    });
} catch (e) {
    log.fatal(e);
}

Only happens on deploy server. Running in developer machine starts ok.

like image 406
MiguelSlv Avatar asked Sep 05 '18 14:09

MiguelSlv


2 Answers

Removing global environment variable OPENSSL_CONF (leftover from previous troubleshooting) solved my problem.

Running on Windows you might try:

Set environment in local command window and verify problem:

set OPENSSL_CONF=c:\dummy  
npm -v

=> you now probably see this ssl error message

Remove environment and verify problem is gone:

set OPENSSL_CONF=
npm -v

=> no ssl error message

Source: https://github.com/npm/npm/issues/17261

like image 60
Ahsan Ahmed Avatar answered Sep 19 '22 14:09

Ahsan Ahmed


The problem was that Express looks for the environment variable OPENSSL_CONF to lookup to SSL configuration file.

The variable OPENSSL_CONF was pointing to a non existence location on the drive. I removed from the system and the message disappear.

Note: must use a new console to launch the node so environment variable OPENSSL_CONF is not present. Or simple deleted on the current console.

Additional information at github

like image 29
MiguelSlv Avatar answered Sep 20 '22 14:09

MiguelSlv