(FIXED) Error in validating Lab Shard Collection - Use m103.products

Hi,

I am getting an issue running validate_lab_shard_collection. The error returned is:

No documents found in m103.products - make sure you import the dataset into the
‘products’ collection in the ‘m103’ database.

This is rather strange, because I do have the m103.products set-up.

exe%20-%20vagrant%20%20ssh

Any ideas? As a side note, my collection count is off. The lab states there should be 516784, whereas I have 734669 returning.

EDIT: Fixed. Thanks Tess_Sluijter. Just had to re-run the validation script a few times.

Rerun the validation script a second time. Or even a third time.

Many people have run into this issue. There seems to be something fishy about the tool.

5 Likes

oh man, I just got a chuckle. Rerunning it a couple times got it working.

Thanks so much!!

No worries mate!

As I said, there some definite :whale2::dolphin::fish: going on with that validator.

Ok. This script needs sorting out.

I ran it once and picked “type” … and the validate script told me no cigar.

NOTE - So just to be clear, the key you need to pick is all about avoiding hot spotting, which if that had been stated, I would have picked the answer first time. Unfortunately I was considering queries I would want to run :slight_smile:

I tried 15 - 20 times to re run the script. The following are the steps I took to get that script to run.

  1. So I dropped the collection, and re ran the import, checking the primary shard etc.

Validation script would not run - cannot see m103-repl-2

  1. So I dropped the database and re ran the import. I restarted the mongos as well, just to be on the safe side.

Validation script would not run - cannot see m103-repl-2

  1. Shut down the vagrant session I was running the validate script in.

Still made no difference - cannot see m103-repl

  1. Finally I shut down all servers - 2 shards, config server and mongos and then halted vagrant.

rebooted the pc …

Restarted config servers, mongos, 2 * shard and it worked.

I know my config was correct, since I got the initial validation to work.

Thank goodness I noted all the steps.

However very annoyed … 3+ hours for 3%. Very grumpy, going to the pub tonight.

1 Like

@JustLearningMongoDB I ran into the same issue, I had to run the validate script about 5 times before it came back clean.

On seeing this thread understand that the issue is with validation script (not sure what exactly it is), used below code so it did a trick to me

while true; do validate_lab_shard_collection; sleep 5; done

after some attempts, it gave me the validation code.

Save my time on cluster reconfigure, stop/start etc …

1 Like

I tried many times.No success

vagrant@m103:/dataset$ while true; do validate_lab_shard_collection; sleep 5; done

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.

No documents found in m103.products - make sure you import the dataset into the
‘products’ collection in the ‘m103’ database.

Incorrect number of documents imported - make sure you import the entire
dataset.

No documents found in m103.products - make sure you import the dataset into the
‘products’ collection in the ‘m103’ database.

Incorrect number of documents imported - make sure you import the entire
dataset.

Incorrect number of documents imported - make sure you import the entire
dataset.
^C
vagrant@m103:/dataset$
vagrant@m103:/dataset$ date
Mon Jan 28 05:45:42 UTC 2019
vagrant@m103:/dataset$

Worked for me.
vagrant@m103:~$ while true

do
validate_lab_shard_collection
done

Client experienced a timeout when connecting to ‘m103-repl-2’ - check that mongod/mongos
processes are running on the correct ports, and that the ‘m103-admin’ user
authenticates against the admin database.

No documents found in m103.products - make sure you import the dataset into the
‘products’ collection in the ‘m103’ database.

No documents found in m103.products - make sure you import the dataset into the
‘products’ collection in the ‘m103’ database.

No documents found in m103.products - make sure you import the dataset into the
‘products’ collection in the ‘m103’ database.

Congratulations, you got it right! Here’s your validation code:

5a621149d083824c6d889865

Congratulations, you got it right! Here’s your validation code:

5a621149d083824c6d889865

Congratulations, you got it right! Here’s your validation code:

5a621149d083824c6d889865

^C
vagrant@m103:~$

1 Like

Hi Everyone,

I would request you to please not share the answers to any Quiz/Lab as it is highly demotivating for people who have not attempted yet or who are putting lot of hard-work while doing this Quizes/Labs.

Kanika

Nothing works for me, please help.

Issue occurs probably because wrong Index was chosen

Try following procedure if you have the same issue:

mongo import with drop option command
sh.enableSharding
db.adminCommand(shardCollection)
exit
validate_lab_shard_collection

Worked for me