Advanced Node and Express - Implement the Serialization of a Passport User- OP_MVDM

Hello everyone,

I have recently posted on step 7 of the Section " Advanced Node and Express": How to Use Passport Strategies - and I was stuck due to some DB connection errors / wrong URI…

I have restarted the challenges on a new glitch project and have reached the " Implement the Serialization of a Passport User" step.
I m pretty solid on the code as I used my previous one (which reaches two steps further) but I am still a big newbie and can’t understand my database mistakes.

Here is the error as in the log:

.env: line 1: 7: command not found

12:48 PM

.env: line 2: XXX: No such file or directory

12:48 PM

Thu, 06 Feb 2020 11:48:15 GMT express-session deprecated req.secret; provide secret option at server.js:32:3

12:48 PM

Database error: MongoParseError: URI malformed, cannot be parsed

Here is my .env file (I adapted the password in the real code) :

DATABASE =mongodb+srv://

The glitch project:


Thanks in advance,


Chrome/Brave - Win 8

does adding quotes here help?

DATABASE ="mongodb+srv://"


This is what I wrote:

DATABASE =“mongodb+srv://”


.env: line 2: DATABASE: command not found

3:30 PM

Database error: MongoParseError: URI malformed, cannot be parsed

Anyone can help me here?


I can’t load your Glitch project for some reason. It’s stuck in loading, not sure why :thinking:

here is an example of my .env:


This is just an example; the ‘imaword’ is the same though and I replaced password. You’ll have to check your DATABASE URI again maybe? What I show is just an example, we would be on different clusters/shards.

… i still can’t load your Glitch, after about 10 minutes waiting. So maybe try to start a new boilerplate and copy/paste into it?

1 Like

Dear pjonp,

Sorry for the late answer - just got back at this project from scratch and eventhough I succesfully pass the test at the Implement the Serialization of a Passport User section , I am, still no able to get connected to my MongoDB Atlas.

I tried different things and managed to get my URI right by adding quotes and this to my mongo connector : {useUnifiedTopology: true}, {useNewUrlParser: true},

YET, it is not working still… So, here is the link to my glitch.

Thanks in advance for the help,