Cli: MaxListenersExceededWarning after updating to v7.30

Created on 30 Oct 2019  ·  44Comments  ·  Source: forcedotcom/cli

Summary

After updating to version 7.30.13 of the CLI I get warnings about a possible EventEmitter memory leak when running commands.

Steps To Reproduce:

  1. Update cli to 7.30.13
  2. Execute sfdx force:config:get apiVersion

Expected result

API version should be displayed without warnings

Actual result

(node:24913) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
=== Config
Name Value
────────── ─────
apiVersion

Additional information

SFDX CLI Version

sfdx-cli/7.30.13-9e204762d5 darwin-x64 node-v10.15.3

SFDX plugin Version

salesforcedx 47.3.7
├─ salesforcedx-templates 47.3.2
└─ salesforce-alm 47.6.0

(tried downgrading to 46.15.3 with the same result)

OS and version:

MacOS 10.15

Most helpful comment

No longer seeing the error after updating to 7.43.1-ef237e8b37! 🎉🎉🎉 I'm using the pkg version of the CLI, haven't tried npm.

Tested with the following commands:

  • sfdx force:org:list
  • sfdx force:config:get apiVersion

All 44 comments

Also happens for me on Win with sfdx-cli/7.31.0-6a986f8be5 win32-x64 node-v10.15.3

I'm getting _MaxListenersExceededWarning_ for pretty much every force command I execute

SFDX CLI Version: sfdx-cli/7.31.0-6a986f8be5 linux-x64 node-v10.15.3

SFDX plugin Version

@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.1 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-diff 0.0.3
@salesforce/sfdx-trust 3.0.5 (core)
analytics 1.2.1 (core)
generator 1.1.1 (core)
salesforcedx 47.4.0 (core)
├─ salesforcedx-templates 47.3.2 (core)
└─ salesforce-alm 47.7.0 (core)

sfdx-cli 7.31.0 (core)
sfdx-waw-plugin 1.5.0

OS and version: Ubuntu 16.04.6 LTS

same on OSX 10.14.6 and
sfdx-cli/7.36.0-b1c4e9c7c8 darwin-x64 node-v10.15.3

Same on OSX 10.14.6
sfdx-cli/7.37.1 darwin-x64 node-v12.13.0

Getting this for sfdx force:user:password:generate and force:user:display
Nothing happens with no error message when trying to use force:org:open

The fix for this will be going out in the next release on 2020-01-09.

I just ran an sfdx update and that introduced the error.

sfdx-cli/7.42.1-e41dbeb8d9 win32-x64 node-v10.15.3

I am seeing this as well

is there any update on this? still getting this error. unable to deploy to orgs. Any version that i can rollback to workaround for the time being?

Still encountering the same problem.

sfdx-cli/7.42.1-e41dbeb8d9 darwin-x64 node-v10.15.3
Mac OS X 10.15.2

Same here on version sfdx-cli/7.42.1-e41dbeb8d9 linux-x64 node-v10.15.3

Rolling back to 47.15.0 worked
sfdx plugins:install [email protected]

I'm getting the error as well. I even updated my version of node.js

I was running the command: sfdx force:source:status -u MyScratchOrg

I'm getting it too running sfdx force:source:deploy when pushing into a sandbox

This error MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit started occurring for me since upgrading to sfdx-cli/7.42.1-e41dbeb8d9 win32-x64 node-v10.15.3.

Running sfdx plugins:install [email protected] has resolved the issue, but can you explain why @johnzhao9 ?. Prior to running the command, sfdx plugins --core listed salesforcedx 47.15.0 (core), now it says salesforcedx 47.15.0 (47.15.0).

Should there be a difference?

It also happens to me

Seeing this with sfdx force:org:create. Executing sfdx plugins:install [email protected] as @jamesmelville mentioned seems to mitigate the warning. I have a Heroku app that pulls sfdx from a buildpack, so I'm not able to do this on every worker dyno that spins up :(

@jamesmelville I don't know why either. Maybe the version number is mislabeled or re-installing the same version cleared out dependency / cache issues

Diffing the code before and after update at sfdx/node_modules/salesforce-alm/dist/commands/force might be a way to find out what's up with this

Thank you all for bringing this to our attention. We thought we had a fix out for this in 47.14 but it sounds like 47.15 has the same error. Please provide any details you have on what commands you are running that cause you to see this error, we have someone looking into the issue now.

The workaround of downgrading the salesforcedx plugin does not work for me. I've tried a few things with no success.

macOS 10.15.2
local node version: 13.6

@clairebianchi a simple sfdx force:org:list gives this error . I am on sfdx-cli 7.42.1 and salesforcedx version 47.15.0(core). Hope this helps

In my case there is no homebrew component.
SFDX version: is:
sfdx-cli/7.42.1-e41dbeb8d9 darwin-x64 node-v10.15.3
salesforcedx 47.15.0 (core)

Can cause issue with: sfdx force:org:list

Seeing similar behavior on a client's windows machine after issuing sfdx update on their machine this morning.

We are working on a fix right now. The issue should not be blocking, are you still able to execute the commands even though the warning is showing up?

@clairebianchi yes, the commands are still able to execute just appended with the warning

Thank you @hiepllp.

We are hoping to get a fix out in this Thursday's release. The fix is in QA now.

I am encountering this issue on my side also. It is kind of blocking since I am parsing the json response of the request but since these warning came in, the parsing failed. Do you have an ETA when this should be resolved?

Working fine in this version
sfdx-cli/7.41.0-2a5f766389 linux-x64 node-v10.15.3

Having the issue with this version
sfdx-cli/7.42.1-e41dbeb8d9 linux-x64 node-v10.15.3

Is there a way I can download a specified version?

@kevanmoothien Are you seeing this message on stdout? I've only seen it on stderr, and for a bit now all structured/JSON output is sent to stdout and all unstructured/informational output is sent to stderr. As long as you're only parsing stdout you should be okay.

We have a fix and it will go into tomorrow's release

Thanks @SCWells72. The library I used was passing both the stdout and stderr together. Parsing just the stdout works fine.

During update:

> sfdx update
> sfdx-cli: Updating CLI from 7.36.0-b1c4e9c7c8 to 7.42.1-e41dbeb8d9... done
> (node:85127) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
> sfdx-cli: Updating CLI... done
> warning "@salesforce/lwc-dev-server > @webruntime/compiler > @lwc/[email protected]" has incorrect peer dependency "@lwc/[email protected]".
> sfdx-cli: Updating plugins... done
> (node:84827) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

We need to do something special after update?

@clairebianchi Hey there... was the fix going today (WED) or on Thursday ? Thanks!

@qduck93 I am trying to get the fix in by the end of today. I will update this channel once I know more

The fix will go out in the CLI release tomorrow Thursday 1/23/2020

Following

for added flavor, not only do i see the error with the already noted commands, VS Code also crashes. When creating a new Lightning Web Component (right click on target folder OR select from command palette) VS Code crashes. OSX 10.15.2 (19C57)

The fix will go out in the CLI release tomorrow Thursday 1/23/2020

What time on Thursday (today) will this bug fix be released?

fix still not released :-(

The 23rd isn't over yet. Hopefully the fix will be out before this evening.

California is just getting into the office now... I would not expect the release before 11:00 PST

Yes, the releases typically go out later in the afternoon pacific time. It will be released by the end of the day though.

Following.

I see this Warning appear when I retrieve changes from my Org.
sfdx force:source:retrieve --sourcepath

No longer seeing the error after updating to 7.43.1-ef237e8b37! 🎉🎉🎉 I'm using the pkg version of the CLI, haven't tried npm.

Tested with the following commands:

  • sfdx force:org:list
  • sfdx force:config:get apiVersion

The fix is out, Thank you all for being patient with us.

Is anyone else still getting the error on v47.16.0?

I facing .. all refreshed up to date

♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦

Name: Salesforce CLI Integration
Id: salesforce.salesforcedx-vscode-core
Description: Provides integration with the Salesforce CLI
Version: 47.16.0
Publisher: Salesforce
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-core

♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦

(node:15992) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦

PS C:\VS Code SF Projects\XXX Sandbox> sfdx force:org:list
=== Orgs
ALIAS USERNAME ORG ID CONNECTED STATUS
─── ────────────────── ─────────────────────────────────────
XXX

No active scratch orgs found. Specify --all to see all scratch orgs
(node:22420) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

Was this page helpful?
0 / 5 - 0 ratings