Trying to run test in Lab configuration: IDE works, tests don’t

Hello, I´m studing MongoDB M103, and when I try to do the Lat Configuration File, I had one problem. I followed all steps, but the Run Test into IDE session and doesn´t return anything.

Follow the steps:

  1. I edited the mongod.conf and put:
net:
   port: 27000
security:
   authorization: "enabled"
  1. I run mongod --config mongod.conf

  2. in another tag window, I put this commands:

mongo admin --host localhost:27017 --eval '
  db.createUser({
    user: "m103-admin",
    pwd: "m103-pass",
    roles: [
      {role: "root", db: "admin"}
    ]
  })
  1. I run the Run Test on IDE window.
Into Log show this information:
2022-08-15T16:41:59.467+0000 I NETWORK  [listener] connection accepted from 127.0.0.1:46212 #1 (1 connection now open)
2022-08-15T16:41:59.487+0000 I ACCESS   [conn1] note: no users configured in admin.system.users, allowing localhost access
2022-08-15T16:41:59.487+0000 I NETWORK  [conn1] received client metadata from 127.0.0.1:46212 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.5" }, os: { type: "Linux", name: "NAME="Alpine Linux"", architecture: "x86_64", version: "Kernel 4.15.0-1021-aws" } }
2022-08-15T16:41:59.550+0000 I STORAGE  [conn1] createCollection: admin.system.users with generated UUID: ac564134-5e01-4d71-8513-c9c3ba5a3192
2022-08-15T16:41:59.572+0000 I NETWORK  [conn1] end connection 127.0.0.1:46212 (0 connections now open)

And into Test Result window, show only:

Testing workspace…

There is something wrong ?

your config file starts the instance at port 27000, but you create the user on another instance at port 27017.

1 Like

Yes, but when I created the user in the port 27000, shows me the same problem.

user@M103# mongo admin --host localhost:27000 --eval '
>   db.createUser({
>     user: "m103-admin",
>     pwd: "m103-pass",
>     roles: [
>       {role: "root", db: "admin"}
>     ]
>   })
> '
MongoDB shell version v4.0.5
connecting to: mongodb://localhost:27000/admin?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("6e2a48f6-bec8-4c0f-8d77-10b75da508f5") }
MongoDB server version: 4.0.5
Successfully added user: {
        "user" : "m103-admin",
        "roles" : [
                {
                        "role" : "root",
                        "db" : "admin"
                }
        ]
}
1 Like

The above is not an error log. it just says it added the user to the instance at port 27000.

first, refresh the page and restart the cluster. check if you are giving the correct user/password, then try the test again and give the log if it is an error.

Thanks Yilmaz.

I doing again the step by step:

  1. edit the file mongod.conf
# fill out this configuration file, mongod.conf!
# and then use it to run mongod with:
# mongod -f mongod.conf
net:
   port: 27000
security:
   authorization: "enabled"
  1. Start the mongod using the mongod.conf
user@M103# mongod --config mongod.conf
2022-08-15T19:20:02.116+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] MongoDB starting : pid=330 port=27000 dbpath=/data/db 64-bit host=IAjlQMjQuOcjlcp7vF
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] db version v4.0.5
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] allocator: system
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] modules: none
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] build environment:
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten]     distarch: x86_64
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2022-08-15T19:20:02.130+0000 I CONTROL  [initandlisten] options: { config: "mongod.conf", net: { port: 27000 }, security: { authorization: "enabled" } }
2022-08-15T19:20:02.158+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=256M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2022-08-15T19:20:03.126+0000 I STORAGE  [initandlisten] WiredTiger message [1660591203:126387][330:0x7f9e5a355ca8], txn-recover: Set global recovery timestamp: 0
2022-08-15T19:20:03.130+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] 
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2022-08-15T19:20:03.152+0000 I CONTROL  [initandlisten] 
2022-08-15T19:20:03.154+0000 I STORAGE  [initandlisten] createCollection: admin.system.version with provided UUID: e36f2882-c938-4849-aa6a-9116145ab106
2022-08-15T19:20:03.165+0000 I COMMAND  [initandlisten] setting featureCompatibilityVersion to 4.0
2022-08-15T19:20:03.172+0000 I STORAGE  [initandlisten] createCollection: local.startup_log with generated UUID: 9954c448-499c-4a6c-a5e9-0dbe84a9d8c1
2022-08-15T19:20:03.184+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2022-08-15T19:20:03.186+0000 I NETWORK  [initandlisten] waiting for connections on port 27000
2022-08-15T19:20:03.233+0000 I STORAGE  [LogicalSessionCacheRefresh] createCollection: config.system.sessions with generated UUID: 4d986a19-440d-4ad6-ba80-f727483d4085
2022-08-15T19:20:03.248+0000 I INDEX    [LogicalSessionCacheRefresh] build index on: config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions", expireAfterSeconds: 1800 }
2022-08-15T19:20:03.248+0000 I INDEX    [LogicalSessionCacheRefresh]     building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2022-08-15T19:20:03.250+0000 I INDEX    [LogicalSessionCacheRefresh] build index done.  scanned 0 total records. 0 secs
  1. Create user admin in another tab, in mongo using port 27000:
user@M103# mongo admin --host localhost:27000 --eval '
>   db.createUser({
>     user: "m103-admin",
>     pwd: "m103-pass",
>     roles: [
>       {role: "root", db: "admin"}
>     ]
>   })
> '
MongoDB shell version v4.0.5
connecting to: mongodb://localhost:27000/admin?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("fea24702-0514-4e82-b79f-375db8bfd3ab") }
MongoDB server version: 4.0.5
Successfully added user: {
        "user" : "m103-admin",
        "roles" : [
                {
                        "role" : "root",
                        "db" : "admin"
                }
        ]
}
user@M103# 
  1. Click in Run Test

Test Results

Testing workspace…

  1. after that, the log shows me:
2022-08-15T19:20:03.233+0000 I STORAGE  [LogicalSessionCacheRefresh] createCollection: config.system.sessions with generated UUID: 4d986a19-440d-4ad6-ba80-f727483d4085
2022-08-15T19:20:03.248+0000 I INDEX    [LogicalSessionCacheRefresh] build index on: config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions", expireAfterSeconds: 1800 }
2022-08-15T19:20:03.248+0000 I INDEX    [LogicalSessionCacheRefresh]     building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2022-08-15T19:20:03.250+0000 I INDEX    [LogicalSessionCacheRefresh] build index done.  scanned 0 total records. 0 secs
2022-08-15T19:21:13.600+0000 I NETWORK  [listener] connection accepted from 127.0.0.1:49250 #1 (1 connection now open)
2022-08-15T19:21:13.623+0000 I ACCESS   [conn1] note: no users configured in admin.system.users, allowing localhost access
2022-08-15T19:21:13.623+0000 I NETWORK  [conn1] received client metadata from 127.0.0.1:49250 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.5" }, os: { type: "Linux", name: "NAME="Alpine Linux"", architecture: "x86_64", version: "Kernel 4.15.0-1021-aws" } }
2022-08-15T19:21:13.685+0000 I STORAGE  [conn1] createCollection: admin.system.users with generated UUID: 160a2e54-0700-45d1-b0c4-c87237d6a5e9
2022-08-15T19:21:13.709+0000 I NETWORK  [conn1] end connection 127.0.0.1:49250 (0 connections now open)

I saw that user was created, but when I click in Run Test button, shows me that last message above. And the testing workspace doesn´t finish.

Let me ask you one crucial question about the page your are on:

  • when you click “Run Test” button, does a new panel open on the right side of the IDE? in it, there are 3 tests indicating [FAIL] or [PASS].

these 3 tests and their hints are:

  • “The server is running on localhost:27000”. Did you launch mongod on port 27000?
  • “The server requires authentication”. Don’t forget to launch mongod with authentication enabled! You can do this using the configuration file.
  • “Mongod was started with a configuration file”. Did you launch mongod using a configuration file?

Do you see this panel and the results of these tests in it? the second one requires adding the user which you have already done.

try refreshing the page to reset the IDE, and without doing any editing press the test button. see if you can get these 3 tests failing.

Let´s me try to put the image.

I don´t know if you can see, but yes, a new panel was opened, but only shows me the message testing workspace. Does not show anything else. only this.

Yep, got the picture now :slight_smile:

I had 3-5 second delays when I tried the page, but it did get a result eventually. how long does this continue?

it is possible your browser’s cache became too big to handle requests fast enough, if ever. Can you clear the cache of the browser and restart it?

In case of clearing cache does not solve, open the developer tools on the page and check the console for errors and post it here.

This continue for 15 minutes and no answers… I´ll do that you said, clear the cache of my browser and restart it. I´ll tell you if I have sucess or not. Thanks.

I did this. I clear the browser cache, and try again. Doesn´t work.

It is just a hope we can find a clue in the developer console.

Try pressing “F12” key to open developer tools. use browser menu it the key won’t work. There, switch to the “console” tab and check if there are any errors logged.

follow an image about this…

more details

I have seen the IDE not opening or not connecting but this one is new for me. IDE works yet the tests have a connection issue. I am now clueless about the problem.

This needs another eye from the community or MongoDB teams.

Meanwhile, to make it easier for others to read the problem, edit the title of this discussion (I never tried, I hope it is possible) and add “IDE works Tests don’t”. then also add the picture of the console with the error to your first post.

@Stennie The long thread might seem as if we have progressed, but it came to a point I don’t have a clue about as of now. Do you have an idea?

No Problem. I’m appreciate your help. It was usefully for me.

I can´t edit the title of this discussion. But no problem.

Thank you very much.

Regards

Hi :wave: @Carlos_Augusto_Carbonar_Cintra,

We appreciate your patience and thank you so much @Yilmaz_Durmaz for helping Carlos.

We’ve tried to fix this up from our end, so please give it a try once again to Run the test cases. And if it doesn’t get resolved let us know certain details:

  • From which specific geographic location you are trying to access the MongoDB University? (Ex: NYC?)
  • Are you using VPN?

Apart from this, your approach looks good to me. All the Best for the rest of the course.

Resource: M103 - FAQ post

Best :slightly_smiling_face:,
Kushagra

3 Likes

Hi Kushadra, I´m here again :slight_smile:

I´m trying to access the MongoDB University from Brazil. And I´m not using VPN. Just using my Internet, my browser Chrome, etc.

I saw, I don´t know how, my Configuration File Lab has marked OK. Now I´m trying to do the next Lab, where I need to put the new Path of mongodb files. And has the same problem. I´ll try to do the same test in another compute, because my compute has some softwares from my company that block some connections. I´ll tell you if I can (or not) close my test .

Thank you for your and Ylmaz helps.

Regards

1 Like

Hi Kushagra,

This is the problem. My computer has some softwares that are blocking the IDE labs. I could do the same lab with success in another computer.

Thank you so much. :slight_smile:

Regards

2 Likes

Hi @Carlos_Augusto_Carbonar_Cintra,

We’re glad that the problem is resolved. We wish you Happy Learning :sparkles:

Feel free to create a new post in case of any questions.

Best,
Kushagra

1 Like