Cannot Get Node App to Deploy (Using Fly)

I 0

have an app where it is having trouble deploying. It was already deployed but all of a sudden the link no longer worked. I tried to redeploy and it failed so I then deleted that app, cloned my github, and retried again to no avail. To give context, my old laptop broke and I had to get a new laptop but the app will not deploy properly. It uses Express, Node and Mongoose and only has a front-end. I dont know if some npm package is missing but I put every npm package I could think of that I used to create this app

Here is the current error that I am receiving: throw new MongooseError('Theuriparameter toopenUri()must be a ' + ^ MongooseError: Theuriparameter toopenUri()must be a string, got "undefined". Make sure the first parameter tomongoose.connect()ormongoose.createConnection()is a string. at _createMongoClient (/app/node_modules/mongoose/lib/connection.js:805:11) at NativeConnection.openUri (/app/node_modules/mongoose/lib/connection.js:742: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: npm notice Runnpm install -g npm@9.7.2` 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/25 05:11:50 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

`

`

The Mongo/Mongoose connection string is the issue. Seeing as it is undefined most likely you didn’t add the connection string to the environment variables on Fly.

Also, depending on where the DB is hosted, if the DB isn’t used for some time it will be auto-paused. So that can make an app fail at some point. You should get a notification. For example, MongoDB Atlas sends you an email when it is about to pause the cluster.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.