xuehuiit / fabric-explorer

Fabric-explorer is a simple, powerful, maintainable, open source fabric explorer
http://www.blockchainbrother.com/
Apache License 2.0
123 stars 58 forks source link

x509: ECDSA verification failure #14

Open ercw opened 6 years ago

ercw commented 6 years ago

error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 error: [Channel.js]: Failed Query block. Error: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-08 09:05:29.591] [ERROR] Query - Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-08 09:05:29.591] [ERROR] blockscanner - TypeError: Cannot read property 'data' of undefined at EventEmitter. (/home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/listener/blocklistener.js:14:30) at emitOne (events.js:96:13) at EventEmitter.emit (events.js:188:7) at saveBlockRange (/home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/service/blockscanner.js:35:23) at next (native) at onFulfilled (/home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/co/index.js:65:19)

ercw commented 6 years ago

I am running the default settings with TLS disabled.

{ "host":"localhost", "port":"8080", "channelsList": ["mychannel"], "GOPATH":"../artifacts", "keyValueStore":"/tmp/fabric-client-kvs", "eventWaitTime":"30000", "enableTls":false, "users":[

yoyokeen commented 6 years ago

the same error come out and how to fix it?

robertfeng1980 commented 6 years ago

You can try update the code.

Then the config.json modify a property “enableTls” and set it value is true and try again

We suggest you can get the code from this url

https://github.com/hyperledger/blockchain-explorer https://github.com/hyperledger/blockchain-explorer

Thank you !

在 2017年9月9日,07:47,yoyokeen notifications@github.com 写道:

the same error come out and how to fix it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/onechain/fabric-explorer/issues/14#issuecomment-328238364, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8HeYc7_jErwaSvJEOps-ZHYOHuNM4Vks5sgdIBgaJpZM4PRYvi.

ercw commented 6 years ago

Ok, I was able to run fabric-docker-compose-svt with TLS (this is not the default mode) enabled by manually changing start.sh to provide a -s option for ./network_setup.sh and setting environmental variable ENABLE_TLS=true.

Then did as you suggested but now I'm getting this error instead:

Please open Internet explorer to access :http://localhost:8080/ [2017-09-09 11:46:26.646] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:26.649] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:26.658] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from chaincodes where channelname='mychannel' [2017-09-09 11:46:26.659] [DEBUG] mysqlservice - the getRowsBySQlCase select max(blocknum) as blocknum from blocks where channelname='mychannel' [2017-09-09 11:46:26.668] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from transaction where channelname='mychannel' [2017-09-09 11:46:26.669] [DEBUG] mysqlservice - the getRowsBySQlCase select max(blocknum) c from blocks where channelname='mychannel' E0909 11:46:26.718498588 94300 ssl_transport_security.c:921] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number. error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 error: [Client.js]: Failed Installed Chaincodes Query. Error: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.723] [ERROR] Query - Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.723] [DEBUG] blockscanner - Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 E0909 11:46:26.734817073 94300 ssl_transport_security.c:921] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number. error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 error: [Channel.js]: Failed Query channel info. Error: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.735] [ERROR] Query - Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.736] [DEBUG] Query - <<<<<<<<<< channel height >>>>>>>>> [2017-09-09 11:46:26.736] [ERROR] blockscanner - TypeError: Cannot read property 'low' of undefined at getChainInfo.then.response (/home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/app/query.js:242:32) [2017-09-09 11:46:27.651] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:27.652] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:27.652] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from chaincodes where channelname='mychannel'

robertfeng1980 commented 6 years ago

{ "host":"localhost", "port":"8080", "channelsList": ["mychannel"], "GOPATH":"../artifacts", "keyValueStore":"/tmp/fabric-client-kvs", "eventWaitTime":"30000", "enableTls":false, "users”:[

You can try modify property “enableTls” to true , then try Reboot fabric-explorer again!

Thank you!

在 2017年9月10日,02:52,ercw notifications@github.com 写道:

Ok, I was able to run fabric-docker-compose-svt with TLS (this is not the default mode) enabled by manually changing start.sh to provide a -s option for ./network_setup.sh and setting environmental variable ENABLE_TLS=true.

Then did as you suggested but now I'm getting this error instead:

Please open Internet explorer to access :http://localhost:8080/ [2017-09-09 11:46:26.646] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:26.649] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:26.658] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from chaincodes where channelname='mychannel' [2017-09-09 11:46:26.659] [DEBUG] mysqlservice - the getRowsBySQlCase select max(blocknum) as blocknum from blocks where channelname='mychannel' [2017-09-09 11:46:26.668] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from transaction where channelname='mychannel' [2017-09-09 11:46:26.669] [DEBUG] mysqlservice - the getRowsBySQlCase select max(blocknum) c from blocks where channelname='mychannel' E0909 11:46:26.718498588 94300 ssl_transport_security.c:921] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number. error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 error: [Client.js]: Failed Installed Chaincodes Query. Error: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.723] [ERROR] Query - Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.723] [DEBUG] blockscanner - Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 E0909 11:46:26.734817073 94300 ssl_transport_security.c:921] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number. error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 error: [Channel.js]: Failed Query channel info. Error: Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.735] [ERROR] Query - Error: Connect Failed at /home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-09-09 11:46:26.736] [DEBUG] Query - <<<<<<<<<< channel height >>>>>>>>> [2017-09-09 11:46:26.736] [ERROR] blockscanner - TypeError: Cannot read property 'low' of undefined at getChainInfo.then.response (/home/ercw/go/src/github.com/hyperledger/fabric/examples/fabric-docker-compose-svt/fabric-explorer/app/query.js:242:32) [2017-09-09 11:46:27.651] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:27.652] [DEBUG] metrics - [ 0, 0 ] [2017-09-09 11:46:27.652] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from chaincodes where channelname='mychannel'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/onechain/fabric-explorer/issues/14#issuecomment-328296581, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8HeaqOkleIBcYkcY_jwTsMFqIST80Mks5sgt5VgaJpZM4PRYvi.

ercw commented 6 years ago

The error above is with "enableTls":true

petonwu commented 6 years ago

Hi Gurus,

Currently,I hit the following errors in using fabric-explorer to another sample, it is FabCar(fabric1.0 sample).Could you please help check what the cause is? thanks!

[2017-10-11 16:21:09.722] [DEBUG] metrics - [ 0, 0 ] [2017-10-11 16:21:09.723] [DEBUG] metrics - [ 0, 0 ] [2017-10-11 16:21:09.723] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from chaincodes where channelname='mychannel' [2017-10-11 16:21:09.724] [DEBUG] mysqlservice - the getRowsBySQlCase select count(1) c from transaction where channelname='mychannel' [2017-10-11 16:21:09.724] [DEBUG] mysqlservice - the getRowsBySQlCase select max(blocknum) c from blocks where channelname='mychannel' [2017-10-11 16:21:09.889] [ERROR] Helper - =============Peer=peer1 error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /root/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 error: [Client.js]: Failed Installed Chaincodes Query. Error: Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /root/fabric-explorer/node_modules/grpc/src/node/src/client.js:554:15 [2017-10-11 16:21:09.897] [ERROR] Query - Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com") at /root/fabric-explorer/no ...

The config of network-config.json is as below: { "network-config": { "orderer": [{ "url": "grpc://127.0.0.1:7050", "server-hostname": "orderer0.example.com" } ], "org1": { "name": "peerOrg1", "mspid": "Org1MSP", "ca": "http://127.0.0.1:7054", "peer1": { "requests": "grpc://127.0.0.1:7051", "events": "grpc://127.0.0.1:7053", "server-hostname": "peer0.org1.example.com" }, "admin": { "key": "/artifacts/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore", "cert": "/artifacts/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts" } } } }

And the config.json is as below: { "host":"localhost", "port":"8080", "channelsList": ["mychannel"], "GOPATH":"../artifacts", "keyValueStore":"/tmp/fabric-client-kvs2", "eventWaitTime":"30000", "enableTls":false, "users":[ { "username":"admin", "secret":"adminpw" } ], "mysql":{ "host":"127.0.0.1", "database":"fabricexplorer", "port":"3306", "username":"root", "passwd":"" } }

csquan commented 6 years ago

I have run into same error,had you fixed?

du2016 commented 6 years ago

i have the same error too,

dj-rapidqube commented 6 years ago

try migrating your code to fabric samples v1.0.2 ..it was a bug in v1.0.. and run the code again...it would work..and do put tls to false in network config.

ashish235 commented 6 years ago

Same error with 1.0.5 also.. it works in somtimes.. and then when I regenerate the certs, i get the same errors again.

atif92 commented 6 years ago

same problem with 1.1 alfa

vanderthiel commented 6 years ago

Ok so I ran into this same problem and it cost me a couple of hours to figure out, for me this was caused by running generate.sh again to regenerate my artifacts, including the certificates. There is a setting in the docker-compose.yml for the ca.example.com service. It's called FABRIC_CA_SERVER_CA_KEYFILE and it must point to the newly generated certificate file name, since on regeneration the filename changed.

tk1993 commented 6 years ago

I have changed the FABRIC_CA_SERVER_CA_KEYFILE with the generated artifacts of ca but still got the same error

POST /api/v1/register 401 26 "Untrusted certificate: Failed to verify certificate: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.epo1.epo.com")"

tk1993 commented 6 years ago

Yeah I got the resolution There are 2 steps to resolve this : 1 Firstly update the FABRIC_CA_SERVER_CA_KEYFILE in docker-compose file with the key found in crypto-config/peerOrganizations/peer_name/ca/name_sk peer_name : for all peer organization you have defined in network name_sk : the key having extension _sk

2 Check your repository where you have put enrolled users certificate whether it contains certificates if yes then delete all certificates including admin certificates.Now try to enroll USERS

coderintherye commented 5 years ago

Another way this can happen is if the orderer container tries to start before the certificate authority container, you want to make sure that orderer.example.com has something like: depends_on: ca.example.com or in some other way ensure the orderer container starts after the CA