{"action":"created","issue":{"url":"https://api.github.com/repos/deployd/deployd/issues/571","labels_url":"https://api.github.com/repos/deployd/deployd/issues/571/labels{/name}","comments_url":"https://api.github.com/repos/deployd/deployd/issues/571/comments","events_url":"https://api.github.com/repos/deployd/deployd/issues/571/events","html_url":"https://github.com/deployd/deployd/issues/571","id":78116616,"number":571,"title":"deployd crashes with RangeError: Maximum call stack size exceeded","user":{"login":"parceval","id":848617,"avatar_url":"https://avatars.githubusercontent.com/u/848617?v=3","gravatar_id":"","url":"https://api.github.com/users/parceval","html_url":"https://github.com/parceval","followers_url":"https://api.github.com/users/parceval/followers","following_url":"https://api.github.com/users/parceval/following{/other_user}","gists_url":"https://api.github.com/users/parceval/gists{/gist_id}","starred_url":"https://api.github.com/users/parceval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parceval/subscriptions","organizations_url":"https://api.github.com/users/parceval/orgs","repos_url":"https://api.github.com/users/parceval/repos","events_url":"https://api.github.com/users/parceval/events{/privacy}","received_events_url":"https://api.github.com/users/parceval/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-19T14:41:29Z","updated_at":"2015-05-19T15:52:07Z","closed_at":null,"body":"I always get this crash:\r\n\r\nPOST /process/ RangeError: Maximum call stack size exceeded\r\n    at Array.forEach (native)\r\n    at wrapAsyncFunctions (/usr/home/user42/my_website/node_modules/deployd/lib/script.js:294:31)\r\n    at /usr/home/user42/my_website/node_modules/deployd/lib/script.js:299:7\r\n    at Array.forEach (native)\r\n    at wrapAsyncFunctions (/usr/home/user42/my_website/node_modules/deployd/lib/script.js:294:31)\r\n    at /usr/home/user42/my_website/node_modules/deployd/lib/script.js:302:7\r\n    at Array.forEach (native)\r\n    at wrapAsyncFunctions (/usr/home/user42/my_website/node_modules/deployd/lib/script.js:294:31)\r\n    at /usr/home/user42/my_website/node_modules/deployd/lib/script.js:302:7\r\n    at Array.forEach (native)\r\n    at wrapAsyncFunctions (/usr/home/user42/my_website/node_modules/deployd/lib/script.js:294:31)\r\n    at /usr/home/user42/my_website/node_modules/deployd/lib/script.js:302:7\r\n    at Array.forEach (native)\r\n    at wrapAsyncFunctions (/usr/home/user42/my_website/node_modules/deployd/lib/script.js:294:31)\r\n    at /usr/home/user42/my_website/node_modules/deployd/lib/script.js:302:7\r\n    at Array.forEach (native)\r\n\r\nif i run a certain REST API call,\r\ni am running node v0.12.2 and deployd 0.8.2 on  FreeBSD 10.0-RELEASE AMD64. Even after increasing the stack-size of node with --stack-size=524288 the error still happens. Looking into the source of script.js, it seems to me that the recursion in wrapAsyncFunctions() could be the problem. Maybe there is some process.nextTick missing or something.\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/deployd/deployd/issues/comments/103560529","html_url":"https://github.com/deployd/deployd/issues/571#issuecomment-103560529","issue_url":"https://api.github.com/repos/deployd/deployd/issues/571","id":103560529,"user":{"login":"parceval","id":848617,"avatar_url":"https://avatars.githubusercontent.com/u/848617?v=3","gravatar_id":"","url":"https://api.github.com/users/parceval","html_url":"https://github.com/parceval","followers_url":"https://api.github.com/users/parceval/followers","following_url":"https://api.github.com/users/parceval/following{/other_user}","gists_url":"https://api.github.com/users/parceval/gists{/gist_id}","starred_url":"https://api.github.com/users/parceval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parceval/subscriptions","organizations_url":"https://api.github.com/users/parceval/orgs","repos_url":"https://api.github.com/users/parceval/repos","events_url":"https://api.github.com/users/parceval/events{/privacy}","received_events_url":"https://api.github.com/users/parceval/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T15:52:07Z","updated_at":"2015-05-19T15:52:07Z","body":"console.log(\"processing gallery\");\r\n\r\ndpd.gallery.get(galleryId, function(gallery, failReason) {\r\n    if (failReason) {\r\n        error(failReason);\r\n    }\r\n    if (gallery) {\r\n\r\n        if (turnId) {   // nur einen Turn processen\r\n            console.error(\"turnid:\", turnId)\r\n            dpd.turns.get(turnId, function (turn, failReason) {\r\n                if (failReason) {\r\n                    error(failReason);\r\n                }\r\n                if (turn) {\r\n                    make_thumbnail(turn, gallery);\r\n                }\r\n            });\r\n        }\r\n        else {  // ganze gallery updaten.\r\n            // turnliste aus group lesen\r\n            console.log('process/post for whole gallery for groupId', gallery.groupId)\r\n\r\n            dpd.turns.get({groupId: gallery.groupId}, function (turns, err) {\r\n                //console.log(\"turns: \", turns);\r\n                if (err) {\r\n                    console.log('error in process/post for whole gallery ', err)\r\n                }\r\n                for (var turn in turns) {\r\n                    make_thumbnail(turns[turn], gallery);\r\n                }\r\n            });\r\n        }\r\n    }\r\n});\r\n\r\nThis is the event which is called. The thing is that not even the first line (console.log) gets executed.\r\n\r\n"}}