Skip to content
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

[node v14.x+] Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency #1077

Open
SwapnilSoni1999 opened this issue May 5, 2020 · 69 comments

Comments

@SwapnilSoni1999
Copy link

The new node version doesn't let process to start. whenever

$ forever start app.js

is executed it shows the following warning

warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: bot.js
(node:14545) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14545) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

and after this if I check with forever list it shows no process is running.

(node:14574) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14574) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
info:    No forever processes running
@kibertoad
Copy link
Contributor

@SwapnilSoni1999 I'll take a look, thanks for the report.

@roblav96
Copy link

roblav96 commented May 6, 2020

@kibertoad

On the following platforms:

Ubuntu 20.04 LTS

Package: nodejs
Version: 14.1.0-deb-1nodesource1

'padLevels' warnings
❌ script runs

Mac OS X 10.13.6

Package: node
Version: stable 14.1.0 (bottled)

'padLevels' warnings
✅ script runs

@CanadaHonk
Copy link

Me too, script doesn't run and I get the warnings - Node v14.2.0 (Arch Linux)

@SwapnilSoni1999
Copy link
Author

Me too, script doesn't run and I get the warnings - Node v14.2.0 (Arch Linux)

same here checked on ubuntu 20.04 and archlinux too

@roblav96
Copy link

roblav96 commented May 9, 2020

Please refer to #1075 for more info.

@SwapnilSoni1999
Copy link
Author

Please refer to #1075 for more info.

please explain a bit how this issue is related to the issue you mentioned.
Thanks

@naeem518
Copy link

naeem518 commented May 22, 2020

Same problem with Nodejs Ver 10 and forever 2.0 wont start on windows 10 server 2016... changed roblav96 suggestion #1075 in monitor to string for the file system for the pid and last line erase extra New Line... with same error but different node addresses every time complaining about padLevels... the process does not start ... please help

@kibertoad
Copy link
Contributor

Unfortunately this cannot be easily fixed on forever side - reason for the problem is this - winstonjs/winston#1797

Best solution would be to drop dependency on Winston altogether and replace it with something like pino, but unfortunately that would take way more time than I currently have.

PRs welcome. In the meantime, I would recommend to use alternatives to forever, such as pm2 or nodemon on Node 14.

@kibertoad
Copy link
Contributor

@SwapnilSoni1999 I don't think it should prevent application from starting, it's just a warning. As @naeem518 has mentioned, there was another problem, that was fixed in #1075, that might have prevented forever from working in certain cases. You can try forever 3.0.0 and see if it works any better for you.

@SwapnilSoni1999
Copy link
Author

@kibertoad sure sir just give some time and I'll check

@sapics
Copy link
Contributor

sapics commented May 25, 2020

@kibertoad Thank you for releasing new version!
I confirmed that new version works without errors on linux with latest nodejs version.

@akircher
Copy link

akircher commented May 27, 2020

Confirming with @sapics said.

I am on Ubuntu@16.04, Node@14.2.0. After upgrading from Forever 2.X to Forever 3.0.0, forever start still shows me the error

(node:9923) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9923) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

But at least the forever process starts and continues to run unlike before!

@sapics
Copy link
Contributor

sapics commented May 28, 2020

Hi @akircher !
It is not error, but warning. Thus, your program would work as you noticed.
The warning come from the other program (winston) which used by forever.

@robertmylne
Copy link

Still having this problem over a month from this being logged.

@SwapnilSoni1999
Copy link
Author

Still having this problem over a month from this being logged.

which os?

@DABH
Copy link
Contributor

DABH commented Jun 22, 2020

You can update your dependencies to winston@2.4.5 which should resolve this issue.

@Ziv-Barber
Copy link

Any news when it'll be a fix? adding winston@2.4.5 also not working.
Same problem: forever start not starting anything.

@Anoesj
Copy link

Anoesj commented Oct 1, 2020

winston@3.x has been released quite some time ago. Would upgrading to v3 fix this issue?

https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md

@KemikalGeneral
Copy link

KemikalGeneral commented Oct 6, 2020

Is there any solution to this please?

I'm running:

  • Ubuntu Server 20.04
  • NPM v6.14.8
  • Node v14.13.0
  • Forever v3.0.2

...and I'm getting the following error:

info: Forever processing file: index.js
(node:5208) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

...and, nothing runs :(

@thewebadmin
Copy link

thewebadmin commented Oct 12, 2020

I am the exact same as @KemikalGeneral except node v14.13.1. Running on a Linux server (standard Amazon EC2 Linux image).
Getting the exact same padLevels error. It pops up even when just doing forever --version.

@arttu76
Copy link

arttu76 commented Oct 14, 2020

Using official docker image for node 14.13.1 (-stretch) and Forever 3.0.2 and I get:

$ forever --version
v3.0.2
(node:5965) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)

@DasdWaller
Copy link

DasdWaller commented Nov 11, 2020

  • Forever: v3.0.2
  • Node: v14.15.0 [I use node version manager (nvm) for windows]
  • OS: Windows 10 (10.0.19042)
  • Dicker: No

project_name@0.0.0 watch C:\Projects\project_name
npm run watch:forever

project_name@0.0.0 watch:forever C:\Projects\project_name
forever start bin/www --watch

warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: bin/www
(node:6632) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:6632) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

Steps to reproduce

npx express-generator --view twig
set watch on scripts with "forever start bin/www --watch" value
run on terminal "npm run watch"

@kibertoad
Copy link
Contributor

If someone would contribute a PR to update Winston version used in forever, that might help (if they fixed the issue there)

@GauravMirchandani
Copy link

I had the same issue after updating my Nodejs to version 14, but after checking the warnings I realised the problem was caused because of using an old version of npm package for Sqreen (Sqreen protects applications against common security threats). As soon as I updated my Sqreen package, my issue was solved.

Use trace warning command to get detailed information of the warnings.

@sdserage
Copy link

sdserage commented Nov 22, 2020

Also getting the same errors as above

  • Node: v15.2.1
  • Forever: v3.0.4
  • OS: Ubuntu 16.04.4 LTS

@DiRover
Copy link

DiRover commented Nov 23, 2020

And I have the same error, Node: v15.2.1, Forever: v3.0.4, OS: Windows 10.

@asadkhalili
Copy link

And I have the same error, Node: v15.2.1, Forever: v3.0.4, OS: Centos 7

@timohausmann
Copy link

timohausmann commented Dec 5, 2020

As a workaround, I installed NVM and dialed back to node v12.20.0

$ nvm install 12.20.0

@SwapnilSoni1999
Copy link
Author

As a workaround, I installed NVM and dialed back to node v12.20.0

$ nvm install 12.20.0

and we dont want that

@crimson-med
Copy link

@elias89 Same I moved to PM2

@akhila9996
Copy link

akhila9996 commented Sep 1, 2021

I'm facing the same issue.
I'm using Nodejs v14.17.3, Forever v4.0.1 and Winston v3.3.3.
I'm able to start the process, but see the above mentioned warnings.
Can anyone help me silencing those warnings.

@Tzahi12345
Copy link

@akhila9996

You can set the env var NODE_NO_WARNINGS=1 and it goes away, at least it did for me (I'm using the same node & winston version as you)

@ciscospirit
Copy link

ciscospirit commented Sep 28, 2021

after so long, is there any solution for that?
i am just using hepipe.js with forever.

if i do forever list i see the forever process up and running, but i still can see the warning there.
is reverting to Node.JS 12 the only way to solve this?

OS: Debian Bullseye
_
npm -v
6.14.15
node -v
v14.17.6
forever --version
v4.0.1
(node:2334156) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)

forever list
(node:2341766) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:2341766) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
info: Forever processes running
data: uid command script forever pid id logfile uptime
data: [0] QOte /usr/bin/node hepipe.js 2265184 2265468 /var/log/forever/QOte.log 0:0:9:6.956000000000017

_

@rushglen
Copy link

rushglen commented Nov 3, 2021

I've given up with forever, I have to update Node and this bug is an insurmountable problem. There are alternatives out there.

@SwapnilSoni1999
Copy link
Author

I've given up with forever, I have to update Node and this bug is an insurmountable problem. There are alternatives out there.

use pm2

@divyaboominathan
Copy link

hai guys I'm facing the same issues
(node:10600) Warning: Accessing non-existent property 'padLevels' of module exports inside the circular dependency
once I ran the command - node --trace-warnings ...
I'm getting the below error.
internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module 'D:\GitHub\kidscare...'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

@polkila
Copy link

polkila commented Nov 5, 2021

n 13
will fix this problem

@rushglen
Copy link

rushglen commented Nov 5, 2021

@polkila downgrading to 13 (for me) is not an option, I need at least v15 and latest version is 17

@polkila
Copy link

polkila commented Nov 5, 2021

@rushglen Yep! Install 2 versions in parallel:
n 17 , then n 13;
then type n list to find what version exactly do you use (for example, you will see 17.0.1 in the list).
Then n bin 17.0.1 to print path to binary file.
And finally, use this path with forever: forever start -c '/usr/local/n/versions/node/17.0.1/bin/node' app.js for running app.js inside v17

@SwapnilSoni1999
Copy link
Author

hai guys I'm facing the same issues (node:10600) Warning: Accessing non-existent property 'padLevels' of module exports inside the circular dependency once I ran the command - node --trace-warnings ... I'm getting the below error. internal/modules/cjs/loader.js:905 throw err; ^

Error: Cannot find module 'D:\GitHub\kidscare...' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

You sure its issue from forever ?

@JacquesLoubser
Copy link

Having the same issue Ubuntu 18.04.4, node 14.18.1, forever 4.01

What I am using as a work around currently, is running sudo forever. That works perfectly, with no errors. As soon as I run forever as user, it breaks with the error.

forever is installed globally.

@SwapnilSoni1999
Copy link
Author

Having the same issue Ubuntu 18.04.4, node 14.18.1, forever 4.01

What I am using as a work around currently, is running sudo forever. That works perfectly, with no errors. As soon as I run forever as user, it breaks with the error.

forever is installed globally.

I assume you're using nvm
And sudo is accessing some other node version
have you checked with sudo node --version?

@MatrixFrog
Copy link
Contributor

You can update your dependencies to winston@2.4.5 which should resolve this issue.

Took a stab at upgrading to the latest version of winston (which is currently 3.4.0)

#1128

@2naive
Copy link

2naive commented Jan 28, 2022

May someone check if new version https://www.npmjs.com/package/forever/v/4.0.3 has fixed the problem?
I myself still having this: #1128 (comment)

At least it seems to let me run forever.

@MatrixFrog
Copy link
Contributor

It looks like a little more fixing will be needed. Specifically, flatiron/cliff#11 needs to get merged and then forever needs to depend on that new version of cliff. (Even after that there may be other instances of similar warnings lurking somewhere.)

Terseus added a commit to Terseus/cliff that referenced this issue Jan 29, 2022
This warning came from winston 0.8.x:

    Warning: Accessing non-existent property 'padLevels' of module
    exports inside circular dependency

See foreversd/forever#1077
@2naive
Copy link

2naive commented Jan 29, 2022

We have:

  1. Flatiron (7y dead) depends on broadway 0.3.2.
  2. Broadway (3y dead) from 1.0.0 (4.1.0 now) is not compatible to 0.3.x
  3. Broadway 0.3.6 (last from 0.x.x) depends both on Winston and Cliff
  4. Cliff (7y dead) depends on Winston too.

I've taken a look and couldn't fix fast.

All this inheritance looks like a dead end for me in using Forever :(
It really served well.

@kibertoad
Copy link
Contributor

Yes. Unfortunately, forever is deeply rooted in very outdated libraries.

@MatrixFrog
Copy link
Contributor

I'm not familiar with any of the libraries @2naive listed, except for just looking at them just now. But it looks like forever is only using flatiron for its CLI flag parsing, so it might be possible to switch forever to use yargs or something. Then you'd reduce the number of external dependencies that need updating/forking to just Cliff, hopefully.

@kibertoad
Copy link
Contributor

@MatrixFrog I would prefer using getopts, because yargs comes with its own set of dependencies.

@besworks
Copy link

Specifically, flatiron/cliff#11 needs to get merged

I manually applied the changes described in that PR and so far, with my limited testing, I haven't seen any more warnings. If anyone wants to do the same, make sure to use the updated fix as mentioned in the thread.

This doesn't help when using forever as a dependency in a project but my global install at least has clean logs again.

@billsoranno
Copy link

I have just updated to forever v4.0.3 and still receive the padlevels error.
env:
Debian v4.9.144-3.1
Node v14.18.3
Forever v4.0.3

Due to the error my process will not run. I can run it manually, so I know there is not an issue with the application.
I am using the options file form of the start command.
If I specify all the options I want on the command line, the process starts, but I still get the error messages.

@rodw
Copy link

rodw commented Aug 13, 2022

For what it's worth downgrading from node 14 to node 12 seems to make the problem go away.

I'm also seeing the padLevels circular dependency error with the current release of forever (v4.0.3) and node v14[.16.0 in my case]. However I'm pretty sure the issue was not introduced in forever v4 because I had the same issue in forever v2.0.0. I only upgraded to v4 with the hope of making the problem go away.

I think the root problem may have been introduced in some dependency of forever, but I have not tried to hunt to down which one. Specifically, here's what I'm seeing:

  1. forever v2 has been very stable for me for a long time. I've being running multiple production apps with that under node v10, v12, and v14 for quite some time. This includes fresh, from scratch npm install deployments of these apps - as recently as today - not just old-and-still running instances.
  2. Many of the dependencies used by these apps are pinned to specific versions in package.json (of course?), which are periodically updated based on need and npm outdated reporting.
  3. I just now updated a number of these other dependencies (notably not forever, which has been pinned at =v2.0.0), and suddenly encountered this issue. Upgrading to forever v4 didn't change anything. Downgrading to node v12 does seem to work though (with both forever v2 and v4).

That is, I'm pretty sure what I've seen is (1) a fresh, from-scratch install of the app was working fine, (2) I updated several of my app's other dependencies (mostly express-related) by pinning to the latest version in package.json and re-running npm install, (3) suddenly forever is having this problem (even outside of my app, i.e., forever --help shows the circular dependency error too). To be honest I'm not sure if I fully understand npm's logic for sharing overlapping second-order+ dependencies, but it seems likely to me that updating these other modules must have bumped up the version of some tertiary dependency that forever is also using and that somehow triggered the issue.

As mentioned above, downgrading from node 14 to node 12 seems to make the problem go away. That's good enough for me for now (for test/dev purposes at least) but assuming this issue isn't fixed in forever (or something upstream), personally it may be easier or better to finally migrate to pm2 rather than to try to hunt down the exact cause myself. I've been happy with forever since it has been working fine for me since, well, forever, so there's been no reason to change it but pm2 seems to be the conventional choice for this functionality for most node developers.

EDIT: I just now noticed that this issue was reported not in May of this year but May of 2020. If this isn't a topic that the forever dev team is willing to address maybe they should just flag the module as deprecated/unsupported. I agree this doesn't look like a direct issue in forever, but it is an issue that you can recreate from forever --help alone, so there must be something upstream at least that's causing the issue.

@iofirag
Copy link

iofirag commented Jun 7, 2023

I'm done using forever.

@agnoam

@nolimitdev
Copy link

Forever is correctly working within this warning Accessing non-existent property 'padLevels' of module exports inside circular dependency. For those which mention that forever processes are not running they are probably using forever version < 3.0.0 - in this case you can see in logs The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (xyz) so you must upgrade to forever version v3.0.0 at least. This bug is fixed in v3.0.0 although author does not mention it in changelog: https://github.com/foreversd/forever/blob/master/CHANGELOG.md#300--fri-22-may-2020

@Felix-MoBu
Copy link

Using node v18.18.2 and forever v4.0.3 I still have the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests