0

I have fabric composer 0.72 installed on my mac, and I was able to follow this thread to get it connected to my Blockchain (v.61 of Fabric) on Bluemix.

fabric-composer-integration-with-bluemix-blockchain-service

Now I am trying to build an ubuntu (16.04) docker container and run composer-rest-server there. When I try to connect to my blockchain service from my docker container (using the same id, WebAppAdmin, that I used on my mac) I get an error:

Discovering types from business network definition ...
Connection fails: Error: Identity or token does not match.
It will be retried for the next request.
{ Error: Identity or token does not match.
     at /home/composer/.nvm/versions/node/v6.10.3/lib/node_modules  /composer-rest-server/node_modules/grpc/src/node/src/client.js:417:17 code: 2, metadata: Metadata { _internal_repr: {} } }

I tried copying the cert from my mac to my docker container:

/home/composer/.composer-credentials/member.WebAppAdmin

but when I did that I got a different error that says "signature does not verify". I did some additional testing, and I discovered that if I used an id that I had not previously used with composer (i.e. user_type1_0) then I could connect, and I could see a new cert in my .composer-credentials directory.

I tried deleting that container and building a new one (I dorked something else up) I could not use that same userid again.

Does anybody know how security and these certs are supposed to work? It would seem as though something to do with certificate generation/validation is tied to the client (i.e. hardware address), such that if I try to re-use an id on a different machine, the certs or keys or something don't match. I have a way to make things work, but it doesn't seem like it's the right way if I can't use the same id from different machines.

Thanks!

2 Answers2

0

I have also faced this issue, and concluded that

There is inconsistent behavior while deploying network using composer on Cloud environment includeing Bluemix. Problem is not with composer, but with fabric 0.6.

I am assuming that this issue is also indirectly related to following known bugs into fabric 0.6, which will not be fixed in fabric 0.6.

ERROR:

"

throw er; // Unhandled 'error' event ^

Error at ClientDuplexStream._emitStatusIfDone (/home/ubuntu/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:189:19) at ClientDuplexStream._readsDone (/home/ubuntu/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:158:8) at readCallback (/home/ubuntu/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:217:12)

"

So far, We have understood that following three JIRA are root cause , where essentially the cloud networking layer ends up killing the idle event hub connection after a period of inactivity and the fabric SDK cannot handle this.

https://jira.hyperledger.org/browse/FAB-4002 FAB-3310

https://jira.hyperledger.org/browse/FAB-3310

or FAB-2787

Conclusion:

  • There is no alternative way of fixing this issue with Bluemix or any cloud environment with fabric 0.6
  • You may not experience this issue with Fabric 1.0, but there is still possibilities as all above mentioned defects are not fixed yet.
deepak parmar
  • 691
  • 1
  • 6
  • 20
0

Hi i tried to recreate this by having blockchain running on a unix machine and then i copied my connection profile and certificate to my mac and then edited my connection profile to update the ip address and key store. I then did a composer network ping and it worked fine.

I am using composer v0.7.4 so you could try that?

Caroline Church
  • 203
  • 2
  • 8
  • I have since switched from using Fabric v0.61 to the alpha 1 release of v1.0.0, and I haven't run into this same issue. I can't say for sure that I have tried to use composer from two different machines yet, but I was able to do it using the official docker images. I did the deploy of my business network using composer (0.72) on my mac to fabric in a docker container, then used composer-rest-server in another docker container, so perhaps we can say it was limiited to v0.6.1. Thanks! - Dave – Dave Wakeman Jun 09 '17 at 02:46