Lab - Error: [thread1] ReferenceError: validate_lab_change_dbpath is not defined :

Hi guys,

I have one problem with this lab.

I executed this steps:

  1. sudo mkdir -p /var/mongodb/db/

  2. sudo chown -R vagrant:vagrant /var/mongodb/db/

  3. configuration file
    storage:
    dbPath: “/var/mongodb/db/”
    systemLog:
    path: “/data/logs/mongod.log”
    destination: “file”
    net:
    bindIp : “127.0.0.1,192.168.103.100”
    port: 27000
    security:
    authorization: enabled
    processManagement:
    fork : true

  4. Recreate user
    mongo admin --host localhost:27000 --eval ’
    db.createUser({
    user: “m103-admin”,
    pwd: “m103-pass”,
    roles: [
    {role: “root”, db: “admin”}
    ]
    })

  5. Connect the mongo shell
    mongo --port 27000 --authenticationDatabase admin -u m103-admin -p m103-pass
    MongoDB shell version v3.6.15
    connecting to: mongodb://127.0.0.1:27000/?authSource=admin&gssapiServiceName=mongodb
    Implicit session: session { “id” : UUID(“64553826-0fe6-4e63-be1a-dd2cef79aa72”) }
    MongoDB server version: 3.6.15
    Server has startup warnings:
    2019-11-14T15:17:27.824+0000 I STORAGE [initandlisten]
    2019-11-14T15:17:27.824+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
    2019-11-14T15:17:27.824+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten]
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten]
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
    2019-11-14T15:17:28.647+0000 I CONTROL [initandlisten]
    MongoDB Enterprise > show dbs
    admin 0.000GB
    config 0.000GB
    local 0.000GB

  6. Validate
    MongoDB Enterprise > validate_lab_change_dbpath
    2019-11-14T15:18:14.421+0000 E QUERY [thread1] ReferenceError: validate_lab_change_dbpath is not defined :
    @(shell):1:1

What’s wrong?

Thanks,
Ivi.

Hi @ivialex,

Everything that you have done so far is perfectly fine.

The validation scripts need to be run outside of mongo shell and inside vagrant.
So, open another terminal, ssh into vagrant and run the command there.

Hope this helps!

Thanks,
Muskan

It’s work fine.

Great!

Thanks!

1 Like