phusion / passenger-docker

Docker base images for Ruby, Python, Node.js and Meteor web apps
MIT License
2.78k stars 408 forks source link

Get a circular dependency warning when using version phusion/passenger-nodejs:1.0.12 #307

Closed davisarchibald closed 2 years ago

davisarchibald commented 3 years ago

Coming across some unnecessary noise on passenger start after we upgraded our phusion docker instance so that we could run our Node application on the LTS version (14). From the logs when running it with the --trace-warnings argument, it looks to be an issue within passenger and its use of the winston logging lib (might be directly, might not be). (See below for an example stack trace) As a point of thoroughness, and clarity, I should point out that our application does not get this error if you just run node server.js (running this command with version 14.15.1 locally) for example. We only come across this error when using passenger to run our application. Not a vital bug, as the application runs just fine despite the warnings, but it does unnecessarily clog our logs with information and we just end up ignoring as we can't fix it.

1 -What does your software stack look like?

2- What operating system and processor architecture are you using?

3- What did you do? 😱

4- What did you expect to see?

5- What did you see instead?

Kuzzy commented 3 years ago

Hello, I have the same problem on startup!

OS: Ubuntu 16.04.5 LTS (no Docker or Kubernetes, just simple VM on DO ) Passenger: 6.0.10 NodeJs: 14.17.4

Log output:

(node:28015) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:674:11)
    at Object.get (internal/modules/cjs/loader.js:688:5)
    at Object.exports.setLevels (/usr/share/passenger/node/vendor-copy/winston/lib/winston/common.js:35:14)
    at Object.<anonymous> (/usr/share/passenger/node/vendor-copy/winston/lib/winston.js:84:8)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at Module.require (/usr/share/passenger/helper-scripts/node-loader.js:80:25)

If look into usr/share/passenger/node/vendor-copy/winston/package.json it's possible to see that it's 1.1.2 version of winston used, which is incompatible with nodejs v14+. Winston should be v3+ to work normally with nodejs v14+. I'm not sure how Passenger use winston and if it possible to just update this winston version to newer?

CamJN commented 2 years ago

This should be fixed in version 2.2.1, which has passenger 6.0.13 which updates winston and patches against this issue.