IBM/build-blockchain-insurance-app

Cannot read property map of undefined.

vasanthk97 opened this issue · 2 comments

I have followed steps to run the project. I am running using below versions
docker 18.03.1-ce
docker-compose 1.22.0
node 8.9.4
npm 5.6.0
go 1.11
ubuntu 16.04

The detailed logs are as follows.
`> blockchain-for-insurance@2.1.0 serve /app

cross-env NODE_ENV=production&&node ./bin/server

/app/app/static/js
Server running on port: 3000
Default channel not found, attempting creation...
Successfully created a new default channel.
Joining peers to the default channel.
Chaincode is not installed, attempting installation...
Base container image present.
info: [packager/Golang.js]: packaging GOLANG from bcins
info: [packager/Golang.js]: packaging GOLANG from bcins
info: [packager/Golang.js]: packaging GOLANG from bcins
info: [packager/Golang.js]: packaging GOLANG from bcins
Successfully installed chaincode on the default channel.
(node:22) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
at /app/www/routers/shop.router.js:49:19
at Generator.next ()
at step (/app/bin/routers/shop.router.js:20:191)
at /app/bin/routers/shop.router.js:20:361
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:22) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:22) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: [Peer.js]: sendProposal - timed out after:45000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/app/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
Fatal error instantiating chaincode on some(all) peers!
Error: Proposal rejected by some (all) of the peers: Error: REQUEST_TIMEOUT
at /app/www/blockchain/utils.js:248:15
at Generator.next ()
at step (/app/bin/blockchain/utils.js:102:191)
at /app/bin/blockchain/utils.js:102:361
at
at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! blockchain-for-insurance@2.1.0 serve: cross-env NODE_ENV=production&&node ./bin/server
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the blockchain-for-insurance@2.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-10-04T09_01_08_524Z-debug.log
`

Any help is apprreciated.

i am using Ubuntu 18.04 with all the pacage versions as mentioned in the above post and getting exactly the same error. As per the instructions , we have to install node js in Non SUDO mode!, but i installed using sudo, not sure if this is the source of the error. Appreciate any quick help to resolve this issue.

pattern is updated - so issue went away