登录一直pending,日志也没有任何反应。
shawnWXN opened this issue · 6 comments
下面是yapi的全部日志
$ docker logs -f 54459a7fc202
log: -------------------------------------swaggerSyncUtils constructor-----------------------------------------------
log: 服务已启动,请打开下面链接访问:
http://127.0.0.1:3000/
error: MongoNetworkError: connect ECONNREFUSED 172.19.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
我启动的时候也是遇到了这样的错误,您解决了吗?
还没有哦。鉴于还有其他bug,我已经不再使用它了
我发现根据里面的一个脚本创建好用户就可以了,我这边是解决了
db.createUser({ user: 'admin', pwd: 'admin123456', roles: [ { role: "root", db: "admin" } ] });
db.auth("admin", "admin123456");
db.createUser({
user: 'yapi',
pwd: 'yapi123456',
roles: [
{ role: "dbAdmin", db: "yapi" },
{ role: "readWrite", db: "yapi" }
]
});
我也放弃这个平台了。emm, yapi已经不维护了,经常出问题,懒得解决了。直接用swagger
1,ps检查mongo的端口号有没有启动起来:ps -ef|grep 27017
2,如果没有启动起来,就是mongo没有启动成功导致;如果启动是正常的,请看第3步
3,docker-compose里是yapi和mongo两个服务,在启动yapi需要依赖mongo,目前解决办法是,重启yapi服务即可:sudo docker-compose restart yapi
-------讨论----------
问题原因我猜测就是docker-compose的启动顺序是并行导致的,但是文件里用了depends_on,就很纳闷,你们知道depends_on的底层逻辑吗?
还没有哦。鉴于还有其他bug,我已经不再使用它了
可以参考我的解决办法,一直重启