Comments (27)
@masterDev1985, thanks for your answer. Yes, I did that (both taking down the service and the application, then redeploy again) with the same result when working within the web based platform. In the end, we replicated the process and it worked, but following the steps for the local installation. Best regards
from cp-web.
https://nodejs.org/api/util.html#util_util_isstring_object
According to this documentation, the isString method has been deprecated since NodeJS v4.0.0. @kamraanki what version of NodeJS are you using? You can check this using using the command node -v
. If you're using the latest Node version, then I suspect this function has been removed from the util
package. Let me know what you see.
from cp-web.
@masterDev1985 My node version is v0.10.46
Please let me know what is the possible solution, as my cp-web application is not building with this error
from cp-web.
I'am facing the below issue while building the application using the build command gulp:
- Tracking Deployment
I0926 11:22:39.402982483 938 ev_epoll_linux.c:84] epoll engine will be using signal: 36
D0926 11:22:39.403055826 938 ev_posix.c:106] Using polling engine: epoll
loading hardcoded peers
loading hardcoded users
calling network config
found cert us.blockchain.ibm.com
string
Successfully got WebAppAdmin member --->
WebAppAdmin
Failed to enroll WebAppAdmin member ---> Error: req.enrollmentSecret is not set
events.js:74
throw TypeError('Uncaught, unspecified "error" event.');
^
TypeError: Uncaught, unspecified "error" event.
at TypeError ()
at TransactionContext.emit (events.js:74:15)
at /root/cp-web/node_modules/hfc/lib/hfc.js:937:22
at /root/cp-web/node_modules/hfc/lib/hfc.js:1067:24
at Member.getNextTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:817:20)
at TransactionContext.getMyTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:1065:21)
at TransactionContext.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:934:14)
at Member.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:770:12)
at deploy (/root/cp-web/app.js:
I have made changes in /root/cp-web/node_modules/hfc/lib/hfc.js file for the util package, as it was giving error:
function Member(cfg, chain) {
this.tcertGetterMap = {};
/* if (util.isString(cfg)) {
this.name = cfg;
}
else if (util.isObject(cfg)) {
var req = cfg;
this.name = req.enrollmentID || req.name;
this.roles = req.roles || ['fabric.user'];
this.account = req.account;
this.affiliation = req.affiliation;
} */
console.log(typeof(cfg));
this.name = cfg;
this.chain = chain;
this.memberServices = chain.getMemberServices();
this.keyValStore = chain.getKeyValStore();
this.keyValStoreName = toKeyValStoreName(this.name);
this.tcertBatchSize = chain.getTCertBatchSize();
}
from cp-web.
I believe the "has no method isString" error is due to the fact that you are using a very old version of NodeJS. According to the docs I posted before, this function was added in NodeJS v0.11.5, so this error makes sense. I'd recommend updating NodeJS to whatever the latest 4.x.x version is (4.5.0 as I write this), delete the node_modules folder, reinstall the demo's dependencies with npm install
, and try to run the demo again by running gulp
.
from cp-web.
@masterDev1985
I have installed nodeJs version 4.5.0,
[root@localhost cp-web]# node -v
v4.5.0
But this gives below error, when building:
Running using Developer settings
- Tracking Deployment
I0927 15:57:57.653536561 17588 ev_epoll_linux.c:84] epoll engine will be using signal: 36
D0927 15:57:57.653608289 17588 ev_posix.c:106] Using polling engine: epoll
loading hardcoded peers
loading hardcoded users
calling network config
found cert us.blockchain.ibm.com
Successfully got WebAppAdmin member --->
WebAppAdmin
Failed to enroll WebAppAdmin member ---> Error: req.enrollmentSecret is not set
events.js:146
throw err;
^
Error: Uncaught, unspecified "error" event. ([object Object])
at TransactionContext.emit (events.js:144:17)
at /root/cp-web/node_modules/hfc/lib/hfc.js:932:22
at /root/cp-web/node_modules/hfc/lib/hfc.js:1062:24
at Member.getNextTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:812:20)
at TransactionContext.getMyTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:1060:21)
at TransactionContext.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:929:14)
at Member.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:765:12)
at deploy (/root/cp-web/app.js:289:32)
at /root/cp-web/app.js:275:17
at /root/cp-web/node_modules/hfc/lib/hfc.js:718:24
Please help!
from cp-web.
I can't seem to reproduce your error, @kamraanki . Have you made any changes to the app.js
file? The error states that the enrollmentSecret for your request is not set, so I would imagine that your credentials file doesn't have a WebAppAdmin user with secret, or the secret is not being passed into WebAppAdmin.enroll(pwd, cb)
properly.
from cp-web.
my mycreds.json file is as follow:
{
"credentials": {
"peers": [
{
"discovery_host": "172.17.0.2",
"discovery_port": 30303,
"api_host": "172.17.0.2",
"api_port_tls": 443,
"api_port": 80,
"type": "peer",
"id": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_vp1",
"api_url": "http://172.17.0.2:80"
},
{
"discovery_host": "172.17.0.3",
"discovery_port": 30303,
"api_host": "172.17.0.3",
"api_port_tls": 443,
"api_port": 80,
"type": "peer",
"id": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_vp2",
"api_url": "http://172.17.0.3:80"
}
],
"ca": {
"7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca": {
"url": "grpc://172.17.0.1:50051",
"discovery_host": "172.17.0.1",
"discovery_port": 50051,
"api_host": "172.17.0.1",
"api_port_tls": 443,
"api_port": 5000,
"type": "ca"
}
},
"users": [
{
"username": "WebAppAdmin",
"secret": "DJY27pEnl16d",
"enrollId": "WebAppAdmin",
"enrollSecret": "DJY27pEnl16d"
},
{
"username": "user_type1_lukas",
"secret": "NPKYL39uKbkj",
"enrollId": "user_type1_lukas",
"enrollSecret": "NPKYL39uKbkj"
},
{
"username": "user_type1_diego",
"secret": "DRJ23pEQl16a",
"enrollId": "user_type1_diego",
"enrollSecret": "DRJ23pEQl16a"
}
]
}
}
When i build the application now I get the following error:
Running using Developer settings
- Tracking Deployment
I0929 12:29:22.025100958 11964 ev_epoll_linux.c:84] epoll engine will be using signal: 36
D0929 12:29:22.025174106 11964 ev_posix.c:106] Using polling engine: epoll
loading hardcoded peers
loading hardcoded users
calling network config
found cert us.blockchain.ibm.com
Successfully got WebAppAdmin member --->
WebAppAdmin
DJY27pEnl16d
D0929 12:29:22.436751226 11974 dns_resolver.c:192] dns resolution failed: {"created":"@1475132362.436724328","description":"OS Error","errno":-2,"file":"../src/core/lib/iomgr/resolve_address_posix.c","file_line":115,"os_error":"Name or service not known","syscall":"getaddrinfo","target_address":"grpc"}
D0929 12:29:22.436772312 11974 dns_resolver.c:201] retrying immediately
D0929 12:29:23.448790855 11975 dns_resolver.c:192] dns resolution failed: {"created":"@1475132363.448772879","description":"OS Error","errno":-2,"file":"../src/core/lib/iomgr/resolve_address_posix.c","file_line":115,"os_error":"Name or service not known","syscall":"getaddrinfo","target_address":"grpc"}
D0929 12:29:23.448809249 11975 dns_resolver.c:201] retrying immediately
D0929 12:29:25.034392484 11976 dns_resolver.c:192] dns resolution failed: {"created":"@1475132365.034322382","description":"OS Error","errno":-2,"file":"../src/core/lib/iomgr/resolve_address_posix.c","file_line":115,"os_error":"Name or service not known","syscall":"getaddrinfo","target_address":"grpc"}
D0929 12:29:25.034452191 11976 dns_resolver.c:201] retrying immediately
What is the dns issue here?
from cp-web.
According to the error you posted, the dns request is failing to resolve the IP address for the target 'grpc'. This is because you have 'grpc://' in your ca.url field. See the example credentials file below:
https://github.com/IBM-Blockchain/cp-web/blob/master/mycreds.json#L55
Yours:
"url": "grpc://172.17.0.1:50051",
The Example's:
"url": "4430e939-dd99-4ab3-9f86-daee4218fa6e_ca.us.blockchain.ibm.com:30303",
from cp-web.
@masterDev1985
I am not able to resolve this issue:
I have not done development env setup. I am just setting up this application on my local setup
So this is my docker-compose.yml file which starts the CA as well as bind VP0 with it as per the documentation:
vp0:
image: hyperledger/fabric-peer
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=http://172.17.0.1:2375
- CORE_LOGGING_LEVEL=DEBUG
command: peer node start
vp1:
extends:
service: vp0
environment:
- CORE_PEER_ID=vp1
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
links:
- vp0
Then i run this file usinf docker-compose up and i get the following on terminal:
Starting 0b17352fc95e_0b17352fc95e_0b17352fc95e_shambhavi_membersrvc_1
Starting shambhavi_vp0_1
Attaching to 0b17352fc95e_0b17352fc95e_0b17352fc95e_shambhavi_membersrvc_1, shambhavi_vp0_1
vp0_1 | 06:38:43.570 [logging] LoggingInit -> DEBU 001 Setting default logging level to DEBUG for command 'node'
vp0_1 | 06:38:43.570 [peer] func1 -> INFO 002 Auto detected peer address: 172.17.0.3:7051
vp0_1 | 06:38:43.571 [peer] func1 -> INFO 003 Auto detected peer address: 172.17.0.3:7051
vp0_1 | 06:38:43.572 [eventhub_producer] AddEventType -> DEBU 004 registering BLOCK
vp0_1 | 06:38:43.572 [eventhub_producer] AddEventType -> DEBU 005 registering CHAINCODE
vp0_1 | 06:38:43.572 [eventhub_producer] AddEventType -> DEBU 006 registering REJECTION
vp0_1 | 06:38:43.572 [eventhub_producer] AddEventType -> DEBU 007 registering REGISTER
vp0_1 | 06:38:43.572 [nodeCmd] serve -> INFO 008 Security enabled status: false
vp0_1 | 06:38:43.572 [nodeCmd] serve -> INFO 009 Privacy enabled status: false
vp0_1 | 06:38:43.574 [eventhub_producer] start -> INFO 00a event processor started
vp0_1 | 06:38:43.574 [db] open -> DEBU 00b Is db path [/var/hyperledger/production/db] empty [false]
vp0_1 | 06:38:43.874 [chaincode] NewChaincodeSupport -> INFO 00c Chaincode support using peerAddress: 172.17.0.3:7051
vp0_1 | 06:38:43.874 [chaincode] NewChaincodeSupport -> DEBU 00d Turn off keepalive(value 0)
vp0_1 | 06:38:43.874 [sysccapi] RegisterSysCC -> INFO 00e system chaincode (noop,github.com/hyperledger/fabric/bddtests/syschaincode/noop) disabled
vp0_1 | 06:38:43.875 [nodeCmd] serve -> DEBU 00f Running as validating peer - making genesis block if needed
vp0_1 | 06:38:43.875 [state] loadConfig -> INFO 010 Loading configurations...
vp0_1 | 06:38:43.875 [state] loadConfig -> INFO 011 Configurations loaded. stateImplName=[buckettree], stateImplConfigs=map[bucketCacheSize:%!s(int=100) numBuckets:%!s(int=1000003) maxGroupingAtEachLevel:%!s(int=5)], deltaHistorySize=[500]
vp0_1 | 06:38:43.875 [state] NewState -> INFO 012 Initializing state implementation [buckettree]
vp0_1 | 06:38:43.875 [buckettree] initConfig -> INFO 013 configs passed during initialization = map[string]interface {}{"numBuckets":1000003, "maxGroupingAtEachLevel":5, "bucketCacheSize":100}
vp0_1 | 06:38:43.875 [buckettree] initConfig -> INFO 014 Initializing bucket tree state implemetation with configurations &{maxGroupingAtEachLevel:5 lowestLevel:9 levelToNumBucketsMap:map[0:1 9:1000003 8:200001 3:65 5:1601 7:40001 1:3 6:8001 4:321 2:13] hashFunc:0xab4560}
vp0_1 | 06:38:43.876 [buckettree] newBucketCache -> INFO 015 Constructing bucket-cache with max bucket cache size = [100] MBs
vp0_1 | 06:38:43.876 [buckettree] loadAllBucketNodesFromDB -> INFO 016 Loaded buckets data in cache. Total buckets in DB = [0]. Total cache size:=0
vp0_1 | 06:38:43.876 [nodeCmd] serve -> DEBU 017 Running as validating peer - installing consensus
vp0_1 | 06:38:43.876 [peer] initDiscovery -> DEBU 018 Retrieved discovery list from disk: [172.17.0.4:7051]
vp0_1 | 06:38:43.876 [consensus/controller] NewConsenter -> INFO 019 Creating default consensus plugin (noops)
vp0_1 | 06:38:43.876 [consensus/noops] newNoops -> DEBU 01a Creating a NOOPS object
vp0_1 | 06:38:43.877 [consensus/noops] newNoops -> INFO 01b NOOPS consensus type = *noops.Noops
vp0_1 | 06:38:43.877 [consensus/noops] newNoops -> INFO 01c NOOPS block size = 500
vp0_1 | 06:38:43.877 [consensus/noops] newNoops -> INFO 01d NOOPS block wait = 1s
vp0_1 | 06:38:43.877 [nodeCmd] serve -> INFO 01e Starting peer with ID=name:"vp0" , network ID=dev, address=172.17.0.3:7051, rootnodes=, validator=true
vp0_1 | 06:38:43.879 [consensus/statetransfer] verifyAndRecoverBlockchain -> DEBU 01f Validating existing blockchain, highest validated block is 0, valid through 0
vp0_1 | 06:38:43.879 [consensus/statetransfer] blockThread -> INFO 020 Validated blockchain to the genesis block
vp0_1 | 06:38:43.879 [consensus/handler] 1 -> DEBU 021 Starting up message thread for consenter
vp0_1 | 06:38:43.879 [peer] ensureConnected -> DEBU 022 Starting Peer reconnect service (touch service), with period = 6s
vp0_1 | 06:38:43.879 [peer] chatWithPeer -> DEBU 023 Initiating Chat with peer address: 172.17.0.4:7051
vp0_1 | 06:38:43.880 [rest] StartOpenchainRESTServer -> INFO 024 Initializing the REST service on 0.0.0.0:7050, TLS is disabled.
vp0_1 | 06:38:43.884 [peer] chatWithPeer -> DEBU 025 Established Chat with peer address: 172.17.0.4:7051
vp0_1 | 06:38:43.884 [peer] handleChat -> DEBU 026 Current context deadline = 0001-01-01 00:00:00 +0000 UTC, ok = false
vp0_1 | 06:38:43.884 [peer] SendMessage -> DEBU 027 Sending message to stream of type: DISC_HELLO
vp0_1 | 06:38:43.885 [consensus/handler] HandleMessage -> DEBU 028 Did not handle message of type DISC_HELLO, passing on to next MessageHandler
vp0_1 | 06:38:43.885 [peer] HandleMessage -> DEBU 029 Handling Message of type: DISC_HELLO
vp0_1 | 06:38:43.885 [peer] beforeHello -> DEBU 02a Received DISC_HELLO, parsing out Peer identification
vp0_1 | 06:38:43.885 [peer] beforeHello -> DEBU 02b Received DISC_HELLO from endpoint=peerEndpoint:<ID:<name:"vp1" > address:"172.17.0.4:7051" type:VALIDATOR > blockchainInfo:<height:1 currentBlockHash:"F\271\335+\013\250\215\023#;?\353t>\353$?\315R\352b\270\033\202\265\014'dn\325v/\327]\304\335\330\300\362\000\313\005\001\235g\265\222\366\374\202\034IG\232\264\206@).\254\263\267\304\276" >
vp0_1 | 06:38:43.885 [peer] RegisterHandler -> DEBU 02c registered handler with key: name:"vp1"
vp0_1 | 06:38:43.885 [peer] enterState -> DEBU 02d The Peer's bi-directional stream to ID:<name:"vp1" > address:"172.17.0.4:7051" type:VALIDATOR is established, from event DISC_HELLO
vp0_1 | 06:38:43.885 [peer] start -> DEBU 02e Starting Peer discovery service
vp0_1 | 06:38:44.704 [peer] handleChat -> DEBU 02f Current context deadline = 0001-01-01 00:00:00 +0000 UTC, ok = false
vp0_1 | 06:38:44.707 [consensus/handler] HandleMessage -> DEBU 030 Did not handle message of type DISC_HELLO, passing on to next MessageHandler
vp0_1 | 06:38:44.707 [peer] HandleMessage -> DEBU 031 Handling Message of type: DISC_HELLO
vp0_1 | 06:38:44.707 [peer] beforeHello -> DEBU 032 Received DISC_HELLO, parsing out Peer identification
vp0_1 | 06:38:44.707 [peer] beforeHello -> DEBU 033 Received DISC_HELLO from endpoint=peerEndpoint:<ID:<name:"vp1" > address:"172.17.0.4:7051" type:VALIDATOR > blockchainInfo:<height:1 currentBlockHash:"F\271\335+\013\250\215\023#;?\353t>\353$?\315R\352b\270\033\202\265\014'dn\325v/\327]\304\335\330\300\362\000\313\005\001\235g\265\222\366\374\202\034IG\232\264\206@).\254\263\267\304\276" >
vp0_1 | 06:38:44.707 [peer] beforeHello -> DEBU 034 Received DISC_HELLO, sending back DISC_HELLO
vp0_1 | 06:38:44.707 [peer] SendMessage -> DEBU 035 Sending message to stream of type: DISC_HELLO
vp0_1 | 06:38:44.708 [peer] handleChat -> ERRO 036 Error handling message: Peer FSM failed while handling message (DISC_HELLO): current state: created, error: transition canceled with error: Error registering Handler: Duplicate Handler error: {name:"vp1" 172.17.0.4:7051 VALIDATOR }
vp0_1 | 06:38:48.886 [peer] SendMessage -> DEBU 037 Sending message to stream of type: DISC_GET_PEERS
vp0_1 | 06:38:48.886 [consensus/handler] HandleMessage -> DEBU 038 Did not handle message of type DISC_GET_PEERS, passing on to next MessageHandler
vp0_1 | 06:38:48.886 [peer] HandleMessage -> DEBU 039 Handling Message of type: DISC_GET_PEERS
vp0_1 | 06:38:48.886 [peer] beforeGetPeers -> DEBU 03a Sending back DISC_PEERS
vp0_1 | 06:38:48.886 [peer] SendMessage -> DEBU 03b Sending message to stream of type: DISC_PEERS
vp0_1 | 06:38:48.887 [consensus/handler] HandleMessage -> DEBU 03c Did not handle message of type DISC_PEERS, passing on to next MessageHandler
vp0_1 | 06:38:48.887 [peer] HandleMessage -> DEBU 03d Handling Message of type: DISC_PEERS
vp0_1 | 06:38:48.887 [peer] beforePeers -> DEBU 03e Received DISC_PEERS, grabbing peers message
vp0_1 | 06:38:48.887 [peer] beforePeers -> DEBU 03f Received PeersMessage with Peers: peers:<ID:<name:"vp0" > address:"172.17.0.3:7051" type:VALIDATOR >
vp0_1 | 06:38:49.879 [peer] ensureConnected -> DEBU 040 Touch service indicates no dropped connections
vp0_1 | 06:38:49.880 [peer] ensureConnected -> DEBU 041 Connected to: [172.17.0.4:7051]
vp0_1 | 06:38:49.880 [peer] ensureConnected -> DEBU 042 Discovery knows about: [172.17.0.4:7051]
I have on other terminal run this command to start my VP1:
docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.3:7051 hyperledger/fabric-peer peer node start
Since VP0 is running on IP: 172.17.0.3, so i have given this IP in the above command as CORE_PEER_DISCOVERY_ROOTNODE
Hence we can see that VP0(172.17.0.3) is chatting with VP1(172.17.0.4) in the o/p docker-compose up
Now, mycreds,json file is as follows:
{
"credentials": {
"peers": [
{
"discovery_host": "172.17.0.3",
"discovery_port": 7051,
"api_host": "172.17.0.3",
"api_port_tls": 7050,
"api_port": 7050,
"type": "peer",
"id": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_vp0",
"api_url": "http://172.17.0.3:7050"
},
{
"discovery_host": "172.17.0.4",
"discovery_port": 7051,
"api_host": "172.17.0.4",
"api_port_tls": 7050,
"api_port": 7050,
"type": "peer",
"id": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_vp1",
"api_url": "http://172.17.0.4:7050"
}
],
"ca": {
"7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca":{
"url": "grpc://172.17.0.1:50051",
"discovery_host": "172.17.0.1",
"discovery_port": 7051,
"api_host": "172.17.0.1",
"api_port_tls": 7050,
"api_port": 7050,
"type": "ca"
}
},
"users": [
{
"username": "WebAppAdmin",
"secret": "DJY27pEnl16d",
"enrollId": "WebAppAdmin",
"enrollSecret": "DJY27pEnl16d"
},
{
"username": "user_type1_lukas",
"secret": "NPKYL39uKbkj",
"enrollId": "user_type1_lukas",
"enrollSecret": "NPKYL39uKbkj"
},
{
"username": "user_type1_diego",
"secret": "DRJ23pEQl16a",
"enrollId": "user_type1_diego",
"enrollSecret": "DRJ23pEQl16a"
}
]
}
}
When I build using gulp i get the following error:
Running using Developer settings
- Tracking Deployment
I0930 12:04:44.908823619 29649 ev_epoll_linux.c:84] epoll engine will be using signal: 36
D0930 12:04:44.908894558 29649 ev_posix.c:106] Using polling engine: epoll
loading hardcoded peers
loading hardcoded users
calling network config
found cert us.blockchain.ibm.com
Successfully got WebAppAdmin member --->
WebAppAdmin
DJY27pEnl16d
D0930 12:04:45.305055286 29659 dns_resolver.c:192] dns resolution failed: {"created":"@1475217285.305025373","description":"OS Error","errno":-2,"file":"../src/core/lib/iomgr/resolve_address_posix.c","file_line":115,"os_error":"Name or service not known","syscall":"getaddrinfo","target_address":"grpc"}
D0930 12:04:45.305078987 29659 dns_resolver.c:201] retrying immediately
D0930 12:04:46.327295713 29660 dns_resolver.c:192] dns resolution failed: {"created":"@1475217286.327227731","description":"OS Error","errno":-2,"file":"../src/core/lib/iomgr/resolve_address_posix.c","file_line":115,"os_error":"Name or service not known","syscall":"getaddrinfo","target_address":"grpc"}
D0930 12:04:46.327356413 29660 dns_resolver.c:201] retrying immediately
^C
Please help!
from cp-web.
@masterDev1985
Now I changed my mycreds.json file as per the solution provided by you, So here is mycreds.json file:
{
"credentials": {
"peers": [
{
"discovery_host": "172.17.0.3",
"discovery_port": 7051,
"api_host": "172.17.0.3",
"api_port_tls": 7050,
"api_port": 7050,
"type": "peer",
"id": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_vp0",
"api_url": "http://172.17.0.3:7050"
},
{
"discovery_host": "172.17.0.4",
"discovery_port": 7051,
"api_host": "172.17.0.4",
"api_port_tls": 7050,
"api_port": 7050,
"type": "peer",
"id": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_vp1",
"api_url": "http://172.17.0.4:7050"
}
],
"ca": {
"7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca":{
"url": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca.us.blockchain.ibm.com:50051",
"discovery_host": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca.us.blockchain.ibm.com",
"discovery_port": 7051,
"api_host": "7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca.us.blockchain.ibm.com",
"api_port_tls": 7050,
"api_port": 7050,
"type": "ca"
}
},
"users": [
{
"username": "WebAppAdmin",
"secret": "DJY27pEnl16d",
"enrollId": "WebAppAdmin",
"enrollSecret": "DJY27pEnl16d"
},
{
"username": "user_type1_lukas",
"secret": "NPKYL39uKbkj",
"enrollId": "user_type1_lukas",
"enrollSecret": "NPKYL39uKbkj"
},
{
"username": "user_type1_diego",
"secret": "DRJ23pEQl16a",
"enrollId": "user_type1_diego",
"enrollSecret": "DRJ23pEQl16a"
}
]
}
}
So now i face this issue:
Successfully got WebAppAdmin member --->
WebAppAdmin
DJY27pEnl16d
I0930 16:49:01.082888919 32750 subchannel.c:642] Connect failed: {"created":"@1475234341.082803718","description":"Failed to connect to remote host","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948,"os_error":"Timeout occurred","target_address":"ipv4:169.46.12.196:50051"}
I0930 16:49:01.082928042 32750 subchannel.c:645] Retry immediately
I0930 16:49:01.082942595 32750 subchannel.c:609] Failed to connect to channel, retrying
Failed to enroll WebAppAdmin member ---> Error
events.js:146
throw err;
^
Error: Uncaught, unspecified "error" event. ([object Object])
at TransactionContext.emit (events.js:144:17)
at /root/cp-web/node_modules/hfc/lib/hfc.js:932:22
at /root/cp-web/node_modules/hfc/lib/hfc.js:1062:24
at Member.getNextTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:812:20)
at TransactionContext.getMyTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:1060:21)
at TransactionContext.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:929:14)
at Member.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:765:12)
at deploy (/root/cp-web/app.js:289:32)
at /root/cp-web/app.js:275:17
at /root/cp-web/node_modules/hfc/lib/hfc.js:718:24
I am facing difficulty resolving this
from cp-web.
I should have been clearer, @kamraanki . My mistake. You were only supposed to remove the grpc://
header from the ca url.
Change from this:
"url": "grpc://172.17.0.1:50051",
to this:
"url": "172.17.0.1:50051",
from cp-web.
@masterDev1985
I made all the possible changes in mycreds.json file but still gives this below issue:
- Tracking Deployment
I1003 09:48:37.921408111 5089 ev_epoll_linux.c:84] epoll engine will be using signal: 36
D1003 09:48:37.921485157 5089 ev_posix.c:106] Using polling engine: epoll
loading hardcoded peers
loading hardcoded users
calling network config
found cert us.blockchain.ibm.com
Successfully got WebAppAdmin member --->
WebAppAdmin
DJY27pEnl16d
I1003 09:48:38.317286088 5096 subchannel.c:642] Connect failed: {"created":"@1475468318.317261182","description":"Failed to connect to remote host","errno":2,"file":"../src/core/lib/iomgr/error.c","file_line":256,"os_error":"Connection refused","target_address":"ipv4:172.17.0.1:50051"}
I1003 09:48:38.317309162 5096 subchannel.c:647] Retry in 0.999696759 seconds
Failed to enroll WebAppAdmin member ---> Error
events.js:146
throw err;
^
Error: Uncaught, unspecified "error" event. ([object Object])
at TransactionContext.emit (events.js:144:17)
at /root/cp-web/node_modules/hfc/lib/hfc.js:932:22
at /root/cp-web/node_modules/hfc/lib/hfc.js:1062:24
at Member.getNextTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:812:20)
at TransactionContext.getMyTCert (/root/cp-web/node_modules/hfc/lib/hfc.js:1060:21)
at TransactionContext.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:929:14)
at Member.deploy (/root/cp-web/node_modules/hfc/lib/hfc.js:765:12)
at deploy (/root/cp-web/app.js:289:32)
at /root/cp-web/app.js:275:17
at /root/cp-web/node_modules/hfc/lib/hfc.js:718:24
My mycreds.json file is as follows:
{
"credentials": {
"peers": [
{
"discovery_host": "172.17.0.3",
"discovery_port": 7051,
"api_host": "172.17.0.3",
"api_port_tls": 7050,
"api_port": 7050,
"type": "peer",
"id": "vp0",
"api_url": "http://172.17.0.3:7050"
},
{
"discovery_host": "172.17.0.4",
"discovery_port": 7051,
"api_host": "172.17.0.4",
"api_port_tls": 7050,
"api_port": 7050,
"type": "peer",
"id": "vp1",
"api_url": "http://172.17.0.4:7050"
}
],
"ca": {
"7c405ae6-1abb-45b0-8a82-65dda55ffaef_ca":{
"url": "172.17.0.1:50051",
"discovery_host": "172.17.0.1",
"discovery_port": 7051,
"api_host": "172.17.0.1",
"api_port_tls": 7050,
"api_port": 7050,
"type": "ca"
}
},
"users": [
{
"username": "WebAppAdmin",
"secret": "DJY27pEnl16d",
"enrollId": "WebAppAdmin",
"enrollSecret": "DJY27pEnl16d"
},
{
"username": "user_type1_lukas",
"secret": "NPKYL39uKbkj",
"enrollId": "user_type1_lukas",
"enrollSecret": "NPKYL39uKbkj"
},
{
"username": "user_type1_diego",
"secret": "DRJ23pEQl16a",
"enrollId": "user_type1_diego",
"enrollSecret": "DRJ23pEQl16a"
}
]
}
}
from cp-web.
@kamraanki The CA should only be using one port, but I see that 7050, 7051, and 50051 are all ports listed for your CA. The url parameter is used by this program, so that is the only port that really matters. Could you make sure that port 50051 is really the port that the CA container is listening on? The command docker ps
should show any running containers and what ports they are using.
I think this has come up in past issues, but I'd like to verify what environment you are using for this local setup? Are these peers running in a vagrant VM environment on a Windows host?
from cp-web.
I have a docker running on PORTS (7051-7053) and my container's host name is vp1.
I am using the following credentials file
{
"credentials": {
"peers": [{
"discovery_host": "vp1",
"discovery_port": 7050,
"api_host": "vp1",
"api_port": 7050,
"type": "peer",
"id": "_vp1",
"api_url": "http://vp1:7050"
}],
"ca": [{
"discovery_host": "vp1",
"discovery_port": 7050,
"api_host": "vp1",
"api_port": 8080,
"type": "peer",
"id": "_vp1",
"api_url": "http://vp1:7051"
}],
"users": [{
"username": "admin",
"secret": "5319da09bd",
"enrollId": "admin",
"enrollSecret": "5319da09bd"
},
{
"username": "WebAppAdmin",
"secret": "30b4dd36a9",
"enrollId": "WebAppAdmin",
"enrollSecret": "30b4dd36a9"
}],
"cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
}
}
But my connection fails with message:-
D1006 16:21:19.066202643 8159 dns_resolver.c:192] dns resolution failed: {"created":"@1475770879.066156056","description":"OS Error","errno":-2,"file":"../src/core/lib/iomgr/resolve_address_posix.c","file_line":115,"os_error":"Name or service not known","syscall":"getaddrinfo","target_address":"undefined"}
Seeking your help on understanding/resolving this.
from cp-web.
The following credentials file resolved that issue but am still not through
{
"credentials": {
"peers": [{
"discovery_host": "vp1",
"discovery_port": 55520,
"api_host": "vp1",
"api_port": 55520,
"type": "peer",
"id": "_vp1",
"api_url": "http://vp1:55520"
}],
"ca": [{
"discovery_host": "vp1",
"discovery_port": 7050,
"api_host": "vp1",
"api_port": 7050,
"type": "peer",
"id": "_vp1",
"url": "vp1:7050",
"api_url": "http://vp1:7050"
}],
"users": [{
"username": "admin",
"secret": "5319da09bd",
"enrollId": "admin",
"enrollSecret": "5319da09bd"
},
{
"username": "WebAppAdmin",
"secret": "30b4dd36a9",
"enrollId": "WebAppAdmin",
"enrollSecret": "30b4dd36a9"
}],
"cert": "https://blockchain-certs.mybluemix.net/us.blockchain.ibm.com.cert"
}
}
E1006 20:14:52.802371442 8365 ssl_transport_security.c:945] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number.
E1006 20:14:52.802410194 8365 handshake.c:128] Security handshake failed: {"created":"@1475784892.802393731","description":"Handshake failed","file":"../src/core/lib/security/transport/handshake.c","file_line":264,"tsi_code":10,"tsi_error":"TSI_PROTOCOL_FAILURE"}
E1006 20:14:52.802447530 8365 secure_channel_create.c:98] Secure handshake failed with error 1.
I1006 20:14:52.802472975 8365 subchannel.c:642] Connect failed: null
I1006 20:14:52.802479230 8365 subchannel.c:647] Retry in 0.999325180 seconds
err = Error
Failed to enroll WebAppAdmin member ---> Error
events.js:74
throw TypeError('Uncaught, unspecified "error" event.');
^
TypeError: Uncaught, unspecified "error" event.
at TypeError ()
at TransactionContext.emit (events.js:74:15)
at /go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/node_modules/hfc/lib/hfc.js:934:22
at /go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/node_modules/hfc/lib/hfc.js:1064:24
at Member.getNextTCert (/go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/node_modules/hfc/lib/hfc.js:814:20)
at TransactionContext.getMyTCert (/go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/node_modules/hfc/lib/hfc.js:1062:21)
at TransactionContext.deploy (/go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/node_modules/hfc/lib/hfc.js:931:14)
at Member.deploy (/go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/node_modules/hfc/lib/hfc.js:767:12)
at deploy (/go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/app.js:304:32)
at /go/src/github.com/hyperledger/fabric/examples/chaincode/go/cp-web/app.js:290:17
NB- We are on an EC2 instance.
Would appreciate any clues.
from cp-web.
@masterDev1985
I am facing below issue while building cp-web application:
found cert us.blockchain.ibm.com
url.js:87
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
^
TypeError: Parameter "url" must be a string, not object
at Url.parse (url.js:87:11)
at Object.urlParse as parse
Please help!
Is this issue related to some npm package ?
from cp-web.
@bhaskarbanerjee I believe your issue is due to the fact that all of the peer connections in the CP demo use TLS. Notice how we configure the connection URLs to use grpcs://
:
caURL = "grpcs://" + ca[z].discovery_host + ":" + ca[z].discovery_port;
This "Wrong version" error can also be a sign that you are trying to establish a TLS connection with a non-TLS host. Try removing the 's' from the 'grpcs' URLs and see what happens.
@kamraanki I'm checking into some issues with cp-web running on Bluemix.
from cp-web.
@masterDev1985
Any update on the issue reported above?
from cp-web.
@kamraanki We discovered an issue with the proxies for the bluemix service that was intermittently preventing grpc requests from making it to peers and cas. That has been fixed, and I'm getting back to updating cp web to use a more reliable version of the hfc
module.
from cp-web.
@kamraanki Try the demo again. I've made some updates that restore the demo's functionality on Bluemix.
from cp-web.
Any updates @kamraanki ?
from cp-web.
Closing due to inactivity. Several large updates have been made to the demo since this issue was opened. Pull the latest version, try running it again, and reopen the issue if you're still having problems.
from cp-web.
Trying the latest version of app https://github.com/IBM-Blockchain/car-lease-demo
Deployment of app from the bluemix page https://console.ng.bluemix.net/docs/services/blockchain/ibmblockchain_tutorials.html#carlease works but any subsequent redeployment of the same app (locally cloned) using CLI results in the following message in the app logs.
Thereafter all admin/identity services fail and everything falls apart.
App/0ERROR Startup OUTPUT: "Failed to enroll registrar with WebAppAdmin 2dc560a51d"06 Dec 2016 | 11:28 AM
App/0ERROR Startup OUTPUT: {"code":2,"metadata":{"_internal_repr":{}}}06 Dec 2016 | 11:28 AM
App/0 at /home/vcap/app/node_modules/grpc/src/node/src/client.js:417:17 code: 2, metadata: Metadata { _internal_repr: {} } }06 Dec 2016 | 11:28 AM
App/0{ Error: Identity or token does not match.06 Dec 2016 | 11:28 AM
App/0ENTER GET blockchain/blocks INPUT: ""
Any clues?
from cp-web.
@bhaskarbanerjee When you enroll a user with the membership service using the SDK, the enrollment certificate for that user is downloaded from the membership service. This can only happen once. If you ran the application in bluemix, then the enrollment certificate was downloaded to that applications file system in bluemix, which gets wiped every time the application gets restarted. You're seeing this Identity or token does not match
error because the enrollment certificate has already been retrieved by a previous run of the application. I think you'll need to get a fresh network before you can continue.
from cp-web.
Hello,
I'm having similar issues here. Logged into Bluemix, first deployment of car-lease demo worked well, wanted to get another one up to play with the code a little bit and that one did not pass the 'Just finalizing setup, please wait...' stage, getting this error message:
App/0memory, and will not scale past a single process.21 de dic. de 2016 9:21:46
App/0designed for a production environment, as it will leak21 de dic. de 2016 9:21:46
App/0ERROR Startup OUTPUT: "Failed to enroll registrar with WebAppAdmin 1d32317040"21 de dic. de 2016 9:21:47
Deleted the second deployment, stopped the one that was working to modify that one, then re-launch and I get the same error. Could you clarify what 'get a fresh network' entails? It would be very much appreciated
from cp-web.
@Fraydel "getting a fresh network" just means creating a new instance of the blockchain service in Bluemix. This should give you a new set of peers and a new membership service where the WebAppAdmin user has not been previously enrolled.
When you restarted that first, working deployment of the car lease demo in Bluemix, the file system on the application was reset. This meant that the credentials that the app downloaded when it enrolled WebAppAdmin were lost. In this case, you will have to delete and redeploy the demo to get it working again.
from cp-web.
Related Issues (20)
- Failed to deploy chaincode: EventTransactionError HOT 4
- Callback already called
- Error building images: dial unix /var/run/docker.sock: connect: no such file or directory HOT 1
- -
- No live link to the demo. HOT 2
- Deploying cp-web with local version of hyperledger fabric HOT 19
- Failed to run demo using local network, Error: failed to enroll registrar: Identity or token does not match HOT 1
- Improve Documentation to Indicate that Commercial Paper Cannot be Redeployed HOT 1
- grpc: ClientConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp: address too many colons in address HOT 2
- Some Commercial Paper Operations from Demo Chaincode Tab Return Errors
- Logs Not getting printed in chaincode HOT 5
- Multi peer fails on local environment HOT 1
- Upgrade Deployment Tracker client dependency
- done
- Mutiple queries to display data sets by using fields other than the ID HOT 1
- Cannot read property 'prototype' of undefined HOT 6
- us.blockchain.ibm.com.cert failing to validate HOT 9
- How to setup hyperledger on different VMs to communicate with each other using nonvagrant on windows 10 platform HOT 1
- User level role access in hyperledger
- Deployment Tracker Service is discontinued HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cp-web.