Ryan-Miao / docker-yapi

Docker build and run yapi as service
288 stars 115 forks source link

readme中打开数据库认证 输入数据库用户名: yapi(mongo配置的用户名, 见mongo-conf/init-mongo.js) 输入密码: yapi123456(mongo配置的密码, 见mongo-conf/init-mongo.js) #9

Closed chensonghiter closed 3 years ago

chensonghiter commented 3 years ago

打开localhost:9090后,没看到有地方可以配置 1、打开数据库认证 2、输入数据库用户名: yapi(mongo配置的用户名, 见mongo-conf/init-mongo.js) 3、输入密码: yapi123456(mongo配置的密码, 见mongo-conf/init-mongo.js)

没有做以上步骤,导致部署失败,看报错是mongodb认证失败 依赖库安装完成,正在初始化数据库mongodb...

yapi-vendor@1.9.2 install-server /my-yapi/vendors > node server/install.js log: mongodb load success... Error: (node:209) UnhandledPromiseRejectionWarning: MongoError: command createIndexes requires authentication at Connection. (/my-yapi/vendors/node_modules/mongoose/node_modules/mongodb/lib/core/connection/pool.js:466:61) at Connection.emit (events.js:314:20) at processMessage (/my-yapi/vendors/node_modules/mongoose/node_modules/mongodb/lib/core/connection/connection.js:364:10) at Socket. (/my-yapi/vendors/node_modules/mongoose/node_modules/mongodb/lib/core/connection/connection.js:533:15) at Socket.emit (events.js:314:20) at addChunk (_stream_readable.js:298:12) at readableAddChunk (_stream_readable.js:273:9) at Socket.Readable.push (_stream_readable.js:214:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) (node:209) 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:209) [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.

chensonghiter commented 3 years ago

已解决,mongodb连线语法问题