Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Linter crashes after adding too many event listeners, channel closed. (8.2.1) #927

Closed
aforty opened this issue May 26, 2017 · 32 comments
Closed

Comments

@aforty
Copy link

aforty commented May 26, 2017

Issue Type

Bug

Issue Description

Linter crashes and cannot recover.

Bug Checklist

  • Restart Atom
  • Verify the eslint CLI gives the proper result, while linter-eslint does not
  • Paste the output of the Linter Eslint: Debug command from the Command Palette below

I cannot get the output of Linter Eslint: Debug in the console it'll complai about EventEmitter memory leak.

Here is the output of just using linter on my project, it works for a few minutes but seems that once the eventemitter adds too many listeners it crashes after which linter cannot connect to the process and prints channel closed.

Using Atom 1.17.2, linter 2.1.4, linter-eslint 8.2.1.

screen shot 2017-05-26 at 12 53 27

@kalimantos
Copy link

i suggest you to downgrade to 7.3.2 using apm install linter-eslint@7.3.2 waiting for a fix for this issue

@scholtzm
Copy link

scholtzm commented Jun 7, 2017

Getting loads of EventEmitter memory leak detected errors with linter-eslint@8.2.1. For now I have downgraded back to linter-eslint@8.1.7 and seems to be OK.

@not-an-aardvark
Copy link
Contributor

Is there a stack trace for the memory leak detected warning?

@IanVS IanVS mentioned this issue Jun 28, 2017
3 tasks
@IanVS
Copy link
Member

IanVS commented Jun 28, 2017

What type and version of OS are you all using? (Looking for any possible common links)

@craig-bishell
Copy link

craig-bishell commented Jun 28, 2017

I'm also getting this exact error on Windows 10 (Home), Version 1607, OS Build 14393.1198

Happens on every startup, and linter stops working.

Have reverted linter-eslint to 7.3.2 (as per previous issue) and that seems to resolve the issue.

@IanVS
Copy link
Member

IanVS commented Jun 28, 2017

Does turning on/off the Fix errors on save option have any effect?

@craig-bishell
Copy link

No, I do not have it enabled by default, and turning it on (and subsequently off again) has no effect.
The only settings I have enabled are "Disable when no ESLint config is found" and "Show Rule ID in messages" - which I believe are the defaults.

@joshmeads
Copy link

I was experiencing this issue, however, I updated to the current version again yesterday after a few weeks on 8.1.7 and everything seems to be fine again. Appears this isn't the case for everyone though.

@IanVS
Copy link
Member

IanVS commented Jun 29, 2017

This is such a weird issue. 🤔 @joshmeads, what versions of everything are you on now?

@joshmeads
Copy link

joshmeads commented Jun 29, 2017

@IanVS
MacOS 10.12.5
Atom 1.18.0
Linter 2.2.0
Linter-eslint 8.2.1

Fix errors on save = true
Use global ESLint installation = false

Just noticed that today I seem to have been getting errors, however, I'm not sure if they're related to this thread. They're different from what I was seeing when I had this issue.

Path must be a string. Received undefined TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1326:5)
    at process.<anonymous> (/Users/josh/.atom/packages/linter-eslint/src/worker.js:35:26)
    at emitTwo (events.js:111:20)
    at process.emit (events.js:191:7)
    at process.nextTick (internal/child_process.js:744:12)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)(anonymous function) @ <embedded>:70795
/Users/josh/.atom/packages/nuclide/pkg/nuclide-logging/lib/consoleAppender.js:52 [2017-06-28T23:10:44.507Z] [ERROR] atom-ide-diagnostics - Error in linter provider ESLint: Path must be a string. Received undefined
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1326:5)
    at process.<anonymous> (/Users/josh/.atom/packages/linter-eslint/src/worker.js:35:26)
    at emitTwo (events.js:111:20)
    at process.emit (events.js:191:7)
    at process.nextTick (internal/child_process.js:744:12)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

@scholtzm
Copy link

scholtzm commented Jun 30, 2017

Still happening on my end with v8.2.1:

image

macOS 10.12.5
Atom 1.18.0
Linter 2.2.0
Linter-ESLint 8.2.1

@DJTB
Copy link

DJTB commented Jul 1, 2017

Recently it's been working better... but just happened after having Atom open for ~2 minutes.
I created generated some new files with a cli tool (in an already large project), went to the new js file (which included JSX), starting wrting some import x from 'resolved/module/dirs' and I got the error.

Here's some more debug for you!
image

Atom version: 1.18.0
linter-eslint version: 8.2.1
ESLint version: 3.19.0
Hours since last Atom restart: 0.1
Platform: linux (ubuntu 16.04)
Using global ESLint from: /home/subrosa/.config/yarn/global/node_modules/eslint
Current file's scopes: [
  "source.js.jsx"
]
linter-eslint configuration: {
  "disableWhenNoEslintConfig": false,
  "fixOnSave": true,
  "globalNodePath": "/home/subrosa/.config/yarn/global",
  "lintHtmlFiles": true,
  "useGlobalEslint": true,
  "showRuleIdInMessage": true,
  "eslintrcPath": "",
  "advancedLocalNodeModules": "",
  "eslintRulesDir": "",
  "disableEslintIgnore": false,
  "disableFSCache": false,
  "scopes": [
    "source.js",
    "source.jsx",
    "source.js.jsx",
    "source.babel",
    "source.js-semantic"
  ],
  "rulesToSilenceWhileTyping": [],
  "rulesToDisableWhileFixing": []
}

@joshmeads
Copy link

This issue has suddenly reappeared for me after a couple weeks of being fine. It seems to mainly occur when working with JSX.

events.js:106 (node:82688) Warning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit(anonymous function) @ <embedded>:70795(anonymous function) @ <embedded>:70869module.exports.Emitter.simpleDispatch @ <embedded>:63093module.exports.Emitter.emit @ <embedded>:63209(anonymous function) @ <embedded>:70821emitTwo @ events.js:106emit @ events.js:191process.nextTick @ internal/child_process.js:744_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
consoleAppender.js:52 [2017-07-12T18:44:45.025Z] [ERROR] atom-ide-diagnostics - Error in linter provider ESLint: (node:82688) Warning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
undefined
consoleAppender.js:52 [2017-07-12T18:44:45.027Z] [ERROR] atom-ide-diagnostics - Error in linter provider ESLint: (node:82688) Warning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
undefined
linter-registry.js [sm]:137 [Linter] Error running ESLint Error: (node:82688) Warning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit(anonymous function) @ linter-registry.js [sm]:137_tickCallback @ internal/process/next_tick.js:103
linter-registry.js [sm]:137 [Linter] Error running ESLint Error: (node:82688) Warning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

@DJTB
Copy link

DJTB commented Jul 12, 2017

It generally occurs for me very soon after starting atom - and I've also been working heavily with JSX. I'll try to report back if it ever happens without JSX.

@scholtzm
Copy link

I recently updated linter-eslint to latest version and the errors are no longer happening on my end.

macOS 10.12.6
Atom 1.20.1
Linter 2.2.0
Linter-ESLint 8.3.2

@joshmeads
Copy link

I also thought it was fixed. It's been solid for a few days, however, it just crashed again on me today.

Next time it happens I'll try to remember to post logs.

@manuelbieh
Copy link

manuelbieh commented Oct 5, 2017

still happens to me every day in all projects, no matter if small or large :(

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

Atom 1.21.0, linter 2.2.0 and linter-eslint 8.3.2

@IanVS
Copy link
Member

IanVS commented Oct 5, 2017

I started getting this consistently as well, after Atom was open for more than a few minutes. Then I disabled all other Atom packages, and the linter has been stable for a few days. Now I'll start to add packages slowly back in and see if I can find out which one triggers these errors again…

@amccloud
Copy link

amccloud commented Oct 5, 2017

Does anyone else here have nuclide setup?

@joshmeads
Copy link

joshmeads commented Oct 5, 2017

@amccloud yes I do, but my coworker is also experiencing the issue and doesn't have nuclide installed. My error is identical to @manuelbieh's.

It is definitely less common for me now though than it was in linter 8.2.1, but still an issue I run into at least once per week. Usually with quite a few windows/tabs open.

I should also add, I've noticed it more when eslint is configured in package.json rather than .eslintrc. However this may just be random coincidence, my sample size is fairly low.

@skylize
Copy link
Contributor

skylize commented Oct 5, 2017

I should also add, I've noticed it more when eslint is configured in package.json rather than .eslintrc
@joshmeads

I've never seen this and most of my projects are using config from package.json. I'm inclined to think that's just a coincidence.

@stabback
Copy link

stabback commented Oct 11, 2017

@IanVS Have you determined if disabling other packages helps at all? Still having this issue on 8.3.2.

Disabling all other plugins has helped, however the only other heavy hitter I had was tester and tester-jest.

@IanVS
Copy link
Member

IanVS commented Oct 11, 2017

@stabback I've re-enabled a few packages including nuclide, and have not had the problem return so far. Perhaps you can also try disabling other packages, and see if that makes a difference for you?

@stabback
Copy link

@IanVS I had disabled tester and tester-jest and it relieved the issue, however opening up the same codebase today with both of these packages disabled causes the same issue. I'm inclined to think that disabling the packages was a red-herring considering the sporadic nature of the problem.

@IanVS
Copy link
Member

IanVS commented Oct 13, 2017

@stabback, that's totally possible and I'll fully admit that I'm clutching at straws. It would be good to be able to eliminate as many confounding variables as possible, and see if we find any patterns. But so far, patterns have been tough to come by. If anyone has other ideas or is great at troubleshooting problems like this, we could definitely use the help! :)

@OscarBarrett
Copy link

A coworker of mine was running into this, he reinstalled from git last week to try out #1073 and hasn't had the issue since.

@IanVS
Copy link
Member

IanVS commented Jan 24, 2018

Awyeah! Glad to hear it, @OscarBarrett, thanks for letting us know. We're planning to make a release very soon, since we've got some good stuff queued up.

@IanVS
Copy link
Member

IanVS commented Jan 26, 2018

Version 8.4.1 has been released which should hopefully mitigate this problem. Those of you who were having trouble, could you try it out and report back whether you are still experiencing this issue?

@0777101
Copy link

0777101 commented Mar 2, 2018

Hi there! I was having this issue, installed 8.4.1 and now it seems it's gone. Thank you so much

@phallwurst
Copy link

Hi, I still see this issue on 8.4.1. The linter still works, unlike previous versions where this was a problem, but it is painfully slow. I am downgrading to 8.1.7 again, since I do not see the issue there.

@afogo
Copy link

afogo commented Apr 3, 2018

Didn't seem to have this issue previously but now seeing it directly after startup.
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit

OS: macOS Sierra Version 10.12.6
Atom: 1.25.0 x64
linter-eslint: 8.4.1

Seems any release after linter-eslint: 8.2.0, I see this issue. I have reverted back to 8.1.7 and have not seen the issue. Hopefully a solution can be found. 🙁

@UziTech
Copy link
Member

UziTech commented Mar 14, 2021

duplicate of #923

@UziTech UziTech closed this as completed Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests