我当前遇到此错误:在遵循本教程https://www.codementor.io/gangachris125/passport-jwt-authentication-for-hyperledger-composer-rest-server-jqfgkoljn
时运行docker logs rest
时出现以下错误:
2018-12-06T11:22:50: PM2 log: Launching in no daemon mode
2018-12-06T11:22:50: PM2 log: App [composer-rest-server:0] starting in -fork mode-
2018-12-06T11:22:50: PM2 log: App [composer-rest-server: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:17) 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: Card not found: admin@bc612182
It will be retried for the next request.
Exception: Error: Card not found: admin@bc612182
{ Error: Card not found: admin@bc612182
at store.get.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-common/lib/cardstore/walletbackedcardstore.js:74:27)
at <anonymous>
cause:
{ Error: ENOENT: no such file or directory, open '/home/composer/.composer/cards/admin@bc612182'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at FileSystemWallet.get (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-wallet-filesystem/lib/filesystemwallet.js:145:34)
at <anonymous>
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/composer/.composer/cards/admin@bc612182' } }
2018-12-06T11:22:55: PM2 log: App [composer-rest-server:0] exited with code [1] via signal [SIGINT]
2018-12-06T11:22:55: PM2 log: App [composer-rest-server:0] starting in -fork mode-
2018-12-06T11:22:55: PM2 log: App [composer-rest-server: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:34) 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: Card not found: admin@bc612182
It will be retried for the next request.
Exception: Error: Card not found: admin@bc612182
{ Error: Card not found: admin@bc612182
at store.get.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-common/lib/cardstore/walletbackedcardstore.js:74:27)
at <anonymous>
cause:
{ Error: ENOENT: no such file or directory, open '/home/composer/.composer/cards/admin@bc612182'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at FileSystemWallet.get (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-wallet-filesystem/lib/filesystemwallet.js:145:34)
at <anonymous>
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/composer/.composer/cards/admin@bc612182' } }
2018-12-06T11:22:58: PM2 log: App [composer-rest-server:0] exited with code [1] via signal [SIGINT]
2018-12-06T11:22:58: PM2 log: App [composer-rest-server:0] starting in -fork mode-
2018-12-06T11:22:59: PM2 log: App [composer-rest-server:0] online
Smits-MacBook-Pro:bc612182 Smit$ composer card list
[更新]:我设法解决了上述问题,但是却遇到了新的错误:
[2018-12-06 17:17:59] PM2 log: Launching in no daemon mode
[2018-12-06 17:17:59] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-12-06 17:17:59] 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:19) 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.
以前有没有人遇到过这个?
答案 0 :(得分:0)
您是否将.composer从主目录复制到Dockerfile中/旁边?
从您提供的日志来看,您似乎没有。在构建docker映像之前,请仔细查看步骤。