# Heroku deployment with mongodb atlas failed

**URL:** <https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626>\
**Category:** Node\
**Created:** [January 3, 2021, 1:07am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626 "2021-01-03T01:07:08Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![qyangaa](https://avatars.discourse-cdn.com/v4/letter/q/9de053/32.png) [@qyangaa](https://forum.codewithmosh.com/u/qyangaa)\
**Post date:** [January 3, 2021, 1:07am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/1 "2021-01-03T01:07:08Z")

</div>

I have followed the forum post to set heroku config:

`heroku config:set vidly_db=mongodb://vidly-admin:<Password>@cluster0.pmplg.mongodb.net/vidly?retryWrites=true&w=majority `

And set environment variables in vidly-api-node, custom-environment-variables.json:  
{  
“jwtPrivateKey”: “vidly\_jwtPrivateKey”,  
“db”: “vidly\_db”  
}

I could access the database from MongoDB compass with the link used in setting vidly\_db. But I’m still seeing the following error when trying ``heroku open:

2021-01-03T00:58:15.296363+00:00 app[web.1]: ‘MongoNetworkError: connection 4 to [cluster0-shard-00-00.pmplg.mongodb.net:27017](http://cluster0-shard-00-00.pmplg.mongodb.net:27017) closed’,  
2021-01-03T00:58:15.296366+00:00 app[web.1]: ’ at TLSSocket. (/app/node\_modules/mongodb-core/lib/connection/connection.js:275:9)’,  
2021-01-03T00:58:15.296366+00:00 app[web.1]: ’ at Object.onceWrapper (events.js:421:26)’,  
2021-01-03T00:58:15.296367+00:00 app[web.1]: ’ at TLSSocket.emit (events.js:326:22)’,  
2021-01-03T00:58:15.296367+00:00 app[web.1]: ’ at net.js:675:12’,  
2021-01-03T00:58:15.296367+00:00 app[web.1]: ’ at TCP.done (\_tls\_wrap.js:568:7)’

---

<div class="post-metadata">

**Author:** ![sampreeth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sampreeth/32/523_2.png) [@sampreeth](https://forum.codewithmosh.com/u/sampreeth)\
**Post date:** [January 3, 2021, 5:05am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/2 "2021-01-03T05:05:20Z")

</div>

→Go to Network Access tab.  
→Select Add IP Address  
→Select Allow access from Anywhere.  
→Click on Confirm.

This is how I fixed this issue. Hope it helps.

---

<div class="post-metadata">

**Author:** ![qyangaa](https://avatars.discourse-cdn.com/v4/letter/q/9de053/32.png) [@qyangaa](https://forum.codewithmosh.com/u/qyangaa)\
**Post date:** [January 3, 2021, 9:57pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/3 "2021-01-03T21:57:33Z")

</div>

Thanks for yor reply! I modified the network access settings but it is still not working. My error reads: ‘MongoNetworkError: failed to connect to server [[cluster0.pmplg.mongodb.net:27017](http://cluster0.pmplg.mongodb.net:27017)] on first connect [Error: getaddrinfo ENOTFOUND [cluster0.pmplg.mongodb.net](http://cluster0.pmplg.mongodb.net)’,

---

<div class="post-metadata">

**Author:** ![sampreeth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sampreeth/32/523_2.png) [@sampreeth](https://forum.codewithmosh.com/u/sampreeth)\
**Post date:** [January 6, 2021, 12:30am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/4 "2021-01-06T00:30:50Z")

</div>

> [@Heroku mongodb deployment error React course](https://forum.codewithmosh.com/t/heroku-mongodb-deployment-error-react-course/297/11):
>
> Steps I followed to fix this issue. First, npm update mongoose Latest mongoose as of 5/01/2021 is mongoose 5.11.10. If there is a newer version please check the documentation. Second, If you are following mosh course. Open db.js in startup folder. Change mongoose.connect(db) to mongoose.connect(db, {useNewUrlParser:true, useUnifiedTopology: true}) Three, copy the connection string for Node driver version 2.2.12 or later. make sure the connection string does not have (mongodb+srv) co…

---

<div class="post-metadata">

**Author:** ![ishakmohmed](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@ishakmohmed](https://forum.codewithmosh.com/u/ishakmohmed)\
**Post date:** [January 6, 2021, 8:17am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/5 "2021-01-06T08:17:41Z")

</div>

Totally struggling with that for the past 3 days. Your post kinda helped me to fix a whole lot of issues, but I’ll keep trying to fix the remaining issues. Thanks man. Btw, if anyone is reading this, it’s not Mosh’s fault. He’s the best programming instructor ever, it’s just that its common to face issues like this in programming especially with the constant updates.

---

<div class="post-metadata">

**Author:** ![raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@raj](https://forum.codewithmosh.com/u/raj)\
**Post date:** [February 14, 2021, 4:01pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/6 "2021-02-14T16:01:02Z")

</div>

hello brother i got same problem .but follow your step still i got same error.  
please check my log

here my logs-

PS C:\Users\RAJESH 1\Desktop\New React Project With NPX\vidly-api-node\> heroku logs  
2021-02-14T15:55:22.489412+00:00 app[web.1]: method: null,  
2021-02-14T15:55:22.489412+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489412+00:00 app[web.1]: },  
2021-02-14T15:55:22.489412+00:00 app[web.1]: {  
2021-02-14T15:55:22.489412+00:00 app[web.1]: column: 10,  
2021-02-14T15:55:22.489413+00:00 app[web.1]: file: ‘/app/node\_modules/mongoose/lib/helpers/promiseOrCallback.js’,  
2021-02-14T15:55:22.489413+00:00 app[web.1]: function: ‘promiseOrCallback’,  
2021-02-14T15:55:22.489413+00:00 app[web.1]: line: 30,  
2021-02-14T15:55:22.489413+00:00 app[web.1]: method: null,  
2021-02-14T15:55:22.489413+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489414+00:00 app[web.1]: },  
2021-02-14T15:55:22.489414+00:00 app[web.1]: {  
2021-02-14T15:55:22.489414+00:00 app[web.1]: column: 10,  
2021-02-14T15:55:22.489414+00:00 app[web.1]: file: ‘/app/node\_modules/mongoose/lib/index.js’,  
2021-02-14T15:55:22.489415+00:00 app[web.1]: function: ‘Mongoose.\_promiseOrCallback’,  
2021-02-14T15:55:22.489415+00:00 app[web.1]: line: 1135,  
2021-02-14T15:55:22.489415+00:00 app[web.1]: method: ‘\_promiseOrCallback’,  
2021-02-14T15:55:22.489415+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489415+00:00 app[web.1]: },  
2021-02-14T15:55:22.489416+00:00 app[web.1]: {  
2021-02-14T15:55:22.489416+00:00 app[web.1]: column: 20,  
2021-02-14T15:55:22.489416+00:00 app[web.1]: file: ‘/app/node\_modules/mongoose/lib/index.js’,  
2021-02-14T15:55:22.489416+00:00 app[web.1]: function: ‘Mongoose.connect’,  
2021-02-14T15:55:22.489416+00:00 app[web.1]: line: 344,  
2021-02-14T15:55:22.489417+00:00 app[web.1]: method: ‘connect’,  
2021-02-14T15:55:22.489417+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489417+00:00 app[web.1]: },  
2021-02-14T15:55:22.489417+00:00 app[web.1]: {  
2021-02-14T15:55:22.489417+00:00 app[web.1]: column: 6,  
2021-02-14T15:55:22.489421+00:00 app[web.1]: file: ‘/app/startup/db.js’,  
2021-02-14T15:55:22.489422+00:00 app[web.1]: function: ‘module.exports’,  
2021-02-14T15:55:22.489422+00:00 app[web.1]: line: 9,  
2021-02-14T15:55:22.489422+00:00 app[web.1]: method: ‘exports’,  
2021-02-14T15:55:22.489422+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489422+00:00 app[web.1]: },  
2021-02-14T15:55:22.489423+00:00 app[web.1]: {  
2021-02-14T15:55:22.489423+00:00 app[web.1]: column: 24,  
2021-02-14T15:55:22.489423+00:00 app[web.1]: file: ‘/app/index.js’,  
2021-02-14T15:55:22.489423+00:00 app[web.1]: function: null,  
2021-02-14T15:55:22.489423+00:00 app[web.1]: line: 9,  
2021-02-14T15:55:22.489424+00:00 app[web.1]: method: null,  
2021-02-14T15:55:22.489424+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489424+00:00 app[web.1]: },  
2021-02-14T15:55:22.489424+00:00 app[web.1]: {  
2021-02-14T15:55:22.489424+00:00 app[web.1]: column: 30,  
2021-02-14T15:55:22.489425+00:00 app[web.1]: file: ‘internal/modules/cjs/loader.js’,  
2021-02-14T15:55:22.489425+00:00 app[web.1]: function: ‘Module.\_compile’,  
2021-02-14T15:55:22.489425+00:00 app[web.1]: line: 1063,  
2021-02-14T15:55:22.489425+00:00 app[web.1]: method: ‘\_compile’,  
2021-02-14T15:55:22.489425+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489426+00:00 app[web.1]: },  
2021-02-14T15:55:22.489426+00:00 app[web.1]: {  
2021-02-14T15:55:22.489426+00:00 app[web.1]: column: 10,  
2021-02-14T15:55:22.489426+00:00 app[web.1]: file: ‘internal/modules/cjs/loader.js’,  
2021-02-14T15:55:22.489426+00:00 app[web.1]: function: ‘Module.\_extensions…js’,  
2021-02-14T15:55:22.489427+00:00 app[web.1]: line: 1092,  
2021-02-14T15:55:22.489427+00:00 app[web.1]: method: ‘.js’,  
2021-02-14T15:55:22.489427+00:00 app[web.1]: native: false  
2021-02-14T15:55:22.489427+00:00 app[web.1]: }  
2021-02-14T15:55:22.489427+00:00 app[web.1]: ],  
2021-02-14T15:55:22.489427+00:00 app[web.1]: stack: [  
2021-02-14T15:55:22.489428+00:00 app[web.1]: ‘MongoParseError: Unescaped at-sign in authority section’,  
2021-02-14T15:55:22.489428+00:00 app[web.1]: ’ at parseConnectionString (/app/node\_modules/mongodb/lib/core/uri\_parser.js:615:21)’,  
2021-02-14T15:55:22.489428+00:00 app[web.1]: ’ at connect (/app/node\_modules/mongodb/lib/operations/connect.js:284:3)’,  
2021-02-14T15:55:22.489429+00:00 app[web.1]: ’ at /app/node\_modules/mongodb/lib/mongo\_client.js:225:5’,  
2021-02-14T15:55:22.489429+00:00 app[web.1]: ’ at maybePromise (/app/node\_modules/mongodb/lib/utils.js:681:3)’,  
2021-02-14T15:55:22.489429+00:00 app[web.1]: ’ at MongoClient.connect (/app/node\_modules/mongodb/lib/mongo\_client.js:221:10)’,  
2021-02-14T15:55:22.489429+00:00 app[web.1]: ’ at /app/node\_modules/mongoose/lib/connection.js:833:12’,  
2021-02-14T15:55:22.489430+00:00 app[web.1]: ’ at Promise.\_execute (/app/node\_modules/bluebird/js/release/debuggability.js:300:9)’,  
2021-02-14T15:55:22.489430+00:00 app[web.1]: ’ at Promise.\_resolveFromExecutor (/app/node\_modules/bluebird/js/release/promise.js:483:18)’,  
2021-02-14T15:55:22.489430+00:00 app[web.1]: ’ at new Promise (/app/node\_modules/bluebird/js/release/promise.js:79:10)’,  
2021-02-14T15:55:22.489432+00:00 app[web.1]: ’ at NativeConnection.Connection.openUri (/app/node\_modules/mongoose/lib/connection.js:830:19)’,  
2021-02-14T15:55:22.489432+00:00 app[web.1]: ’ at /app/node\_modules/mongoose/lib/index.js:345:10’,  
2021-02-14T15:55:22.489432+00:00 app[web.1]: ’ at /app/node\_modules/mongoose/lib/helpers/promiseOrCallback.js:31:5’,  
2021-02-14T15:55:22.489432+00:00 app[web.1]: ’ at Promise.\_execute (/app/node\_modules/bluebird/js/release/debuggability.js:300:9)’,  
2021-02-14T15:55:22.489433+00:00 app[web.1]: ’ at Promise.\_resolveFromExecutor (/app/node\_modules/bluebird/js/release/promise.js:483:18)’,  
2021-02-14T15:55:22.489433+00:00 app[web.1]: ’ at new Promise (/app/node\_modules/bluebird/js/release/promise.js:79:10)’,  
2021-02-14T15:55:22.489433+00:00 app[web.1]: ’ at promiseOrCallback (/app/node\_modules/mongoose/lib/helpers/promiseOrCallback.js:30:10)’,  
2021-02-14T15:55:22.489433+00:00 app[web.1]: ’ at Mongoose.\_promiseOrCallback (/app/node\_modules/mongoose/lib/index.js:1135:10)’,  
2021-02-14T15:55:22.489433+00:00 app[web.1]: ’ at Mongoose.connect (/app/node\_modules/mongoose/lib/index.js:344:20)’,  
2021-02-14T15:55:22.489434+00:00 app[web.1]: ’ at module.exports (/app/startup/db.js:9:6)’,  
2021-02-14T15:55:22.489434+00:00 app[web.1]: ’ at Object. (/app/index.js:9:24)’,  
2021-02-14T15:55:22.489434+00:00 app[web.1]: ’ at Module.\_compile (internal/modules/cjs/loader.js:1063:30)’,  
2021-02-14T15:55:22.489438+00:00 app[web.1]: ’ at Object.Module.\_extensions…js (internal/modules/cjs/loader.js:1092:10)’  
2021-02-14T15:55:22.489438+00:00 app[web.1]: ]  
2021-02-14T15:55:22.489438+00:00 app[web.1]: }  
2021-02-14T15:55:22.512304+00:00 app[web.1]: npm ERR! code ELIFECYCLE  
2021-02-14T15:55:22.512680+00:00 app[web.1]: npm ERR! errno 1  
2021-02-14T15:55:22.517862+00:00 app[web.1]: npm ERR! vidly@1.0.0 start: `node index.js`  
2021-02-14T15:55:22.517997+00:00 app[web.1]: npm ERR! Exit status 1  
2021-02-14T15:55:22.518158+00:00 app[web.1]: npm ERR!  
2021-02-14T15:55:22.518299+00:00 app[web.1]: npm ERR! Failed at the vidly@1.0.0 start script.  
2021-02-14T15:55:22.518411+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
2021-02-14T15:55:22.529333+00:00 app[web.1]:  
2021-02-14T15:55:22.530167+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:  
2021-02-14T15:55:22.530305+00:00 app[web.1]: npm ERR! /app/.npm/\_logs/2021-02-14T15\_55\_22\_519Z-debug.log  
2021-02-14T15:55:22.581672+00:00 heroku[web.1]: Process exited with status 1  
2021-02-14T15:55:22.632512+00:00 heroku[web.1]: State changed from starting to crashed  
2021-02-14T15:56:35.312697+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" [host=nameless-atoll-43775.herokuapp.com](http://host=nameless-atoll-43775.herokuapp.com) request\_id=8baa4c79-ab8c-40e2-8874-449cfb74bb1d fwd=“106.215.250.86” dyno= connect= service= status=503 bytes= protocol=https  
2021-02-14T15:56:36.965612+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" [host=nameless-atoll-43775.herokuapp.com](http://host=nameless-atoll-43775.herokuapp.com) request\_id=ca3187f6-8ffd-4f88-9ee6-fbdfa6d5b951 fwd=“106.215.187.206” dyno= connect= service= status=503 bytes= protocol=https

---

<div class="post-metadata">

**Author:** ![raj](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@raj](https://forum.codewithmosh.com/u/raj)\
**Post date:** [February 14, 2021, 4:07pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/7 "2021-02-14T16:07:19Z")

</div>

@ishakmohmed Did you solve this problem?actully i got same error.

---

<div class="post-metadata">

**Author:** ![ishakmohmed](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@ishakmohmed](https://forum.codewithmosh.com/u/ishakmohmed)\
**Post date:** [March 12, 2021, 1:58pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/8 "2021-03-12T13:58:55Z")

</div>

damn it’s been 26 days since you asked, only now I checked, but I’ll answer. Tbh I didn’t deploy this project cause I wasn’t good enough in devOps back then, but now I realized that things have been updated a little in mongodb and heroku. You can check any new YouTube tutorials on how to deploy MERN app to heroku and chances are it’ll work (BUT DON’T UNSUBSCRIBE FROM CODE WITH MOSH CAUSE THAT’S JUST A PLAIN BAD IDEA).

---

<div class="post-metadata">

**Author:** ![virtuosity](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@virtuosity](https://forum.codewithmosh.com/u/virtuosity)\
**Post date:** [March 14, 2021, 9:06am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/9 "2021-03-14T09:06:37Z")

</div>

Ran into a similar/same problem when connecting to MongoDB Atlas.

After some trying of manual things I decided to add the connection string as a ‘Config Var’ on Heroku admin portal rather then using the CLI to set the connection URI

I wanted to know what the underlying problem was though and found when I ‘pasted’ the URI in the terminal after ‘Heroku config:set’, the connection string I copied from mongoDB Atlas contains the special character ‘&’. mlab connection strings didn’t seem to include these characters. This seems to be the root of my problem, and so perhaps yours also.

To address this just enclose the connection string copied from mongoDB Atlass within double-quotes.

So, in the terminal…  
heroku config:set vidly\_db=mongodb://vidly-admin:@cluster0.pmplg.mongodb.net/vidly?retryWrites=true&w=majority

becomes…

heroku config:set “vidly\_db=mongodb://vidly-admin:@cluster0.pmplg.mongodb.net/vidly?retryWrites=true&w=majority”

Give that a go and see if it helps.

---

<div class="post-metadata">

**Author:** ![pfabbi](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@pfabbi](https://forum.codewithmosh.com/u/pfabbi)\
**Post date:** [May 8, 2021, 2:04am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/10 "2021-05-08T02:04:29Z")

</div>

Thank you @virtuosity this helped!

---

<div class="post-metadata">

**Author:** ![Forest](https://avatars.discourse-cdn.com/v4/letter/f/f1d935/32.png) [@Forest](https://forum.codewithmosh.com/u/Forest)\
**Post date:** [June 25, 2021, 4:41am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/11 "2021-06-25T04:41:00Z")

</div>

Thanks! @sampreeth. Your explanation is awesome and helped me fix the problem!

There are few tips for someone’s need.

For Step Three, if you do not really understand. Please check the below link. And Watch 12:00-20:43. About how to set up and check MongoDB atlas link.

[![](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/a/a3d86be0a846eda4fbe9a626730f316e27ff9b36.jpeg "Deploying an Application on Heroku with MongoDB Atlas: Example NodeJS application") ](https://www.youtube.com/watch?v=CajbNAyT_Ss)

For Step Four,  
I entered the Key as MONGODB\_URL

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/5/5dd47f4cbb3e8c6d93bef38625494044c7a4a1ec.png)

---

<div class="post-metadata">

**Author:** ![poudelabhishek1](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@poudelabhishek1](https://forum.codewithmosh.com/u/poudelabhishek1)\
**Post date:** [December 28, 2021, 9:20am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/12 "2021-12-28T09:20:15Z")

</div>

Thank you so much. Your solution helped me.

---

<div class="post-metadata">

**Author:** ![virtuosity](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@virtuosity](https://forum.codewithmosh.com/u/virtuosity)\
**Post date:** [December 28, 2021, 10:38am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/13 "2021-12-28T10:38:09Z")

</div>

Hi Abhishek,

I’m pleased it was helpful to you.

Cheers  
John

---

<div class="post-metadata">

**Author:** ![acmethod](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@acmethod](https://forum.codewithmosh.com/u/acmethod)\
**Post date:** [January 22, 2022, 11:51pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/14 "2022-01-22T23:51:01Z")

</div>

This fixed my issue. I was receiving the a connection error from heroku, with the following suggestion “One common reason is that you’re trying to access the database from an IP that isn’t whitelisted”

Thank you for pointing me in the right direction

---

<div class="post-metadata">

**Author:** ![virtuosity](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@virtuosity](https://forum.codewithmosh.com/u/virtuosity)\
**Post date:** [January 24, 2022, 1:46am UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/15 "2022-01-24T01:46:45Z")

</div>

Hi sampreeth,

You’re welcome, I’m glad it was useful for you.

Cheers  
John

---

<div class="post-metadata">

**Author:** ![ThangTruong](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/thangtruong/32/3223_2.png) [@ThangTruong](https://forum.codewithmosh.com/u/ThangTruong)\
**Post date:** [March 7, 2022, 1:10pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/16 "2022-03-07T13:10:55Z")

</div>

Thank you for everyone sharing this. My Problem has been solved.

---

<div class="post-metadata">

**Author:** ![NathanielKhallil](https://avatars.discourse-cdn.com/v4/letter/n/898d66/32.png) [@NathanielKhallil](https://forum.codewithmosh.com/u/NathanielKhallil)\
**Post date:** [April 21, 2022, 4:04pm UTC](https://forum.codewithmosh.com/t/heroku-deployment-with-mongodb-atlas-failed/1626/17 "2022-04-21T16:04:25Z")

</div>

I set up all the server info with Atlas, etc. but am faced with:  
2021-02-14T15:55:22.512304+00:00 app[web.1]: npm ERR! code ELIFECYCLE  
2021-02-14T15:55:22.512680+00:00 app[web.1]: npm ERR! errno 1  
2021-02-14T15:55:22.517862+00:00 app[web.1]: npm ERR! vidly@1.0.0 start: `node index.js`  
2021-02-14T15:55:22.517997+00:00 app[web.1]: npm ERR! Exit status 1  
2021-02-14T15:55:22.518158+00:00 app[web.1]: npm ERR!  
2021-02-14T15:55:22.518299+00:00 app[web.1]: npm ERR! Failed at the vidly@1.0.0 start script.  
2021-02-14T15:55:22.518411+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
2021-02-14T15:55:22.529333+00:00 app[web.1]:  
2021-02-14T15:55:22.530167+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
