E1219 23:48:19.159391389 19 ssl_transport_security.cc:238] Could not get common name of subject from certificate.

Returned back from vacation to find this error when I try to run hyperledger fabric sample. It used to work just fine before I left on vacation. What gives?

WITSC02X6385JGH:fabric-ca sjain68$ docker logs -f dev-peer1-jnj-mycc-1.0

> chaincode@1.0.0 start /usr/local/src

> node chaincode.js "--peer.address" "peer1-jnj:7052"


E1219 23:48:19.159391389      19 ssl_transport_security.cc:238] Could not get common name of subject from certificate.

{ fcn: 'create', params: [ '00000' ] }

SyntaxError: Unexpected token  in JSON at position 0

    at JSON.parse ()

    at new ClientIdentity (/usr/local/src/node_modules/fabric-shim/lib/chaincode.js:246:27)

    at Chaincode.Invoke (/usr/local/src/chaincode.js:29:17)

Turns out there is some problem with v0.3.4 of X509 library that was released recently. Change dependencies to use 1.3.2 of fabric-shim and error should go away. 1.3.2 locks x509 version to 0.3.3. Writing this post to remind myself that the same code I wrote today may not work tomorrow. When that happens its usually a dependency problem – someone pulled the carpet from below my feet. So its better to always lock the versions of dependencies.

https://github.com/hyperledger/fabric-chaincode-node/commit/d74d08f7a1ff32ac9cf72c82c5bb61f01df93c74#diff-c8e210d41256bc31aa666a384b035418

Btw The actual error that is happening here is

SyntaxError: Unexpected token  in JSON at position 0     at JSON.parse ()     at new ClientIdentity (/usr/local/src/node_modules/fabric-shim/lib/chaincode.js:246:27)     at Chaincode.Invoke (/usr/local/src/chaincode.js:29:17)

The E1219 23:48:19.159391389 19 ssl_transport_security.cc:238] Could not get common name of subject from certificate happens with any chaincode. It happens when following command is run:

> node chaincode.js “–peer.address” “peer1-jnj:7052”

Advertisements
This entry was posted in Software. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s