M201 - Lab 1.1 Unable to import (authentication error) Ubuntu 20.04

I am having trouble understand the directions for Lab 1.1 of the M201 course.

The instructions could be a little more fine-tuned and clear, but here’s the problem I am having.

I created a new database, a new admin user, and full network access from any IP for this test cluster. I downloaded the JSON files and navigated to that directory.

I tried running the listed mongoimport command:
$ mongoimport --drop -c people --uri mongodb+srv://theusername:thepassword@m201-nhtgi.mongodb.net/m201 people.json

But this causes an authentication error:
error connecting to host: could not connect to server: connection() : auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AtlasError) Authentication failed.

I tried just running mongimport people.json and it started running but generated a different error:
error connecting to host: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: localhost:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : dial tcp 127.0.0.1:27017: connect: connection refused }, ] }

Am I supposed to configure the MongoCLI for this course? I started the process but it seems like generating API keys was beyond the necessary scope of what Lab 1.1 was talking about.

I also tried connecting into the Mongo shell and doing it there, but that doesn’t work. Not sure what kind of authentication issue there is and what I can do to fix it. I’m on a work network but tried a VPN to see if that had something to do with it.

Any suggestions would be appreciated, it’s been a few hours of trying to figure this out.

The cluster m201-nhtgi.mongodb.net is not your cluster. It is a sample cluster address given in the course lectures.

You have to return in Atlas to obtain the URI of your cluster.

Thank you, I kept experimenting with different combinations of the command because I wasn’t sure which parts of the provided sample needed to be replaced.

A note for course developers, it would be handy to provide the general syntax for commands like this (instead of just the example) in written form. Would save time from digging around in the CLI docs.

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