在本教程中,我使用Docker为超级边缘作曲家业务网络设置了一个持久且安全的REST服务器:https://hyperledger.github.io/composer/integrating/deploying-the-rest-server.html
但是当我尝试在RESTful API上执行ping时,我收到以下错误:
{
"error": {
"statusCode": 500,
"name": "Error",
"message": "Error trying to ping. Error: Error trying to query business network. Error: Call dropped by load balancing policy",
"stack": "Error: Error trying to ping. Error: Error trying to query business network. Error: Call dropped by load balancing policy\n at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:713:34)\n at <anonymous>"
}
}
我的码头工人容器:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bc602ba11578 myorg/my-composer-rest-server "pm2-docker composer…" 15 minutes ago Up 16 minutes 192.168.0.4:3000->3000/tcp rest
36775102dbb0 mongo "docker-entrypoint.s…" 16 minutes ago Up 16 minutes 192.168.0.4:27017->27017/tcp mongo
e0de4ec135fa dev-peer0.org1.example.com-block-aviation-network-0.16.3-77a9550c9adb2621d28c3143c0fc904fa6a78013fef37bee1fdf4f2aeb8bf564 "chaincode -peer.add…" About an hour ago Up About an hour dev-peer0.org1.example.com-block-aviation-network-0.16.3
072f3da47cca hyperledger/fabric-peer:x86_64-1.0.4 "peer node start --p…" About an hour ago Up About an hour 192.168.0.4:7051->7051/tcp, 192.168.0.4:7053->7053/tcp peer0.org1.example.com
9534c540fa89 hyperledger/fabric-couchdb:x86_64-1.0.4 "tini -- /docker-ent…" About an hour ago Up About an hour 4369/tcp, 9100/tcp, 192.168.0.4:5984->5984/tcp couchdb
10ec1d267dee hyperledger/fabric-ca:x86_64-1.0.4 "sh -c 'fabric-ca-se…" About an hour ago Up About an hour 192.168.0.4:7054->7054/tcp ca.org1.example.com
85d19b25d5af hyperledger/fabric-orderer:x86_64-1.0.4 "orderer" About an hour ago Up About an hour 192.168.0.4:7050->7050/tcp
执行事务时REST服务器上的gRPC跟踪:
0|composer | at <anonymous>
0|composer | I0118 13:14:37.163475716 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: SEND_INITIAL_METADATA{key=3a 70 61 74 68 ':path' value=2f 70 72 6f 74 6f 73 2e 45 76 65 6e 74 73 2f 43 68 61 74 '/protos.Events/Chat', key=3a 61 75 74 68 6f 72 69 74 79 ':authority' value=31 39 32 2e 31 36 38 2e 30 2e 34 3a 37 30 35 33 '192.168.0.4:7053'} RECV_INITIAL_METADATA
0|composer | D0118 13:14:37.163524192 16 client_channel.c:1421] chand=0x559d8d8d6860 calld=0x559d8d8985a0: entering combiner
0|composer | D0118 13:14:37.163537485 16 client_channel.c:298] chand=0x559d8d8d6860: starting name resolution
0|composer | D0118 13:14:37.163556276 16 client_channel.c:1108] chand=0x559d8d8d6860 calld=0x559d8d8985a0: deferring pick pending resolver result
0|composer | I0118 13:14:37.163579364 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: RECV_TRAILING_METADATA
0|composer | D0118 13:14:37.163591158 16 client_channel.c:1421] chand=0x559d8d8d6860 calld=0x559d8d8985a0: entering combiner
0|composer | I0118 13:14:37.175539481 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: SEND_MESSAGE:flags=0x00000000:len=833
0|composer | D0118 13:14:37.175607947 16 client_channel.c:1421] chand=0x559d8d8d6860 calld=0x559d8d8985a0: entering combiner
0|composer | I0118 13:14:37.190371761 16 client_channel.c:1383] OP[client-channel:0x559d8d8f0040]: SEND_INITIAL_METADATA{key=3a 70 61 74 68 ':path' value=2f 70 72 6f 74 6f 73 2e 45 6e 64 6f 72 73 65 72 2f 50 72 6f 63 65 73 73 50 72 6f 70 6f 73 61 6c '/protos.Endorser/ProcessProposal', key=3a 61 75 74 68 6f 72 69 74 79 ':authority' value=31 39 32 2e 31 36 38 2e 30 2e 34 3a 37 30 35 31 '192.168.0.4:7051'} SEND_MESSAGE:flags=0x00000000:len=1033 SEND_TRAILING_METADATA{} RECV_INITIAL_METADATA RECV_MESSAGE RECV_TRAILING_METADATA
0|composer | D0118 13:14:37.190481906 16 client_channel.c:1421] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: entering combiner
0|composer | D0118 13:14:37.190531681 16 client_channel.c:298] chand=0x559d8d8d29e0: starting name resolution
0|composer | D0118 13:14:37.190573660 16 client_channel.c:1108] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: deferring pick pending resolver result
0|composer | I0118 13:14:37.190743276 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: RECV_MESSAGE
0|composer | D0118 13:14:37.190768963 16 client_channel.c:1421] chand=0x559d8d8d6860 calld=0x559d8d8985a0: entering combiner
0|composer | D0118 13:14:37.190887403 16 client_channel.c:370] chand=0x559d8d8d6860: got resolver result: error="No Error"
0|composer | D0118 13:14:37.190906094 16 pick_first.c:687] Pick First 0x559d8d8d33a0 created.
0|composer | I0118 13:14:37.190918988 16 pick_first.c:335] Pick First 0x559d8d8d33a0 received update with 1 addresses
0|composer | I0118 13:14:37.190949872 16 pick_first.c:416] Pick First 0x559d8d8d33a0 created subchannel 0x559d8d6e6880 for address uri ipv4:192.168.0.4:7053
0|composer | D0118 13:14:37.190965564 16 client_channel.c:477] chand=0x559d8d8d6860: resolver result: lb_policy_name="pick_first" (changed), service_config="(null)"
0|composer | D0118 13:14:37.190980957 16 client_channel.c:559] chand=0x559d8d8d6860: initializing new LB policy
0|composer | D0118 13:14:37.191000247 16 client_channel.c:248] chand=0x559d8d8d6860: setting connectivity state to IDLE
0|composer | D0118 13:14:37.191013141 16 client_channel.c:1092] chand=0x559d8d8d6860 calld=0x559d8d8985a0: resolver returned, doing pick
0|composer | D0118 13:14:37.191023036 16 client_channel.c:940] chand=0x559d8d8d6860 calld=0x559d8d8985a0: applying service config to call
0|composer | D0118 13:14:37.191032231 16 client_channel.c:1178] chand=0x559d8d8d6860 calld=0x559d8d8985a0: starting pick on lb_policy=0x559d8d8d33a0
0|composer | D0118 13:14:37.191047124 16 pick_first.c:469] Pick First 0x559d8d8d33a0 connectivity changed. Updating selected: 0; Updating subchannels: 0; Checking 0 index (1 total); State: 4;
0|composer | D0118 13:14:37.191067613 16 client_channel.c:262] chand=0x559d8d8d6860: lb_policy=0x559d8d8d33a0 state changed to SHUTDOWN
0|composer | D0118 13:14:37.191095699 16 client_channel.c:248] chand=0x559d8d8d6860: setting connectivity state to TRANSIENT_FAILURE
0|composer | D0118 13:14:37.191106894 16 client_channel.c:1160] chand=0x559d8d8d6860 calld=0x559d8d8985a0: pick completed asynchronously
0|composer | D0118 13:14:37.191134680 16 client_channel.c:1015] chand=0x559d8d8d6860 calld=0x559d8d8985a0: failed to create subchannel: error={"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.191145674 16 client_channel.c:897] chand=0x559d8d8d6860 calld=0x559d8d8985a0: failing 4 pending batches: {"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | I0118 13:14:37.191160467 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: CANCEL:{"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.191172061 16 client_channel.c:1403] chand=0x559d8d8d6860 calld=0x559d8d8985a0: failing batch with error: {"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | I0118 13:14:37.191196349 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: CANCEL:{"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.191210942 16 client_channel.c:1403] chand=0x559d8d8d6860 calld=0x559d8d8985a0: failing batch with error: {"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | I0118 13:14:37.191225035 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: CANCEL:{"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.191235329 16 client_channel.c:1403] chand=0x559d8d8d6860 calld=0x559d8d8985a0: failing batch with error: {"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | I0118 13:14:37.191247323 16 client_channel.c:1383] OP[client-channel:0x559d8d898580]: CANCEL:{"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.191265314 16 client_channel.c:1403] chand=0x559d8d8d6860 calld=0x559d8d8985a0: failing batch with error: {"created":"@1516281277.191116289","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.191287004 16 pick_first.c:100] Pick First 0x559d8d8d33a0 destroyed.
0|composer | D0118 13:14:37.197227632 16 client_channel.c:370] chand=0x559d8d8d29e0: got resolver result: error="No Error"
0|composer | D0118 13:14:37.197257617 16 pick_first.c:687] Pick First 0x559d8d8f4880 created.
0|composer | I0118 13:14:37.197270111 16 pick_first.c:335] Pick First 0x559d8d8f4880 received update with 1 addresses
0|composer | I0118 13:14:37.197298596 16 pick_first.c:416] Pick First 0x559d8d8f4880 created subchannel 0x559d8d84e8c0 for address uri ipv4:192.168.0.4:7051
0|composer | D0118 13:14:37.197313289 16 client_channel.c:477] chand=0x559d8d8d29e0: resolver result: lb_policy_name="pick_first" (changed), service_config="(null)"
0|composer | D0118 13:14:37.197361765 16 client_channel.c:559] chand=0x559d8d8d29e0: initializing new LB policy
0|composer | D0118 13:14:37.197392849 16 client_channel.c:248] chand=0x559d8d8d29e0: setting connectivity state to IDLE
0|composer | D0118 13:14:37.197410840 16 client_channel.c:1092] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: resolver returned, doing pick
0|composer | D0118 13:14:37.197424333 16 client_channel.c:940] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: applying service config to call
0|composer | D0118 13:14:37.197445423 16 client_channel.c:1178] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: starting pick on lb_policy=0x559d8d8f4880
0|composer | D0118 13:14:37.197464613 16 pick_first.c:469] Pick First 0x559d8d8f4880 connectivity changed. Updating selected: 0; Updating subchannels: 0; Checking 0 index (1 total); State: 4;
0|composer | D0118 13:14:37.197486302 16 client_channel.c:262] chand=0x559d8d8d29e0: lb_policy=0x559d8d8f4880 state changed to SHUTDOWN
0|composer | D0118 13:14:37.197525183 16 client_channel.c:248] chand=0x559d8d8d29e0: setting connectivity state to TRANSIENT_FAILURE
0|composer | D0118 13:14:37.197540675 16 client_channel.c:1160] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: pick completed asynchronously
0|composer | D0118 13:14:37.197571460 16 client_channel.c:1015] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: failed to create subchannel: error={"created":"@1516281277.197554968","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.197587652 16 client_channel.c:897] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: failing 1 pending batches: {"created":"@1516281277.197554968","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | I0118 13:14:37.197609941 16 client_channel.c:1383] OP[client-channel:0x559d8d8f0040]: CANCEL:{"created":"@1516281277.197554968","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.197632329 16 client_channel.c:1403] chand=0x559d8d8d29e0 calld=0x559d8d8f0060: failing batch with error: {"created":"@1516281277.197554968","description":"Call dropped by load balancing policy","file":"../src/core/ext/filters/client_channel/client_channel.c","file_line":1011}
0|composer | D0118 13:14:37.197665513 16 pick_first.c:100] Pick First 0x559d8d8f4880 destroyed.
0|composer | D0118 13:14:37.197695598 16 client_channel.c:370] chand=0x559d8d8d6860: got resolver result: error="No Error"
0|composer | D0118 13:14:37.197712689 16 pick_first.c:687] Pick First 0x559d8d8d07c0 created.
0|composer | I0118 13:14:37.197726782 16 pick_first.c:335] Pick First 0x559d8d8d07c0 received update with 1 addresses
0|composer | I0118 13:14:37.197762464 16 pick_first.c:416] Pick First 0x559d8d8d07c0 created subchannel 0x559d8d6e6880 for address uri ipv4:192.168.0.4:7053
0|composer | D0118 13:14:37.197782454 16 client_channel.c:477] chand=0x559d8d8d6860: resolver result: lb_policy_name="pick_first", service_config="(null)"
0|composer | D0118 13:14:37.197800745 16 client_channel.c:559] chand=0x559d8d8d6860: initializing new LB policy
0|composer | D0118 13:14:37.197816437 16 client_channel.c:248] chand=0x559d8d8d6860: setting connectivity state to IDLE
0|composer | D0118 13:14:37.199036527 16 client_channel.c:370] chand=0x559d8d8d29e0: got resolver result: error="No Error"
0|composer | D0118 13:14:37.199060715 16 pick_first.c:687] Pick First 0x559d8d8d0540 created.
0|composer | I0118 13:14:37.199071509 16 pick_first.c:335] Pick First 0x559d8d8d0540 received update with 1 addresses
0|composer | I0118 13:14:37.199094498 16 pick_first.c:416] Pick First 0x559d8d8d0540 created subchannel 0x559d8d84e8c0 for address uri ipv4:192.168.0.4:7051
0|composer | D0118 13:14:37.199117886 16 client_channel.c:477] chand=0x559d8d8d29e0: resolver result: lb_policy_name="pick_first", service_config="(null)"
0|composer | D0118 13:14:37.199131080 16 client_channel.c:559] chand=0x559d8d8d29e0: initializing new LB policy
0|composer | D0118 13:14:37.199142074 16 client_channel.c:248] chand=0x559d8d8d29e0: setting connectivity state to IDLE
0|composer | Unhandled error for request POST /api/OurSetupDemo: Error: Error trying to ping. Error: Error trying to query business network. Error: Call dropped by load balancing policy
0|composer | at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:713:34)
0|composer | at <anonymous>
有没有人有任何想法可能是什么问题?
答案 0 :(得分:0)
composer card list -c user@my-network
显示什么? - 它是否显示“未设置凭据”或是否已设置(在这种情况下,您可以将其导出以在REST客户端中使用 - 替换您的用户/网络上面的名称??您是否先将导出的卡(file..browser..exported .card文件)导入您的REST客户端?然后检查/ GET WALLET以查看它已设置?然后执行根据{{3}} GET /system/ping