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

RangeError: Maximum call stack size exceeded #182

Closed
MiteshShah opened this issue Aug 23, 2016 · 10 comments
Closed

RangeError: Maximum call stack size exceeded #182

MiteshShah opened this issue Aug 23, 2016 · 10 comments

Comments

@MiteshShah
Copy link

found 5078 keys for "crons:app_stats:2016-08-22:apps"

/usr/lib/node_modules/redis-commander/node_modules/ioredis/node_modules/bluebird/js/main/async.js:43
        fn = function () { throw arg; };
                                 ^
RangeError: Maximum call stack size exceeded

Whenever we try to access crons:app_stats:2016-08-22:apps its crashed and have to restart redis-commander

@jflo-elsevier
Copy link

jflo-elsevier commented Sep 28, 2016

Same issue on an instance with 80K+ keys

@WeetA34
Copy link

WeetA34 commented Mar 27, 2018

I got the same issue when deploying tree with 4292 keys.
To avoid it, i used the following workaround:

--- /usr/lib/node_modules/redis-commander/lib/routes/apiv1.js.orig      2018-03-26 19:21:14.519385451 +0000
+++ /usr/lib/node_modules/redis-commander/lib/routes/apiv1.js   2018-03-26 19:19:49.404708555 +0000
@@ -685,7 +685,8 @@
         }
       });

-      async.forEachLimit(reducedKeys, 10, function (keyData, callback) {
+      //async.forEachLimit(reducedKeys, 10, function (keyData, callback) {
+      async.forEach(reducedKeys, function (keyData, callback) {
         if (keyData.leaf) {
           redisConnection.type(keyData.fullKey, function (err, type) {
             if (err) {

@Jerome2606
Copy link

I got the same issue and I confirm the fix from WeetA34.

Tested on Windows by changing:
C:\Users{user}\AppData\Roaming\npm\node_modules\redis-commander\lib\routes\apiv1.js

@sseide
Copy link
Collaborator

sseide commented Nov 27, 2018

@Jerome2606 - is it possible the problem you run into is this? caolan/async#1265 - or more precisely the pitfall mentioned there at the last comment with https://github.com/caolan/async/blob/master/intro.md#synchronous-iteration-functions?

Can you please check if changing the code in apiv1.js with this works too? Wrapping the second callback() into async.setImmediate(callback)?(change line 965)

    async.eachLimit(reducedKeys, 10, function (keyData, callback) {
      if (!keyData.children) {
        redisConnection.type(keyData.fullKey, function (err, type) {
          ...
        });
      } else {
        delete keyData.fullKey;
        async.setImmediate(callback);
      }

Thanks

@Jerome2606
Copy link

I cannot get the last version by doing a npm install redis-commander.
By my side async.setImmediate is not a function.
I'm checking how to update redis-commander

@sseide
Copy link
Collaborator

sseide commented Nov 27, 2018

or use process.nextTick(callback) instead - should be the same for this specific problem

@Jerome2606
Copy link

Jerome2606 commented Nov 27, 2018

@sseide I confirm your suggestion is working.

By the way, I had this issue
#144

To make the 0.5.0 working, I had to modify the app.js file:
Original:

let browserify = require('browserify-middleware');
let myUtils = require('./util');
let bodyParser = require('body-parser');
let partials = require('express-partials');
let jwt = require('jsonwebtoken');

Changed:

let browserify = require('browserify-middleware');
let myUtils = require('./util');
process.chdir( path.join(__dirname, '..') );    // fix the cwd
let bodyParser = require('body-parser');
let partials = require('express-partials');
let jwt = require('jsonwebtoken');

suggestion from #144 (comment)

@sseide
Copy link
Collaborator

sseide commented Nov 27, 2018

i will create an PR with it.

Regarding issue 144 - on line 71 of the app.js is the same statement (just commented out - the original bugfix for 144). Uncommenting it is fine too? Or what is the problem with the current working dir? Some stack-trace?

For some reason this fix was reverted later on without giving an explanation (commit db1713a by @ozomer )...

@Jerome2606
Copy link

stacks:

1st error:

Error: Cannot find module 'readline-browserify' from 'C:\Users\JLT'
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17
    at process (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
    at load (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)
Error: Cannot find module 'readline-browserify' from 'C:\Users\JLT'
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17
    at process (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
    at load (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)

Fixed by

npm install readline-browserify -g
+ readline-browserify@0.0.4
added 1 package from 1 contributor in 0.645s

2nd error:

Error: Cannot find module 'cmdparser' from 'C:\Users\JLT'
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17
    at process (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
    at load (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)
Error: Cannot find module 'cmdparser' from 'C:\Users\JLT'
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17
    at process (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
    at load (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\JLT\AppData\Roaming\npm\node_modules\redis-commander\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)

Fixed with the change in app.js

@Jerome2606
Copy link

@sseide Yes uncommenting the line 71 is working fine as well.

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

5 participants