Operation not permitted on tar

When I run vagrant provision to I get the following error when unzipping the products.json. Then I don’t have the file in my vmachine. How can I fix that or upload the file from my host machine to the virtual machine directly?

mongod-m103: Downloading Dataset
==> mongod-m103: + curl -s https://s3.amazonaws.com/edu-static.mongodb.com/lessons/M103/products.json.tgz -o products.json.tgz
==> mongod-m103: + tar -xzvf products.json.tgz -C /dataset
==> mongod-m103: tar:
==> mongod-m103: /dataset: Cannot open
==> mongod-m103: : Operation not permitted
==> mongod-m103: tar:
==> mongod-m103: Error is not recoverable: exiting now

You probably do not have write access into the / directory.

Try with $HOME/dataset instead.

1 Like

What do you mean? That happened when I ran vagrant provision

Since it is during vagrant provision, I am not too sure what to do.

If you can start the VM and ssh to it with vagrant up and vagrant ssh, I would try to go run the curl and the tar commands manually after making sure /dataset exists and is writable by user vagrant.

If you cannot start the VM you can always use a web browser to download the file products.json.tgz in your your m103-vagrant-env directory on the host machine. You may then try is something like 7-Zip can extract the file.

Hi @Leonardo_19537,

I know this post is old but in case you never got this working and still wanted to take the course, I wanted to share my solution with you as I had the exact same problem.

Here is my solution

@steevej-1495 - Thank you for you comments here! They helped me figure out this issue and get my system working.

1 Like