Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬数据库怎么配置啊一直报错 #64

Open
haihaimx opened this issue Apr 23, 2023 · 14 comments
Open

大佬数据库怎么配置啊一直报错 #64

haihaimx opened this issue Apr 23, 2023 · 14 comments

Comments

@haihaimx
Copy link

大佬数据库怎么配置啊一直报错

chatgpt-web-service@1.0.0 start /root/chatgpt-web/service
esno ./src/index.ts

Server is running on port 3002
/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/connection.js:201
callback(new error_1.MongoServerError(document));
^

MongoServerError: Authentication failed.
at Connection.onMessage (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/connection.js:201:30)
at MessageStream. (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/connection.js:59:60)
at MessageStream.emit (node:events:513:28)
at MessageStream.emit (node:domain:489:12)
at processIncomingData (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/message_stream.js:124:16)
at MessageStream._write (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at Socket.ondata (node:internal/streams/readable:766:22) {
ok: 0,
code: 18,
codeName: 'AuthenticationFailed',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
}

Node.js v18.12.0
 ELIFECYCLE  Command failed with exit code 1.

@huangwb8
Copy link

@haihaimx

可以看我写的教程, 有问题再问喽!具体见:Docker系列 基于OpenAI API和Access Token自建ChatGPT

@Kerwin1202
Copy link
Member

提示mongodb 帐号密码错误 ,这得看你怎么部署的

@haihaimx
Copy link
Author

提示mongodb 帐号密码错误 ,这得看你怎么部署的

就是宝塔装的mongodb,一直报这个

@haihaimx
Copy link
Author

提示mongodb 帐号密码错误 ,这得看你怎么部署的

就是宝塔装的mongodb,一直报这个

大佬有没有详细点的教程

@Kerwin1202
Copy link
Member

需要把你配置贴出来。 否则没办法看出,以及怎么部署的都不知道, 如果mongodb 是另外单独部署的 MONGODB_URL 检查这个字段的帐号密码

@haihaimx
Copy link
Author

需要把你配置贴出来。 否则没办法看出,以及怎么部署的都不知道, 如果mongodb 是另外单独部署的 MONGODB_URL 检查这个字段的帐号密码

就是直接启动后端前端的
mongodb数据库不知道怎么配置,用宝塔的一直链接不上

@Kerwin1202
Copy link
Member

自己手动跑得话,进入文件夹 /service 下面有一个.env.example 重命名为 .env 把里面的注释按照填写 MONGODB_URL 这个指向你的数据库链接

@haihaimx
Copy link
Author

自己手动跑得话,进入文件夹 /service 下面有一个.env.example 重命名为 .env 把里面的注释按照填写 MONGODB_URL 这个指向你的数据库链接

大佬,这个已经配置了 MONGODB_URL=mongodb://chatgpt:123456@127.0.0.1:27017
这样对不对啊,我刚刚百度mongodb教程新建了个chatgpt的数据库,命令是use chatgpt
然后新建用户密码db.createUser({user:'chatgpt',pwd:'123456',roles:['readWrite']})这样是不是不对啊,弄完还是不行

@Kerwin1202
Copy link
Member

你是否存在已有数据库呢,如果是连接已有数据库 需要你已有的数据库的帐号密码哦,要已存在 chatgpt 数据库 已存在 chatgpt 账号 123456 密码 从报错来看就是 密码账号不对

@haihaimx
Copy link
Author

自己手动跑得话,进入文件夹 /service 下面有一个.env.example 重命名为 .env 把里面的注释按照填写 MONGODB_URL 这个指向你的数据库链接

大佬现在报这个
chatgpt-web-service@1.0.0 start /root/chatgpt-web/service

esno ./src/index.ts

Server is running on port 3002
/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/connection.js:201
callback(new error_1.MongoServerError(document));
^

MongoServerError: Authentication failed.
at Connection.onMessage (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/connection.js:201:30)
at MessageStream. (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/connection.js:59:60)
at MessageStream.emit (node:events:513:28)
at MessageStream.emit (node:domain:489:12)
at processIncomingData (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/message_stream.js:124:16)
at MessageStream._write (/root/chatgpt-web/service/node_modules/.pnpm/mongodb@5.1.0/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at Socket.ondata (node:internal/streams/readable:766:22) {
ok: 0,
code: 18,
codeName: 'AuthenticationFailed',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
}

Node.js v18.12.0
 ELIFECYCLE  Command failed with exit code 1.
root@VM-0-3-debian:~/chatgpt-web/service#

@Kerwin1202
Copy link
Member

Authentication failed. 看这个关键词就可以了 帐号密码错误

@Kerwin1202
Copy link
Member

很简单的,如果已有数据库 可以用UI管理工具连上去,如果没有去用UI工具创建数据库以及帐号密码

@haihaimx
Copy link
Author

很简单的,如果已有数据库 可以用UI管理工具连上去,如果没有去用UI工具创建数据库以及帐号密码

好的大佬我去学习一下mongodb麻烦了,宝塔自带的感觉有点问题一直报错

@haihaimx
Copy link
Author

很简单的,如果已有数据库 可以用UI管理工具连上去,如果没有去用UI工具创建数据库以及帐号密码

大佬这个配置对不对啊,前端没有登录按钮

OpenAI API Key - https://platform.openai.com/overview

OPENAI_API_KEY=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

change this to an accessToken extracted from the ChatGPT site's https://chat.openai.com/api/auth/session response

OPENAI_ACCESS_TOKEN=

OpenAI API Base URL - https://api.openai.com

OPENAI_API_BASE_URL=https://api.openai.com

OpenAI API Model - https://platform.openai.com/docs/models

OPENAI_API_MODEL=

set true to disable OpenAI API debug log

OPENAI_API_DISABLE_DEBUG=

Reverse Proxy - Available on accessToken

Default: https://bypass.churchless.tech/api/conversation

More: https://github.com/transitive-bullshit/chatgpt-api#reverse-proxy

API_REVERSE_PROXY=

timeout

TIMEOUT_MS=100000

Rate Limit

MAX_REQUEST_PER_HOUR=

Socks Proxy Host

SOCKS_PROXY_HOST=

Socks Proxy Port

SOCKS_PROXY_PORT=

Socks Proxy Username

SOCKS_PROXY_USERNAME=

Socks Proxy Password

SOCKS_PROXY_PASSWORD=

HTTPS PROXY

HTTPS_PROXY=

Title for site

SITE_TITLE=""

Databse connection string

MONGODB_URL=mongodb://chatgpt:xxxx@yourip:port

MONGODB_URL=mongodb://admin:123456@172.17.0.2:27017

Secret key for jwt

If not empty, will need login

AUTH_SECRET_KEY=12345678abcdefg

----- Only valid after setting AUTH_SECRET_KEY begin ----

Allow anyone register

REGISTER_ENABLED=true

Enable register application review

REGISTER_REVIEW=true

The site domain, Only for registration account verification

without end /

SITE_DOMAIN=http://127.0.0.1:1002

Allowed Email Providers, If it is empty, any mailbox is allowed

REGISTER_MAILS=@qq.com,@sina.com,@163.com

REGISTER_MAILS=@qq.com,@sina.com,@163.com,@xihuanni.top

The roon user only email

ROOT_USER=2076659780@qq.com

Password salt

PASSWORD_MD5_SALT=tNJ%M&D

User register email verify

SMTP_HOST=smtp.exmail.qq.com
SMTP_PORT=465
SMTP_TSL=true
SMTP_USERNAME=2076659780@qq.com
SMTP_PASSWORD=

----- Only valid after setting AUTH_SECRET_KEY end @---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants