0
votes

Composer v0.20.0

Fabric v1.2.1 (docker container)

node v8.15.0

MacOS

I'm running into an error when I try to use the composer network start command. I was following this tutorial: https://hyperledger.github.io/composer/v0.19/tutorials/deploy-to-fabric-single-org

Steps:

1)

cd ~/fabric-dev-servers
export FABRIC_VERSION=hlfv12
./stopFabric.sh
./teardownFabric.sh
./downloadFabric.sh
./startFabric.sh

If I run docker container ls:

CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                                            NAMES
64e6d6746649        hyperledger/fabric-peer:1.2.1       "peer node start"        31 seconds ago      Up 30 seconds       0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp   peer0.org1.example.com
f2ee3f2a68f7        hyperledger/fabric-couchdb:0.4.10   "tini -- /docker-ent…"   32 seconds ago      Up 31 seconds       4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp       couchdb
41e9a4987f6f        hyperledger/fabric-orderer:1.2.1    "orderer"                32 seconds ago      Up 31 seconds       0.0.0.0:7050->7050/tcp                           orderer.example.com
1673c6691baf        hyperledger/fabric-ca:1.2.1         "sh -c 'fabric-ca-se…"   32 seconds ago      Up 31 seconds       0.0.0.0:7054->7054/tcp                           ca.org1.example.com

Then I ran rm -fr ~/.composer

2)

composer card create -p connection.json -u PeerAdmin -c ~/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected] -k ~/fabric-dev-servers/fabric-scripts/hlfv12/composer/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk -r PeerAdmin -r ChannelAdmin

I got this back:

Successfully created business network card file to 
    Output file: [email protected]

Command succeeded

3)

composer card import -f [email protected]

I got this back:

Successfully imported business network card
    Card file: [email protected]
    Card name: PeerAdmin@mogvl-net

Command succeeded

4)

composer network install -c PeerAdmin@mogvl-net -a dist/mogvl-network.bna

I got this back:

✔ Installing business network. This may take a minute...
Successfully installed business network mogvl-network, version 0.2.6

Command succeeded

5)

composer network start --networkName mogvl-network --networkVersion 0.2.6 -A admin -S adminpw -c PeerAdmin@mogvl-net 

I got this error back:

Starting business network mogvl-network at version 0.2.6

Processing these Network Admins: 
    userName: admin

✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: failed to execute transaction 5de6713450900a4f1ac035bec47136a54c5ce5e03722700c0a85feef782ed738: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.6.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.

> [email protected] preinstall /chaincode/output/node_modules/node
> node installArchSpecificPackage

+ [email protected]
added 1 package in 2.904s

> [email protected] install /chaincode/output/node_modules/x509
> node-gyp rebuild

make: Entering directory '/chaincode/output/node_modules/x509/build'
  CXX(target) Release/obj.target/x509/src/addon.o
  CXX(target) Release/obj.target/x509/src/x509.o
../src/x509.cc: In function 'std::__cxx11::string parse_args(const Nan::FunctionCallbackInfo<v8::Value>&)':
../src/x509.cc:41:25: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   if (info[0]->ToString()->Length() == 0) {
                         ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
 Local<String> Value::ToString() const {
               ^
../src/x509.cc:46:45: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   return *Nan::Utf8String(info[0]->ToString());
                                             ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
 Local<String> Value::ToString() const {
               ^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE verify(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:55:64: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   std::string cert_path = *String::Utf8Value(info[0]->ToString());
                                                                ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
 Local<String> Value::ToString() const {
               ^
../src/x509.cc:55:65: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated: Use Isolate version [-Wdeprecated-declarations]
   std::string cert_path = *String::Utf8Value(info[0]->ToString());
                                                                 ^
In file included from /root/.node-gyp/11.10.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.10.0/include/node/node.h:63,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:2992:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/root/.node-gyp/11.10.0/include/node/v8config.h:326:3: note: in definition of macro 'V8_DEPRECATED'
   declarator __attribute__((deprecated(message)))
   ^
../src/x509.cc:56:67: warning: 'v8::Local<v8::String> v8::Value::ToString() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   std::string ca_bundlestr = *String::Utf8Value(info[1]->ToString());
                                                                   ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10248:15: note: declared here
 Local<String> Value::ToString() const {
               ^
../src/x509.cc:56:68: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' is deprecated: Use Isolate version [-Wdeprecated-declarations]
   std::string ca_bundlestr = *String::Utf8Value(info[1]->ToString());
                                                                    ^
In file included from /root/.node-gyp/11.10.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/11.10.0/include/node/node.h:63,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:2992:28: note: declared here
                   explicit Utf8Value(Local<v8::Value> obj));
                            ^
/root/.node-gyp/11.10.0/include/node/v8config.h:326:3: note: in definition of macro 'V8_DEPRECATED'
   declarator __attribute__((deprecated(message)))
   ^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE get_altnames(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:118:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   Local<Object> exports(try_parse(parsed_arg)->ToObject());
                                                         ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE get_subject(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:131:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   Local<Object> exports(try_parse(parsed_arg)->ToObject());
                                                         ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE get_issuer(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:144:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   Local<Object> exports(try_parse(parsed_arg)->ToObject());
                                                         ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/x509.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE parse_cert(Nan::NAN_METHOD_ARGS_TYPE)':
../src/x509.cc:157:57: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
   Local<Object> exports(try_parse(parsed_arg)->ToObject());
                                                         ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/x509.cc: In function 'v8::Local<v8::Value> try_parse(const string&)':
../src/x509.cc:398:38: warning: value computed is not used [-Wunused-value]
     BIO_set_close(ext_bio, BIO_CLOSE);
                                      ^
../src/x509.cc: In function 'v8::Local<v8::Value> parse_date(ASN1_TIME*)':
../src/x509.cc:462:75: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
     Nan::New<String>("Date").ToLocalChecked()).ToLocalChecked()->ToObject();
                                                                           ^
In file included from /root/.node-gyp/11.10.0/include/node/node.h:63:0,
                 from ../include/addon.h:4,
                 from ../include/x509.h:5,
                 from ../src/x509.cc:3:
/root/.node-gyp/11.10.0/include/node/v8.h:10254:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
  SOLINK_MODULE(target) Release/obj.target/x509.node
  COPY Release/x509.node
make: Leaving directory '/chaincode/output/node_modules/x509/build'

> [email protected] install /chaincode/output/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v67-linux-x64-glibc.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v67 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Pre-built binaries not installable for [email protected] and [email protected] (node-v67 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file 
make: Entering directory '/chaincode/output/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
make: Entering directory '/chaincode/output/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
rm: cannot remove './Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o.d.raw': No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o] Error 1
grpc.target.mk:388: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o' failed
make: Leaving directory '/chaincode/output/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/chaincode/output/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc"
gyp ERR! cwd /chaincode/output/node_modules/grpc
gyp ERR! node -v v11.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/chaincode/output/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/chaincode/output/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:984:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Linux 4.9.125-linuxkit
node-pre-gyp ERR! command "/chaincode/output/node_modules/node/bin/node" "/chaincode/output/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /chaincode/output/node_modules/grpc
node-pre-gyp ERR! node -v v11.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
Failed to execute '/chaincode/output/node_modules/node/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc' (1)
../deps/grpc/src/core/lib/backoff/backoff.cc:76:1: fatal error: opening dependency file ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o.d.raw: No such file or directory
compilation terminated.
grpc.target.mk:388: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o' failed
make: Leaving directory '/chaincode/output/node_modules/grpc/build'
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/chaincode/output/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/chaincode/output/node_modules/grpc/src/node/extension_binary/node-v67-linux-x64-glibc"
gyp ERR! cwd /chaincode/output/node_modules/grpc
gyp ERR! node -v v11.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN The package composer-common is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install 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/2019-02-22T21_16_38_589Z-debug.log
"
Command failed

I feel like I'm close and all it takes is a minor fix, but I'm not sure.

1

1 Answers

0
votes

Seems the problem is the npm version. When the chaincode container start for the first time, the peer node use npm install to download and install the dependencies of the smart contract inside the container (like fabric-shim). Try upgrating your npm version:

npm i npm@latest -g