eclipse-agail / agile-recommender

Eclipse Public License 2.0
1 stars 0 forks source link

request to nodered fails with TypeError: config.forEach is not a function #7

Open cskiraly opened 6 years ago

cskiraly commented 6 years ago

@SedaPolatErdeniz, it seems there is some problem in the use of the NodeRed API. The below error message is repeated periodically in the logs:

agile-recommender        | will call get token
agile-recommender        | will call get token
agile-recommender        | get token succeeded
agile-recommender        | get token succeeded
agile-recommender        | will call flows
agile-nodered            | TypeError: config.forEach is not a function
agile-nodered            |     at Object.parseConfig (/opt/secure-nodered/node_modules/node-red/red/runtime/nodes/flows/util.js:78:16)
agile-nodered            |     at Object.setFlows (/opt/secure-nodered/node_modules/node-red/red/runtime/nodes/flows/index.js:109:34)
agile-nodered            |     at post (/opt/secure-nodered/node_modules/node-red/red/api/flows.js:68:22)
agile-nodered            |     at Layer.handle [as handle_request] (/opt/secure-nodered/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
agile-nodered            |     at next (/opt/secure-nodered/node_modules/node-red/node_modules/express/lib/router/route.js:131:13)
agile-nodered            |     at /opt/secure-nodered/node_modules/node-red/red/api/auth/index.js:57:28
agile-nodered            |     at complete (/opt/secure-nodered/node_modules/passport/lib/middleware/authenticate.js:250:13)
agile-nodered            |     at /opt/secure-nodered/node_modules/passport/lib/middleware/authenticate.js:257:15
agile-nodered            |     at pass (/opt/secure-nodered/node_modules/passport/lib/authenticator.js:421:14)
agile-nodered            |     at Authenticator.transformAuthInfo (/opt/secure-nodered/node_modules/passport/lib/authenticator.js:443:5)
agile-recommender        | will call flows
agile-recommender        | Exception in nodered api: 400 Bad Request
agile-recommender        | End of adding devices and workflows into the profile
agile-recommender        | 1- update profile is done
agile-recommender        | 2- call the service
agile-recommender        | with recommenderProfile with dev size: 1
agile-recommender        | with recommenderProfile with dev title: CC2650 SensorTag Temperature Humidity Pressure Optical
agile-recommender        | Exception in nodered api: 400 Bad Request
agile-recommender        | End of adding devices and workflows into the profile
cskiraly commented 6 years ago

@seda, @nopbyte, @ansriaz, please have a look

nopbyte commented 6 years ago

This exception only includes code from node-red in the stack. You can see this because all the entries in the exception stack trace are inside /node_modules/.

It is hard to understand the error, as there is no description of what you are attempting to do in your code @SedaPolatErdeniz.

Can you please post a minimal sample of code or curl command lines that reproduces the error?

To discard any potential issues regarding updates of AGILE security, i would recommend you to remove the $DATA/security folder and restart the containers.