node-red / node-red-node-swagger

A set of tools for generating Swagger api documentation based on the HTTP nodes deployed in a flow
Apache License 2.0
62 stars 48 forks source link

Maximum call stack size exceeded #60

Closed jdockter closed 4 years ago

jdockter commented 6 years ago

Unable to load swagger.json or swagger tab when running local or in Bluemix environment. Getting the following:


16 Aug 09:05:41 - [info] Node-RED version: v0.19.1
16 Aug 09:05:41 - [info] Node.js  version: v8.9.0
16 Aug 09:05:41 - [info] Linux 4.15.0-30-generic x64 LE
16 Aug 09:05:41 - [info] Loading palette nodes
16 Aug 09:05:41 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
16 Aug 09:05:41 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
16 Aug 09:05:42 - [info] Settings file  : /home/ibm/.node-red/settings.js
16 Aug 09:05:42 - [info] Context store  : 'default' [module=memory]
16 Aug 09:05:42 - [info] User directory : /home/ibm/.node-red
16 Aug 09:05:42 - [warn] No active project : using default flows file
16 Aug 09:05:42 - [info] Flows file     : /home/ibm/.node-red/flows_ubuntu.json
16 Aug 09:05:42 - [info] Server now running at https://127.0.0.1:1880/
16 Aug 09:05:42 - [debug] loaded flow revision: e2853381858f25f5a9e16fda79676174
16 Aug 09:05:42 - [debug] red/runtime/nodes/credentials.load : no user key present
16 Aug 09:05:42 - [debug] red/runtime/nodes/credentials.load : using default key
16 Aug 09:05:42 - [debug] red/runtime/nodes/credentials.load : keyType=system
16 Aug 09:05:42 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

16 Aug 09:05:42 - [trace] runtime event: {"id":"runtime-state","retain":true}
16 Aug 09:05:42 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"e2853381858f25f5a9e16fda79676174"},"retain":true}
16 Aug 09:05:42 - [info] Starting flows
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : global
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : a21d4ae5.cb9438
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : b262e1c0.ed831
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 4e535d22.05cdb4
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 6f341112.bd52
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 34d91e5c.183102
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : f5a9c075.9f5d8
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 1abb4e90.084d21
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 5318b31f.b1989c
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : bd9ef457.5a1df8
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : d71650aa.72d48
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : b5822f42.92467
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 6842fcef.90a604
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : c0344331.0f921
16 Aug 09:05:42 - [debug] red/nodes/flows.start : starting flow : 55bc520f.e6b38c
16 Aug 09:05:42 - [trace] runtime event: {"id":"runtime-state","retain":true}
16 Aug 09:05:42 - [info] Started flows
RangeError: Maximum call stack size exceeded
    at Object.getNode (/home/ibm/.nvm/versions/node/v8.9.0/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:177:17)
    at checkWiresForHttpResponse (/home/ibm/.node-red/node_modules/node-red-node-swagger/swagger/swagger.js:131:37)
    at checkWiresForHttpResponse (/home/ibm/.node-red/node_modules/node-red-node-swagger/swagger/swagger.js:134:23)
    at checkWiresForHttpResponse (/home/ibm/.node-red/node_modules/node-red-node-swagger/swagger/swagger.js:134:23)
    at checkWiresForHttpResponse (/home/ibm/.node-red/node_modules/node-red-node-swagger/swagger/swagger.js:134:23)
jdockter commented 6 years ago

image

We have a large number of tabs and flows so not sure what in that method might be causing the problem.

JonSilver commented 5 years ago

It's a long time later but as this issue has remained open and unanswered... This error was caused by this commit, and reverting the commit solves this particular problem. @knolleary did express his doubts about this proposed mod in #17, but the mod went ahead anyway and has caused a raft of problems.

knolleary commented 4 years ago

67 has been merged that should address this issue - version 0.1.9 of the node published to npm.