webuser@ubuntu16:~$ docker logs -f rest
[2018-08-29T12:38:31.278Z] PM2 log: Launching in no daemon mode
[2018-08-29T12:38:31.351Z] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-08-29T12:38:31.359Z] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
(node:15) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Connection fails: Error: Error trying to ping. Error: Failed to connect before the deadline
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Failed to connect before the deadline
Error: Error trying to ping. Error: Failed to connect before the deadline
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:806:34)
at <anonymous>
[2018-08-29T12:38:41.021Z] PM2 log: App [composer-rest-server] with id [0] and pid [15], exited with code [1] via signal [SIGINT]
[2018-08-29T12:38:41.024Z] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-08-29T12:38:41.028Z] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
(node:40) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
Connection fails: Error: Error trying to ping. Error: Failed to connect before the deadline
It will be retried for the next request.
我不明白是什么问题以及我在做什么错,因为我已经成功地遵循了超级编曲文件中的所有步骤....
编辑
我按照this tutorial中提到的所有步骤,但不是使用谷歌身份验证我使用github身份验证。此外,我已将本地主机更改为connection.json文件中的ubuntu droplet以及此命令中的ip
sed -e's / localhost:7051 / peer0.org1.example.com:7051/'-e's / localhost:7053 / peer0.org1.example.com:7053/'-e's / localhost:7054 / ca.org1.example.com:7054/'-e's / localhost:7050 / orderer.example.com:7050 /'<$ HOME/.composer/cards/restadmin@trade-network/connection.json> / tmp /connection.json&& cp -p /tmp/connection.json $HOME/.composer/cards/restadmin@trade-network/
但还没有成功!我现在得到以下错误.....
webuser @ ubuntu16:〜$ docker logs rest [2018-08-30T05:03:02.916Z]PM2日志:在无守护进程模式下启动[2018-08-30T05:03:02.989Z]PM2日志:在-fork中启动执行顺序mode- for app name:composer-rest-server id:0 [2018-08-30T05:03:02.997Z] PM2 log:app name:composer-rest-server id:0 online警告:NODE_APP_INSTANCE值为'0'不匹配任何实例配置文件名。警告:请参阅https://github.com/lorenwest/node-config/wiki/Strict-Mode从业务网络定义中发现类型...(节点:15)DeprecationWarning:不推荐使用当前URL字符串解析器,并将在以后的版本中删除。要使用新的解析器,请将选项{useNewUrlParser:true}传递给MongoClient.connect。发现返回事务。从业务网络定义中发现的类型为业务网络定义中的所有类型生成模式...为业务网络定义中的所有类型生成模式将所有类型的模式添加到Loopback ...为Loopback添加所有类型的模式SyntaxError:在Promise.then的JSON.parse()位置92的JSON中的意外字符串(/home/composer/.npm-global/lib/node_modules/composer-rest-server/server/server.js:141:34) at at process._tickDomainCallback(internal / process / next_tick.js:228:7)[2018-08-30T05:03:09.942Z] PM2 log:App [composer-rest-server],id [0]和pid [15 ],通过信号[SIGINT]退出代码1
此错误Error trying to ping. Error: Failed to connect before the deadline
表示容器中的composer-rest-server无法在用于启动REST服务器的卡的connection.json中的URL处查看/连接到底层Fabric。
原因有很多:
您是否在Composer文档中关注过this tutorial?如果完全遵循它将避免上述3个问题。