Mflix NOT loading: Is my connectionStrings Wrong?

SECRET_KEY=learning-this-mongodb-thing
MFLIX_DB_URI=mongodb+srv://m220student:m220password@mongodb+srv://m220student:@mflix-ydaxv.mongodb.net/mflix
MFLIX_NS=mflix
PORT=5000

It looks like your connection string has the username and password twice. Try:

SECRET_KEY=learning-this-mongodb-thing
MFLIX_DB_URI=mongodb+srv://m220student:m220password@mflix-ydaxv.mongodb.net
MFLIX_NS=mflix
PORT=5000

WOW !! The application starts, BUT there is NOTHING displayed except 3 TABS and the “Spin of Death” that is spinning. There is also, the Application LOGO.

Status. Login. Signup.
What is expected to indicate a successful start of the application?
Thanks

If you successfully imported the data, you should see a list of about 20 movies and the cover art.

  • Did you import the data?
  • Can you query the database using the Mongo Shell?

Imported data data and it said it was imported ok.

2019-03-12T23:38:08.324-0400 [########################] mflix.movies 19.9MB/19.9MB (100.0%)
2019-03-12T23:38:08.384-0400 [########################] mflix.movies 19.9MB/19.9MB (100.0%)
2019-03-12T23:38:08.384-0400 restoring indexes for collection mflix.movies from metadata
2019-03-12T23:38:30.066-0400 finished restoring mflix.movies (45993 documents)
2019-03-12T23:38:30.066-0400 done

BUT when I look in Atlas UNDER, collections, it shows none.
Where is the data imported to?

If the import is successful, you will see one new database (mflix) with five collections.

  • You can verify the database exists by running the show dbs command.
  • If the database exists, perform the use mflix command to switch to the new database.
  • Finally, use the show collections command to list the collections in the database.

If these steps aren’t successful, you may want to review the MongoDB Atlas Cluster section of README.rst

As you can see, the Data is being restored, BUT TO WHERE?
When I connect via the shell and do show dbs
the DB is NOT there

adminadminsMBP2:~ adminadmin$ cd documents
adminadminsMBP2:documents adminadmin$ cd mflix
adminadminsMBP2:mflix adminadmin$ mongorestore --drop --gzip --host mflix-shard-0/mflix-shard-00-00-gpows.mongodb.net:27017,mflix-shard-00-01-gpows.mongodb.net:27017,mflix-shard-00-02-gpows.mongodb.net:27017 --ssl --username m220student --password m220password data
2019-03-13T22:23:48.336-0400 preparing collections to restore from
2019-03-13T22:23:48.338-0400 don’t know what to do with file “data/.DS_Store”, skipping…
2019-03-13T22:23:48.419-0400 reading metadata for mflix.movies from data/mflix/movies.metadata.json.gz
2019-03-13T22:23:48.474-0400 restoring mflix.movies from data/mflix/movies.bson.gz
2019-03-13T22:23:48.860-0400 reading metadata for mflix.comments from data/mflix/comments.metadata.json.gz
2019-03-13T22:23:48.862-0400 reading metadata for mflix.sessions from data/mflix/sessions.metadata.json.gz
2019-03-13T22:23:48.864-0400 reading metadata for mflix.theaters from data/mflix/theaters.metadata.json.gz
2019-03-13T22:23:48.896-0400 restoring mflix.comments from data/mflix/comments.bson.gz
2019-03-13T22:23:48.906-0400 restoring mflix.theaters from data/mflix/theaters.bson.gz
2019-03-13T22:23:48.914-0400 restoring mflix.sessions from data/mflix/sessions.bson.gz
2019-03-13T22:23:49.692-0400 restoring indexes for collection mflix.sessions from metadata
2019-03-13T22:23:49.728-0400 finished restoring mflix.sessions (264 documents)
2019-03-13T22:23:49.756-0400 reading metadata for mflix.users from data/mflix/users.metadata.json.gz
2019-03-13T22:23:49.792-0400 restoring mflix.users from data/mflix/users.bson.gz
2019-03-13T22:23:49.957-0400 restoring indexes for collection mflix.users from metadata
2019-03-13T22:23:49.992-0400 finished restoring mflix.users (183 documents)
2019-03-13T22:23:50.793-0400 restoring indexes for collection mflix.theaters from metadata
2019-03-13T22:23:50.836-0400 finished restoring mflix.theaters (1564 documents)
2019-03-13T22:23:51.050-0400 […] mflix.movies 420KB/19.9MB (2.1%)
2019-03-13T22:23:51.050-0400 […] mflix.comments 228KB/10.3MB (2.2%)
2019-03-13T22:23:51.050-0400
2019-03-13T22:23:54.050-0400 [#…] mflix.movies 868KB/19.9MB (4.3%)
2019-03-13T22:23:54.050-0400 [##…] mflix.comments 940KB/10.3MB (8.9%)
2019-03-13T22:23:54.050-0400
2019-03-13T22:23:57.046-0400 [###…] mflix.movies 3.07MB/19.9MB (15.4%)
2019-03-13T22:23:57.046-0400 [#####…] mflix.comments 2.50MB/10.3MB (24.3%)
2019-03-13T22:23:57.046-0400
2019-03-13T22:24:00.046-0400 [#########…] mflix.movies 7.64MB/19.9MB (38.5%)
2019-03-13T22:24:00.046-0400 [##########…] mflix.comments 4.47MB/10.3MB (43.4%)
2019-03-13T22:24:00.046-0400
2019-03-13T22:24:03.048-0400 [##################…] mflix.movies 15.6MB/19.9MB (78.7%)
2019-03-13T22:24:03.048-0400 [###############…] mflix.comments 6.70MB/10.3MB (65.1%)
2019-03-13T22:24:03.048-0400
2019-03-13T22:24:04.880-0400 [########################] mflix.movies 19.9MB/19.9MB (100.0%)
2019-03-13T22:24:04.880-0400 restoring indexes for collection mflix.movies from metadata
2019-03-13T22:24:06.049-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:09.046-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:12.046-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:15.046-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:18.048-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:21.050-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:24.047-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:27.051-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:28.722-0400 finished restoring mflix.movies (45993 documents)
2019-03-13T22:24:30.047-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:33.051-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:36.049-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:39.051-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:42.049-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:45.049-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:48.050-0400 [##################…] mflix.comments 8.13MB/10.3MB (79.0%)
2019-03-13T22:24:51.046-0400 [###################…] mflix.comments 8.34MB/10.3MB (81.0%)
2019-03-13T22:24:52.901-0400 [########################] mflix.comments 10.3MB/10.3MB (100.0%)
2019-03-13T22:24:52.901-0400 restoring indexes for collection mflix.comments from metadata
2019-03-13T22:24:54.045-0400 finished restoring mflix.comments (150094 documents)
2019-03-13T22:24:54.045-0400 done

I can’t tell from what I see here, but I’m no expert. Is it possible you’re connecting to a locally installed Mongo instance rather than your Atlas cluster?

In Windows 10 my Mongo Shell prompt for Atlas looks like this:

MongoDB Enterprise Cluster0-shard-0:PRIMARY>

But yours says:

adminadminsMBP2:~ adminadmin$

I wonder if the difference is the computing platform or the target Mongo instance?

I am using a MAC, but will try a Windows Machine later in the day to see. So are you running it from a MongoDB Shell or from the Root of mflix?
The Instructions says to run it from mflix root. If you don’t mind, can you share the steps you used to run it from your Mongo Shell on WINDOWS?
Thanks

You launch Mongo shell from the command prompt. Before you do, however, make sure you navigate to the mflix root. That will give you access to the data folder during the import process.

At this point, I am withdrawing from the class. It is not working for whatever reason. The strange thing is that, the data is imported into thin air. I have tried 4 different computers, Windows and MAC, same results. Wasted 3 days !

Your date is being restored to:

Note that the database is mflix. If you do show collections right after login your are not in the correct database. As @Charlie_34553, wrote you have to issue use mflix before you can see the collections.

Hi yousaid,
In MacOS, under mflix-js directory after you unzip mflix-js.zip, You can do after this Command shell
:mflix-js $
mongorestore --drop --gzip --uri “mongodb+srv://m220student:m220password@mflix-shard-00-00-gpows.mongodb.net” data

Please note that --uri, not --host, in this case, as we do not need to specify port 27017 for the Cluster in Atlas. That done means you upload the database including collections: movies, comments, etc, onto Cloud located in Oregon, or Singapore, for free M0.

There is one more detail I like to share with you b/c I had this problem before:
In .env file, use this string ( no wrapped between " " ) after MFLIX_DB_URI= as follow:

mongpdb://m220student:m220password@mflix-shard-00-00-gpows.mongodb.net:27017,mflix-shard-00-01-gpows.mongodb.net:27017,mflix-shard-00-02-gpows.mongodb.net:27017/?replicaSet=mflix-shard-0&ssl=true&retryWrites=true

Hope this may help!

1 Like

Thanks to all for all this help ! Really appreciate it. Here is what I am doing. Please Tell me where I am going wrong.
On My MAC:
I. I cd to my MongoDB directory.
2. From there I launch Mongo Shell
3. With Mongo running, I open a second Command Window.
4. I browse to mflix directory.
5. I run this commend. mongorestore --drop --gzip --host mflix-shard-0/mflix-shard-00-00-gpows.mongodb.net:27017,mflix-shard-00-01-gpows.mongodb.net:27017,mflix-shard-00-02-gpows.mongodb.net:27017 --ssl --username m220student --password m220password data
6: I get this response:
… MANY more lines
MB/19.9MB (29.7%)
2019-03-17T19:25:52.946-0400 [###################…] mflix.comments 8.48MB/10.3MB (82.5%)
2019-03-17T19:25:52.946-0400
2019-03-17T19:25:55.126-0400 [########################] mflix.comments 10.3MB/10.3MB (100.0%)
2019-03-17T19:25:55.126-0400 restoring indexes for collection mflix.comments from metadata
2019-03-17T19:25:55.464-0400 finished restoring mflix.comments (150094 documents)
2019-03-17T19:25:55.950-0400 [############…] mflix.movies 10.3MB/19.9MB (52.0%)
2019-03-17T19:25:58.950-0400 [###################…] mflix.movies 16.5MB/19.9MB (83.0%)
2019-03-17T19:26:01.089-0400 [########################] mflix.movies 19.9MB/19.9MB (100.0%)
2019-03-17T19:26:01.089-0400 restoring indexes for collection mflix.movies from metadata
2019-03-17T19:26:21.577-0400 finished restoring mflix.movies (45993 documents)
2019-03-17T19:26:21.578-0400 done

NOTICE it says done and executes without error.
7. I go to Mongo shell and do: Show dbs
ALL I see are just 2 DB, admin and Local.
I go to Atlas, ZERO Collections.
Something is WRONG on the backend. Where did the Data that is uploaded go?

The even more interesting thing is that, when I run this:
mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

I can connect ok to a different cluster. All the DBs are there. If Itry to connect to mflix, it does NOT work. Theres a problem with the backend

I think you confuse connecting to MongoDB Atlas via your OS shell and via NodeJS-API.
After you successfully load mflix to your Cluster, you have to edit your .env (saying dot env) right beneath mflix directory. please refer to README for details. In the .env file, copy the whole string I posted before to see whether it is running.

I rekon you typed two different clusters, i.e …00-00-jxeqq… and 00-00-gpows… Have you wiped off and recreate?

Here is what I get.
-bash: mongpdb://m220student:m220password@mflix-shard-00-00-gpows.mongodb.net:27017,mflix-shard-00-01-gpows.mongodb.net:27017,mflix-shard-00-02-gpows.mongodb.net:27017/?replicaSet=mflix-shard-0: No such file or directory
[1]- Exit 127 mongpdb://m220student:m220password@mflix-shard-00-00-gpows.mongodb.net:27017,mflix-shard-00-01-gpows.mongodb.net:27017,mflix-shard-00-02-gpows.mongodb.net:27017/?replicaSet=mflix-shard-0
[2]+ Done ssl=true

Yes, I have two clusters. The one I used for a previous training and that one works fine.
The mfilx one is the one, that does not seem to work.
I already have the application and my .env file up. BUT the application has no data to load. The application loads, BUT, only shows the “spin of Death”, meaning there’s no data to load.
When I look at the mflix cluster, it shows NO collections.

I have wiped and rebuilt several times too. Tried from both MAC and Windows. I think there’s an issue on the backend with my profile. Since Mongo does not seem to monitor this forum to help when there are issues such as this, just don’t see what else I can do.