question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while running

See original GitHub issue

Hello,

I am getting the following error when running the application:

> 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.
(node:21) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
    at /app/www/routers/shop.router.js:49:19
    at Generator.next (<anonymous>)
    at step (/app/bin/routers/shop.router.js:20:191)
    at /app/bin/routers/shop.router.js:20:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:21) 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:21) [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.
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
(node:21) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
    at /app/www/routers/shop.router.js:49:19
    at Generator.next (<anonymous>)
    at step (/app/bin/routers/shop.router.js:20:191)
    at /app/bin/routers/shop.router.js:20:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:21) 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: 2)
Successfully installed chaincode on the default channel.

I get no issues when running ./build_mac.sh.

The application just hangs after I ‘try to buy insurance for a bike’ on this step: https://github.com/IBM/build-blockchain-insurance-app/blob/master/images/Picture3.png

Docker version 18.03.1-ce, build 9ee9f40 docker-compose version 1.21.2, build a133471 npm 5.6.0 node v8.11.3 Python 2.7.13

I have tried multiple checkouts and reinstalling dependencies. I also get the same issue on Ubuntu 18.04.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

5reactions
lll2657commented, Jul 10, 2018

Before solving these issues, please use ./clean.sh first to clean your docker containers.

Join Peer Issue

Symptoms: Stuck inJoining peers to the default channel. Timeout: error: [Peer.js]: sendProposal - timed out after:45000 (node:21) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined

The reason for the issue is that the peers fail to join the channel because they are not ready to be used by the callback function in joinChannel() in ./web/www/blockchain/utils.js. In order to fix this, we need to separate the functions in the line docker-compose up -d, so that the containers are built and waited long enough for all the peers to be ready.

So all you need to do is to change build_ubuntu to the code below (similarly for build_mac):

#!/bin/bash
cp ./binary_ubuntu/* .
export FABRIC_CFG_PATH=$PWD
sh ./ibm_fabric.sh
sh ./docker-images.sh
sleep 5
docker-compose up --no-start
sleep 60
docker-compose up -d

Network not found Issue

Symptoms: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 2 UNKNOWN: error starting container: API error (404): {"message":"network build-blockchain-insurance-app_default not found"}

The reason for the issue is that the network name cannot be found. To solve this, run docker network ls to figure out what the actual network name is, such as “buildblockchaininsuranceapp_default”. Go to ./peer-base.yaml and change CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE to the corresponding network name. Clean the docker containers with ./clean.sh and then rebuild the app again.

0reactions
d-jephcommented, Jan 19, 2019

Hello,

I am getting the following error when running the application:

> 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.
(node:21) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
    at /app/www/routers/shop.router.js:49:19
    at Generator.next (<anonymous>)
    at step (/app/bin/routers/shop.router.js:20:191)
    at /app/bin/routers/shop.router.js:20:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:21) 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:21) [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.
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
(node:21) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
    at /app/www/routers/shop.router.js:49:19
    at Generator.next (<anonymous>)
    at step (/app/bin/routers/shop.router.js:20:191)
    at /app/bin/routers/shop.router.js:20:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:21) 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: 2)
Successfully installed chaincode on the default channel.

I get no issues when running ./build_mac.sh.

The application just hangs after I ‘try to buy insurance for a bike’ on this step: https://github.com/IBM/build-blockchain-insurance-app/blob/master/images/Picture3.png

Docker version 18.03.1-ce, build 9ee9f40 docker-compose version 1.21.2, build a133471 npm 5.6.0 node v8.11.3 Python 2.7.13

I have tried multiple checkouts and reinstalling dependencies. I also get the same issue on Ubuntu 18.04.

@SirCipher how did you resolve this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while running - Support - Duplicati forum
This time it did run only correctly for two versions and today I got again this error message. I have no idea what...
Read more >
Error-while running locally - Mendix Forum
Hi, I get an error while I start my app to run locally. The console message is : An exception occured while running...
Read more >
Build error while running - Stack Overflow
It happens because sometime Test.exe keeps running even after you finish executing test. One solution is to kill Test.exe once your run is...
Read more >
Error while running job -' status = 99 (Not running)' - IBM Support
Error while running job -' status = 99 (Not running)' ... We are facing an issue when running a sequence comprising multiple instances...
Read more >
Getting an error while running export jobs - My Oracle Support
1. Login to OSC · 2. Navigate to FSM · 3. Search for Scheduled Export Process · 4. Create export process and select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found