有一个应用程序在部署时遇到了问题。它已经部署好了,但突然之间链接不再工作了。我试图重新部署,但失败了,所以我删除了那个应用程序,克隆了我的github,再次重试也无济于事。为了给予上下文,我的旧笔记本电脑坏了,我不得不得到一个新的笔记本电脑,但应用程序将不能正确部署。它使用Express,Node和Mongoose,只有一个前端。
以下是我收到的当前错误:
[1/1] Checking that e28677eb572286 [app] is up and running Smoke checks for e28677eb572286 failed: the app appears to be crashing Check its logs: here's the last lines below, or run 'fly logs -i e28677eb572286': INFO Starting init (commit: 0b28cec)... INFO Preparing to run:docker-entrypoint.sh npm run start` as root
INFO [fly api proxy] listening at /.fly/api
2023/06/23 20:04:23 listening on [fdaa:2:7b4:a7b:21a1:8e24:3a29:2]:22 (DNS: [fdaa::3]:53)
[email protected] start
node ./bin/www.js
Fri, 23 Jun 2023 20:04:24 GMT express-session deprecated req.secret; provide secret option at file:/app/server.js:46:3
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Listening on port 8080
/app/node_modules/mongoose/lib/connection.js:768
throw new MongooseError('The uri parameter to openUri() must be a ’ +
^
MongooseError: The uri parameter to openUri() must be a string, got “undefined”. Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
at _createMongoClient (/app/node_modules/mongoose/lib/connection.js:768:11)
at NativeConnection.openUri (/app/node_modules/mongoose/lib/connection.js:705:29)
at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:406:15)
at file:///app/config/database.js:7:10
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Node.js v18.15.0
npm notice
npm notice New minor version of npm available! 9.5.0 → 9.7.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.7.2
npm notice Run npm install -g [email protected] to update!
npm notice
INFO Main child exited normally with code: 1
INFO Starting clean up.
WARN hallpass exited, pid: 232, status: signal: 15 (SIGTERM)
2023/06/23 20:04:25 listening on [fdaa:2:7b4:a7b:21a1:8e24:3a29:2]:22 (DNS: [fdaa::3]:53)
[ 3.130614] reboot: Restarting system
machine did not have a restart policy, defaulting to restart
INFO Starting init (commit: 0b28cec)…
INFO Preparing to run: docker-entrypoint.sh npm run start as root
INFO [fly api proxy] listening at /.fly/api
2023/06/23 20:04:26 listening on [fdaa:2:7b4:a7b:21a1:8e24:3a29:2]:22 (DNS: [fdaa::3]:53)
[email protected] start
node ./bin/www.js
Fri, 23 Jun 2023 20:04:28 GMT express-session deprecated req.secret; provide secret option at file:/app/server.js:46:3
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Listening on port 8080
/app/node_modules/mongoose/lib/connection.js:768
throw new MongooseError('The uri parameter to openUri() must be a ’ +
^
MongooseError: The uri parameter to openUri() must be a string, got “undefined”. Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
at _createMongoClient (/app/node_modules/mongoose/lib/connection.js:768:11)
at NativeConnection.openUri (/app/node_modules/mongoose/lib/connection.js:705:29)
at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:406:15)
at file:///app/config/database.js:7:10
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Node.js v18.15.0
npm notice
npm notice New minor version of npm available! 9.5.0 → 9.7.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.7.2
npm notice Run npm install -g [email protected] to update!
npm notice
INFO Main child exited normally with code: 1
INFO Starting clean up.
WARN hallpass exited, pid: 232, status: signal: 15 (SIGTERM)
2023/06/23 20:04:28 listening on [fdaa:2:7b4:a7b:21a1:8e24:3a29:2]:22 (DNS: [fdaa::3]:53)
Error: smoke checks for e28677eb572286 failed: the app appears to be crashing
`
我试过重新安装fly.io,升级fly.io,删除toml文件,flyscale计数为1,flyscale计数为2,重新克隆github代码并重新部署。
1条答案
按热度按时间carvr3hs1#
我只是销毁了我的应用程序(不是机器),然后运行
fly launch
。使用相同的.toml文件,它工作正常。