Ticket: Connection can't get validation code


I am trying to get the validation code as said by the tutorial, but i get the following error from the page.

Before starting the application I run the following command line

npm test -t db-connection

But I would get 2 error. I checked after that the number of movies in my db is 12000 and not 45993, beside this the movie refereed in the tutorial wasn’t present in the database.

I changed everything that was incorrect, set the number of movies 12000 and included the id and title of a different movie present in the database as you can see below in the picture

By doing this the test passed successfully but I still can’t get the code.

Hi @Grei_14746,

Please re-import the data as it seems incomplete.


I am experiencing the same issue. The last test in the suite was failing, it was expecting 23539, for the numMovies, but was receiving 23531, I changed the test to expect that number instead, and everyone worked. I went and tried to get the validation code, but same issue. I also dropped all the sample data from my cluster and re-imported it, and received the same issue. So it looks like there is a bug in the mflix-js code that is part of the lesson.

EDIT: I went ahead and just modified the movies.controller.js to return 23539 in the response object for the total_results field and that tricked the UI into giving me the validation code, so indeed the code is out dated.


Hey @Kenneth_Davila_Davila! I, too am facing the same issue.

1 Like

Hi @yashika_bihani! I believe I have a fix to this issue without having to edit the mflix handout files. Please check my post here and comment there if my fix doesn’t work for you for any of the Tickets.

@kanikasingla I am having a similar issue that has been reported by others here. I tried re-importing the dataset twice but I guess the code is just old. Is there a solution to this from the course instructors or do we just have to figure out other ways?

Hi I am unable to get 23539 records . please share the steps to download new sample database.

A workaround is to clone 8 items in Compass so you get to the expected 23539 items. Changing the test alone won’t work because the validation is done at the client (react app) and the code is minified. Just keep going, don’t let this small bug stop you.

Hi @Carlos_Marchena,

This was the issue due to updated dataset from our end and we have fixed it for unit tests and integration test.
I would recommend importing the latest dataset and using the latest handout zip file for the course.
Let me know if this helps.


In the context of the reported errors in the data sample (attached image) I found something it shouldn’t be done, but was the only way to oversome the situation and not to waste time.

In the files

you look for the number 23531 in both files, which should be the number of records the test find, and you change it for the real number of records you have. In my case, data sample only load 23530 records instead of 23531 and just changed the last 1 digit for 0 to fulfill test requirement.

(I really didn’t want to cheat, but to advance …out…)

I think this is no cheating, it is because either you change this or you add the number of fake records to fill the missing records.

This way your test will pass. Not iniviting to cheat, but to save time because of this error.

Thanks! it helped me

1 Like