Skip to content

Push module: warning logs about Memory leak #93

Open

Description

@uluru-phatnguyen

Hi @flovilmart ,
I updated with newest version.

I got warning:
Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit

Thanks.

Activity

  1. uluru-phatnguyen commented on Aug 7, 2017

    @uluru-phatnguyen
    Author
  2. uluru-phatnguyen commented on Aug 8, 2017

    @uluru-phatnguyen
    Author
    node-pre-gyp ERR! parse-server-push-adapter APNS     at _connection._streamIds.forEach (/home/user_deploy/server-slave/source/node_modules/apn/lib/protocol/endpoint.js:155:16)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at Array.forEach (native)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at EventEmitter.close [as _close] (/home/user_deploy/server-slave/source/node_modules/apn/lib/protocol/endpoint.js:139:33)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at emitOne (events.js:101:20)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at TLSSocket.emit (events.js:188:7)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at _handle.close (net.js:497:12)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at TCP.done [as _onclose] (_tls_wrap.js:332:7)
    node-pre-gyp ERR! parse-server-push-adapter APNS  APNS error transmitting to device %s with error %s 5fbdd21771431068be20c7346ef6f0afc408318769c9be6c25c27b9b67c2fee0 { VError: apn write failed: Not receiving Ping response after 150000 ms
    node-pre-gyp ERR! parse-server-push-adapter APNS     at Stream.stream.on.err (/home/user_deploy/server-slave/source/node_modules/apn/lib/client.js:105:21)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at emitOne (events.js:96:13)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at Stream.emit (events.js:188:7)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at _connection._streamIds.forEach (/home/user_deploy/server-slave/source/node_modules/apn/lib/protocol/endpoint.js:155:16)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at Array.forEach (native)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at EventEmitter.close [as _close] (/home/user_deploy/server-slave/source/node_modules/apn/lib/protocol/endpoint.js:139:33)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at emitOne (events.js:101:20)
    
    2017-08-08 12:05 +09:00:  parse-server-push-adapter APNS     at TLSSocket.emit (events.js:188:7)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at _handle.close (net.js:497:12)
    node-pre-gyp ERR! parse-server-push-adapter APNS     at TCP.done [as _onclose] (_tls_wrap.js:332:7)
    node-pre-gyp ERR! parse-server-push-adapter APNS   jse_shortmsg: 'apn write failed: Not receiving Ping response after 150000 ms',
    node-pre-gyp ERR! parse-server-push-adapter APNS   jse_info: {},
    node-pre-gyp ERR! parse-server-push-adapter APNS   message: 'apn write failed: Not receiving Ping response after 150000 ms',
    node-pre-gyp ERR! parse-server-push-adapter APNS   stack: 'VError: apn write failed: Not receiving Ping response after 150000 ms\n    at Stream.stream.on.err (/home/user_deploy/server-slave/source/node_modules/apn/lib/client.js:105:21)\n    at emitOne (events.js:96:13)\n    at Stream.emit (events.js:188:7)\n    at _connection._streamIds.forEach (/home/user_deploy/server-slave/source/node_modules/apn/lib/protocol/endpoint.js:155:16)\n    at Array.forEach (native)\n    at EventEmitter.close [as _close] (/home/user_deploy/server-slave/source/node_modules/apn/lib/protocol/endpoint.js:139:33)\n    at emitOne (events.js:101:20)\n    at TLSSocket.emit (events.js:188:7)\n    at _handle.close (net.js:497:12)\n    at TCP.done [as _onclose] (_tls_wrap.js:332:7)' }
    node-pre-gyp ERR! parse-server-push-adapter APNS VError: apn write failed: Not receiving Ping response after 150000 ms
    
  3. uluru-phatnguyen commented on Aug 8, 2017

    @uluru-phatnguyen
    Author

    Duplicate #90

  4. idefen1 commented on Jan 6, 2018

    @idefen1

    I am getting the same Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit warning and I only have about 2,000 installations. Anyone find a fix to this? I've tried reading most of the posts but have not had any luck quite understanding a solution =\

  5. gateway commented on Apr 6, 2018

    @gateway

    I'm starting to see this recently.. Any updates to this.. I'm running the latest parse server 2.7.4

  6. funkenstrahlen commented on May 12, 2018

    @funkenstrahlen
    Contributor

    I did some testing on the latest parse server release 2.7.4 and also see this warning in the logs. I do not really know how to debug this.

  7. changed the title [-]Push module: warning logs about Memory lead[/-] [+]Push module: warning logs about Memory leak[/+] on May 12, 2018
  8. flovilmart commented on May 12, 2018

    @flovilmart
    Contributor

    This is probably an issue with the node apn module, and therefore the push adapter

  9. funkenstrahlen commented on May 12, 2018

    @funkenstrahlen
    Contributor

    @flovilmart So you mean this should be reported to node-apn? Maybe this will be resolved with node apn 3.0 release. This might take some time though.

    Until then I do not want to run 2.7.4 in production because of the memory leaks.

  10. flovilmart commented on May 12, 2018

    @flovilmart
    Contributor

    That’s quite unrelated, the emitter and leaks, but your call. 2.7.4 has been out for a while, and I’m not sure anything will be done in node apn for this issue as they are moving to a native http2 implementation. Also, you can use any version of the push adapter you like!

  11. funkenstrahlen commented on May 12, 2018

    @funkenstrahlen
    Contributor

    So you suggest using the 2.7.4 parse Server version with an older version of the push adapter by explicitly setting this in my package.json?

  12. flovilmart commented on May 12, 2018

    @flovilmart
    Contributor

    Yep, and passing it into your ParseServer constructor, setting it in the package.json won’t automatically pick it up

  13. refre5h commented on May 21, 2018

    @refre5h

    @funkenstrahlen are you able to get it working (with 2.7.4 and setting an older version of push adapter in package.json)? I'm unsure how to pass the apn adapter in the new ParseServer({...}) constructor.

  14. flovilmart commented on May 22, 2018

    @flovilmart
    Contributor

    @refre5h you can do it this way:

    
    const pushOptions = {
       ios: {} // your iOS config 
    }
    const { ParsePushAdapter } = require('@parse/push-adapter');
    const pushAdapter = new ParsePushAdapter(pushOptions);
    
    new ParseServer({
       ... 
       push: {
          adapter: pushAdapter,
       }
    });
    

    Does it help?

  15. refre5h commented on May 22, 2018

    @refre5h

    @flovilmart I got the server running with your sample, tyvm! But I'm still getting the Possible EventEmitter memory leak detected. error with the lowest available version on npm (2.0.2). From the release log on git (https://github.com/parse-community/parse-server-push-adapter/releases), it looks like 1.3.0 is the version before the adapter upgraded apn, but I was unable to install v1.3.0 as I got the error No matching version found for @parse/push-adapter@^1.3.0 when doing npm install. Any advice please?

  16. flovilmart commented on May 22, 2018

    @flovilmart
    Contributor

    @refre5h the package was renamed from parse-server-push-adapter so try this instead:

    npm install --save parse-server-push-adapter@1.3.0
    const { ParsePushAdapter } = require('parse-server-push-adapter');
    const pushAdapter = new ParsePushAdapter(pushOptions); 
    ...
  17. refre5h commented on May 22, 2018

    @refre5h

    @flovilmart That clear things up! I'm having the server running for a couple hours now, and I don't see any memory leak issue after sending numerous push. Thanks again!

  18. flovilmart commented on May 22, 2018

    @flovilmart
    Contributor

    @refre5h what version are you running now?

  19. refre5h commented on May 22, 2018

    @refre5h

    "parse-server": "^2.7.4",
    "parse-server-push-adapter": "^1.3.0",

    node -v // v6.12.2

    ...and I used your sample codes above in my index.js.

  20. flovilmart commented on May 22, 2018

    @flovilmart
    Contributor

    Ok and using the newest alpha versions of the adapter alongside node 8 with the latest release? Any feedback?

  21. funkenstrahlen commented on May 23, 2018

    @funkenstrahlen
    Contributor

    I currently run

    • node 8.*
    • parse-server 2.7.4
    • @parse/push-adapter 3.0.0-alpha1

    It does not leak memory and runs fine for me for about 2 weeks now (regarding push notifications). I have not enabled auto clearing of bad device tokens yet.

    I chose to try the alpha release of the push adapter because 1.3.0 is too old.

  22. flovilmart commented on May 23, 2018

    @flovilmart
    Contributor

    Thanks for the feedback. The next release of parse server will be for node 8 minimum. It’s about time :)

  23. jenlai1345 commented on Mar 15, 2019

    @jenlai1345

    I currently run

    • node 8.*
    • parse-server 2.7.4
    • @parse/push-adapter 3.0.0-alpha1

    It does not leak memory and runs fine for me for about 2 weeks now (regarding push notifications). I have not enabled auto clearing of bad device tokens yet.

    I chose to try the alpha release of the push adapter because 1.3.0 is too old.

    Hi @funkenstrahlen ,

    I was having memory leak issues and decided to use 3.0.0 push-adapter like you suggested. Just wondering if you had any more memory issue after you switched to the newer version of push-adapter?

    Thank you!

    p.s. for those who wanna switch to push-adapter 3.0.0, make sure you have node version > 8.11.1 otherwise your parse server will throw an error of "no http2 module found". I previously had node 6 so when I upgraded push-adapter, the server died.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions