Node-slack-sdk: No response from Webclient methods.

Created on 25 May 2018  路  4Comments  路  Source: slackapi/node-slack-sdk

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • [x] bug
  • [ ] enhancement (feature request)
  • [x] question
  • [x] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

@slack/client version: 4.2.2

node version: 8.7.0
npm version: 5.6.0

OS version(s): macOS High Sierra 10.13.4

Steps to reproduce:

  1. installed the version specified above.
  2. code is below
const web = new WebClient(
                '<TOKEN>',
                {
                    maxRequestConcurrency: 10,
                    logLevel: 'debug',
                    logger: (level, message) => {
                        logger.info(message);
                    }
                }
            );

            web
                .channels
                .list({
                    exclude_members: true,
                    exclude_archived: true,
                    limit: 10
                })
                .then(res => {
                   console.log('channels', res.channels);
                })
                .catch(error => {
                    console.error('Error: ', error);
                });

Below are the logs which gets generated.

@slack/client:WebClient "initialized"
@slack/client:WebClient "apiCall() start"
@slack/client:WebClient "request attempt"

<--- Last few GCs --->

[94028:0x102802600]    36734 ms: Mark-sweep 1404.7 (1461.3) -> 1404.6 (1438.3) MB, 2855.6 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2856 ms) last resort GC in old space requested
[94028:0x102802600]    39417 ms: Mark-sweep 1404.6 (1438.3) -> 1404.6 (1438.3) MB, 2682.6 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1245d08a5e71 <JSObject>
    1: /* anonymous */ [_stream_writable.js:~264] [pc=0x2f45b35f3b4b](this=0x124507803001 <Transform map = 0x1245d1de4021>,chunk=0x124507803019 <Uint8Array map = 0x1245dadc1a21>,encoding=0x1245aad82311 <undefined>,cb=0x1245aad82311 <undefined>)
    2: arguments adaptor frame: 1->3
    3: ondata [_stream_readable.js:~637] [pc=0x2f45b363c74c](this=0x124507803349 <IncomingMessage map = 0x1245d1de62...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [~/.nvm/versions/node/v8.7.0/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [~/.nvm/versions/node/v8.7.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [~/.nvm/versions/node/v8.7.0/bin/node]
 4: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) ~/.nvm/versions/node/v8.7.0/bin/node]
 5: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [~/.nvm/versions/node/v8.7.0/bin/node]
 6: 0x2f45b348463d

and then app crashes.

Expected result:

Expected to return list of channels

Actual result:

Crashed node app

needs info question

Most helpful comment

Also, from what I can see on the Slack's document page, I'd rather not use channels.list API anymore, but conversations.list instead.

Don't use this method. Use conversations.list instead.

All 4 comments

hi @krishna-koushik, sorry about the difficulties. so, we're dealing with an out of memory situation. is there any other code in this program that could cause memory usage to spike? was there a version of this package that did not cause the memory to spike in this app (a last known good state)? it seems highly unlikely to me that a simple call to channels.list would take over 1 GB of memory. i'm going to run a test myself to see if i can figure out what the expected memory use for a simple call like this should be.

as far as i can tell (and i am fairly novice in memory debugging), i ran the same program and saw about 482k worth of allocations, and they seem to all be reclaimed by the GC. i also ran on the same version of node (8.7.0).

Also, from what I can see on the Slack's document page, I'd rather not use channels.list API anymore, but conversations.list instead.

Don't use this method. Use conversations.list instead.

Closing this issue due to inactivity

Was this page helpful?
0 / 5 - 0 ratings