DAML on Fabric issue

Hi DAML team,

I am trying to run DAML on fabric on my system, I am following the link :- GitHub - digital-asset/daml-on-fabric: Enabling DAML applications to run on Hyperledger Fabric

My system specs :-

docker-compose - docker-compose version 1.27.4, build 40524192
docker - Docker version 19.03.13, build 4484c46d9d
java - java version "11.0.9" 2020-10-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode)
DAML -   1.12.0  (default SDK version for new projects)
Fabric tools -  hyperledger/fabric-tools:2.2 

Now after generating the crypto material and starting fabric. I run the command -
sbt "run --port 6865 --role provision"

After this this error pops up

May 12, 2021 2:32:03 PM org.hyperledger.fabric.sdk.Channel sendProposalToPeers
SEVERE: Channel Channel{id: 15, name: } sending proposal with transaction 3c3695876ffa73a615a8a13c2bdbfc1f97f25e6b578599bf3de8eb17b3dca584 to Peer{ id: 2, name: peer0, channelName: mainchannel, url: grpcs://localhost:10051} failed because of timeout(60000 milliseconds) expiration
java.util.concurrent.TimeoutException
	at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1886)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2021)
	at org.hyperledger.fabric.sdk.Channel.sendProposalToPeers(Channel.java:4942)
	at org.hyperledger.fabric.sdk.Channel.sendLifecycleInstallProposal(Channel.java:3787)
	at org.hyperledger.fabric.sdk.HFClient.sendLifecycleInstallChaincodeRequest(HFClient.java:546)
	at com.daml.FabricContext.lifecycleInstallChaincode(FabricContext.java:313)
	at com.daml.FabricContext.runChannel(FabricContext.java:244)
	at com.daml.FabricContext.initNetworkConfiguration(FabricContext.java:169)
	at com.daml.FabricContext.<init>(FabricContext.java:103)
	at com.daml.DAMLKVConnector.<init>(DAMLKVConnector.java:74)
	at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
	at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:65)
	at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:48)
	at scala.Function0.apply$mcV$sp(Function0.scala:39)
	at scala.Function0.apply$mcV$sp$(Function0.scala:39)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
	at scala.App.$anonfun$main$1$adapted(App.scala:80)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.App.main(App.scala:80)
	at scala.App.main$(App.scala:78)
	at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:48)
	at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at sbt.Run.invokeMain(Run.scala:115)
	at sbt.Run.execute$1(Run.scala:79)
	at sbt.Run.$anonfun$runWithLoader$4(Run.scala:92)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
	at sbt.TrapExit$App.run(TrapExit.scala:257)
	at java.base/java.lang.Thread.run(Thread.java:834)

Caught an exception running Channel mainchannel
org.hyperledger.fabric.sdk.exception.ProposalException: Status of install proposal did not ret ok for Peer{ id: 2, name: peer0, channelName: mainchannel, url: grpcs://localhost:10051}, FAILURE 
	at org.hyperledger.fabric.sdk.LifecycleInstallChaincodeProposalResponse.getPackageId(LifecycleInstallChaincodeProposalResponse.java:36)
	at com.daml.FabricContext.lifecycleInstallChaincode(FabricContext.java:319)
	at com.daml.FabricContext.runChannel(FabricContext.java:244)
	at com.daml.FabricContext.initNetworkConfiguration(FabricContext.java:169)
	at com.daml.FabricContext.<init>(FabricContext.java:103)
	at com.daml.DAMLKVConnector.<init>(DAMLKVConnector.java:74)
	at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
	at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:65)
	at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:48)
	at scala.Function0.apply$mcV$sp(Function0.scala:39)
	at scala.Function0.apply$mcV$sp$(Function0.scala:39)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
	at scala.App.$anonfun$main$1$adapted(App.scala:80)
	at scala.collection.immutable.List.foreach(List.scala:392)
	at scala.App.main(App.scala:80)
	at scala.App.main$(App.scala:78)
	at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:48)
	at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at sbt.Run.invokeMain(Run.scala:115)
	at sbt.Run.execute$1(Run.scala:79)
	at sbt.Run.$anonfun$runWithLoader$4(Run.scala:92)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
	at sbt.TrapExit$App.run(TrapExit.scala:257)
	at java.base/java.lang.Thread.run(Thread.java:834)
Admin@org1.example.com private key: /home/user/Fabric/daml_on_fabric_new/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/priv_sk
Admin@org1.example.com sign cert: /home/user/Fabric/daml_on_fabric_new/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
Admin@org2.example.com private key: /home/user/Fabric/daml_on_fabric_new/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/priv_sk
Admin@org2.example.com sign cert: /home/user/Fabric/daml_on_fabric_new/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem
That's all folks!
Admin@org1.example.com private key: /home/user/Fabric/daml_on_fabric_new/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/priv_sk
Admin@org1.example.com sign cert: /home/user/Fabric/daml_on_fabric_new/daml-on-fabric/src/test/fixture/tmp/data/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem
[error] (run-main-0) com.daml.FabricContextException: response {
[error]   status: 500
[error]   message: "make sure the chaincode daml_on_fabric has been successfully defined on channel mainchannel and try again: chaincode daml_on_fabric not found"
[error] }
[error] com.daml.FabricContextException: response {
[error]   status: 500
[error]   message: "make sure the chaincode daml_on_fabric has been successfully defined on channel mainchannel and try again: chaincode daml_on_fabric not found"
[error] }
[error] 
[error] 	at com.daml.FabricContext.queryChaincode(FabricContext.java:578)
[error] 	at com.daml.FabricContext.queryChaincode(FabricContext.java:558)
[error] 	at com.daml.FabricContext.queryChaincode(FabricContext.java:554)
[error] 	at com.daml.DAMLKVConnector.getLedgerId(DAMLKVConnector.java:316)
[error] 	at com.daml.DAMLKVConnector.<init>(DAMLKVConnector.java:90)
[error] 	at com.daml.DAMLKVConnector.get(DAMLKVConnector.java:30)
[error] 	at com.daml.DamlOnFabricServer$.delayedEndpoint$com$daml$DamlOnFabricServer$1(DamlOnFabricServer.scala:65)
[error] 	at com.daml.DamlOnFabricServer$delayedInit$body.apply(DamlOnFabricServer.scala:48)
[error] 	at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error] 	at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error] 	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error] 	at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error] 	at scala.collection.immutable.List.foreach(List.scala:392)
[error] 	at scala.App.main(App.scala:80)
[error] 	at scala.App.main$(App.scala:78)
[error] 	at com.daml.DamlOnFabricServer$.main(DamlOnFabricServer.scala:48)
[error] 	at com.daml.DamlOnFabricServer.main(DamlOnFabricServer.scala)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
May 12, 2021 2:32:03 PM org.hyperledger.fabric.sdk.Channel getNextEvent
WARNING: java.lang.InterruptedException
May 12, 2021 2:32:03 PM org.hyperledger.fabric.sdk.Channel lambda$startEventQue$13
WARNING: GOT null block event.
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
[error] Total time: 87 s (01:27), completed 12-May-2021, 2:32:03 PM

I researched about this :- daml_on_fabric chaincode can not installed · Issue #31 · digital-asset/daml-on-fabric · GitHub
I am not using a mac system, I am using ubuntu 18.04 .

Please help, as this issue pops up frequently.

Thanks

1 Like

Can you specify what commands you ran prior to the provisioning? The timeout makes it seem as if a peer may not be running.

I run the shell files - ./gen.sh and ./restart_fabric.sh

And when I do a docker ps, I am able to see these containers -

CONTAINER ID        IMAGE                            COMMAND                  CREATED              STATUS              PORTS                                              NAMES

ce638a502519        hyperledger/fabric-peer:2.2      "peer node start"        About a minute ago   Up About a minute   0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp   damlonfabric_peer0.org1.example.com_1

9e6a23ff8f28        hyperledger/fabric-peer:2.2      "peer node start"        About a minute ago   Up About a minute   0.0.0.0:10056->7051/tcp, 0.0.0.0:10058->7053/tcp   damlonfabric_peer0.org2.example.com_1

77ec33d383e8        hyperledger/fabric-tools:2.2     "/usr/local/bin/conf…"   About a minute ago   Up About a minute   0.0.0.0:7059->7059/tcp                             damlonfabric_configtxlator_1

5c1cf1d02b52        hyperledger/fabric-orderer:2.2   "orderer"                About a minute ago   Up About a minute   0.0.0.0:10050->7050/tcp                            damlonfabric_orderer.example.com_1
1 Like

Hi DAML Team,

Any update on this.

1 Like

The current daml-on-fabric works with DAML SDK 1.10.0 but noticed you are using a newer version : may also be worth trying with your project explicitly set to DAML SDK 1.10.0

https://github.com/digital-asset/daml-on-fabric/README.md

1 Like

hi @Enthusiast-Block

Are you behind a corporate proxy ?
I had a very similar issue that is described over here

Root cause was proxy issue at the Docker layer of Hyperledger Fabric.
Up to this date I have not found a resolution

1 Like