如果用docker-compose重启时会报错
log: -------------------------------------swaggerSyncUtils constructor-----------------------------------------------
log: 服务已启动,请打开下面链接访问:
http://127.0.0.1:3000/
error: MongoNetworkError: connect ECONNREFUSED 172.20.0.2:27017, mongodb Authentication failed
log: mongodb load success...
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined
at /my-yapi/vendors/exts/yapi-plugin-advanced-mock/server.js:24:38
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined
at /my-yapi/vendors/exts/yapi-plugin-statistics/server.js:12:38
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined
at /my-yapi/vendors/exts/yapi-plugin-wiki/server.js:7:38
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:1) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
如果用docker-compose重启时会报错 log: -------------------------------------swaggerSyncUtils constructor----------------------------------------------- log: 服务已启动,请打开下面链接访问: http://127.0.0.1:3000/ error: MongoNetworkError: connect ECONNREFUSED 172.20.0.2:27017, mongodb Authentication failed log: mongodb load success... (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined at /my-yapi/vendors/exts/yapi-plugin-advanced-mock/server.js:24:38 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined at /my-yapi/vendors/exts/yapi-plugin-statistics/server.js:12:38 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'collection' of undefined at /my-yapi/vendors/exts/yapi-plugin-wiki/server.js:7:38 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3) (node:1) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated这个报错,是因为mongo并未启动完成, yapi连接太快, 连接不上. 解决办法: 等几分钟后等mongo启动完成后,再次重启yapi-web容器即可