Example with "Docker Open Source CPU" not working

The example on this website is not working (Ubuntu 20.04) - I get No rows returned.:

**walter@ubuntu:~$ docker run -d -v $HOME/omnisci-docker-storage:/omnisci-storage -p 6273-6280:6273-6280 omnisci/core-os-cpu**
Unable to find image 'omnisci/core-os-cpu:latest' locally
latest: Pulling from omnisci/core-os-cpu
23884877105a: Pull complete 
bc38caa0f5b9: Pull complete 
2910811b6c42: Pull complete 
36505266dcc6: Pull complete 
f6ff776917cd: Pull complete 
47a45f7b03e4: Pull complete 
Digest: sha256:81c1e196544a74b65f7c232921f6caa5415f59947077a883d6749d0fbef89508
Status: Downloaded newer image for omnisci/core-os-cpu:latest
ec23f0b1d34510c7fa84f6b207c176a7bebd14bd7e60f37b6716adb4bc8b92fe

**walter@ubuntu:~$ docker ps**
CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                                                                                  NAMES
ec23f0b1d345   omnisci/core-os-cpu      "/bin/sh -c '/omnisc…"   15 seconds ago   Up 14 seconds   0.0.0.0:6273-6280->6273-6280/tcp, :::6273-6280->6273-6280/tcp                          reverent_antonelli
ee5f52ca8228   portainer/portainer-ce   "/portainer"             3 days ago       Up 2 minutes    0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp   portainer

**walter@ubuntu:~$ docker exec -it reverent_antonelli ./insert_sample_data**
/omnisci/data/mapd_import/sample_datasets /omnisci
--2021-06-03 15:54:34--  https://data.mapd.com/manifest.tsv
Resolving data.mapd.com (data.mapd.com)... 72.28.97.165
Connecting to data.mapd.com (data.mapd.com)|72.28.97.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 192 [application/octet-stream]
Saving to: 'manifest.tsv'

manifest.tsv                                  100%[==============================================================================================>]     192  --.-KB/s    in 0s      

2021-06-03 15:54:34 (79.5 MB/s) - 'manifest.tsv' saved [192/192]

/omnisci
Enter dataset number to download, or 'q' to quit:
 #     Dataset                   Rows    Table Name             File Name
 1)    Flights (2008)            7M      flights_2008_7M        flights_2008_7M.tar.gz
 2)    Flights (2008)            10k     flights_2008_10k       flights_2008_10k.tar.gz
 3)    NYC Tree Census (2015)    683k    nyc_trees_2015_683k    nyc_trees_2015_683k.tar.gz
1
/omnisci/data/mapd_import/sample_datasets /omnisci
- downloading and extracting flights_2008_7M.tar.gz
--2021-06-03 15:54:39--  https://data.mapd.com/flights_2008_7M.tar.gz
Resolving data.mapd.com (data.mapd.com)... 72.28.97.165
Connecting to data.mapd.com (data.mapd.com)|72.28.97.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 377039522 (360M) [application/octet-stream]
Saving to: 'flights_2008_7M.tar.gz'

flights_2008_7M.tar.gz                        100%[==============================================================================================>] 359.57M  8.27MB/s    in 96s     

2021-06-03 15:56:15 (3.76 MB/s) - 'flights_2008_7M.tar.gz' saved [377039522/377039522]

flights_2008_7M/
flights_2008_7M/flights_2008_7M.csv
flights_2008_7M/flights_2008_7M.sql
/omnisci
- adding schema
User admin connected to database omnisci
User admin disconnected from database omnisci
- inserting file: /omnisci/data/mapd_import/sample_datasets/flights_2008_7M/flights_2008_7M.csv
User admin connected to database omnisci
Exception: File or directory path "/omnisci/data/mapd_import/sample_datasets/flights_2008_7M/flights_2008_7M.csv" is not whitelisted.
User admin disconnected from database omnisci

**walter@ubuntu:~$ docker exec -it reverent_antonelli ./insert_sample_data**
/omnisci/data/mapd_import/sample_datasets /omnisci
--2021-06-03 15:57:19--  https://data.mapd.com/manifest.tsv
Resolving data.mapd.com (data.mapd.com)... 72.28.97.165
Connecting to data.mapd.com (data.mapd.com)|72.28.97.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 192 [application/octet-stream]
Saving to: 'manifest.tsv'

manifest.tsv                                  100%[==============================================================================================>]     192  --.-KB/s    in 0s      

2021-06-03 15:57:20 (59.6 MB/s) - 'manifest.tsv' saved [192/192]

/omnisci
Enter dataset number to download, or 'q' to quit:
 #     Dataset                   Rows    Table Name             File Name
 1)    Flights (2008)            7M      flights_2008_7M        flights_2008_7M.tar.gz
 2)    Flights (2008)            10k     flights_2008_10k       flights_2008_10k.tar.gz
 3)    NYC Tree Census (2015)    683k    nyc_trees_2015_683k    nyc_trees_2015_683k.tar.gz
2
/omnisci/data/mapd_import/sample_datasets /omnisci
- downloading and extracting flights_2008_10k.tar.gz
--2021-06-03 15:57:22--  https://data.mapd.com/flights_2008_10k.tar.gz
Resolving data.mapd.com (data.mapd.com)... 72.28.97.165
Connecting to data.mapd.com (data.mapd.com)|72.28.97.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 584277 (571K) [application/octet-stream]
Saving to: 'flights_2008_10k.tar.gz'

flights_2008_10k.tar.gz                       100%[==============================================================================================>] 570.58K   740KB/s    in 0.8s    

2021-06-03 15:57:23 (740 KB/s) - 'flights_2008_10k.tar.gz' saved [584277/584277]

flights_2008_10k/
flights_2008_10k/flights_2008_10k.csv
flights_2008_10k/flights_2008_10k.sql
/omnisci
- adding schema
User admin connected to database omnisci
User admin disconnected from database omnisci
- inserting file: /omnisci/data/mapd_import/sample_datasets/flights_2008_10k/flights_2008_10k.csv
User admin connected to database omnisci
Exception: File or directory path "/omnisci/data/mapd_import/sample_datasets/flights_2008_10k/flights_2008_10k.csv" is not whitelisted.
User admin disconnected from database omnisci

**walter@ubuntu:~$ docker exec -it reverent_antonelli ./insert_sample_data**
/omnisci/data/mapd_import/sample_datasets /omnisci
--2021-06-03 15:58:03--  https://data.mapd.com/manifest.tsv
Resolving data.mapd.com (data.mapd.com)... 72.28.97.165
Connecting to data.mapd.com (data.mapd.com)|72.28.97.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 192 [application/octet-stream]
Saving to: 'manifest.tsv'

manifest.tsv                                  100%[==============================================================================================>]     192  --.-KB/s    in 0s      

2021-06-03 15:58:03 (60.8 MB/s) - 'manifest.tsv' saved [192/192]

/omnisci
Enter dataset number to download, or 'q' to quit:
 #     Dataset                   Rows    Table Name             File Name
 1)    Flights (2008)            7M      flights_2008_7M        flights_2008_7M.tar.gz
 2)    Flights (2008)            10k     flights_2008_10k       flights_2008_10k.tar.gz
 3)    NYC Tree Census (2015)    683k    nyc_trees_2015_683k    nyc_trees_2015_683k.tar.gz
3
/omnisci/data/mapd_import/sample_datasets /omnisci
- downloading and extracting nyc_trees_2015_683k.tar.gz
--2021-06-03 15:58:05--  https://data.mapd.com/nyc_trees_2015_683k.tar.gz
Resolving data.mapd.com (data.mapd.com)... 72.28.97.165
Connecting to data.mapd.com (data.mapd.com)|72.28.97.165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 54572184 (52M) [application/octet-stream]
Saving to: 'nyc_trees_2015_683k.tar.gz'

nyc_trees_2015_683k.tar.gz                    100%[==============================================================================================>]  52.04M  7.43MB/s    in 19s     

2021-06-03 15:58:25 (2.74 MB/s) - 'nyc_trees_2015_683k.tar.gz' saved [54572184/54572184]

nyc_trees_2015_683k/
nyc_trees_2015_683k/nyc_trees_2015_683k.csv
nyc_trees_2015_683k/nyc_trees_2015_683k.sql
/omnisci
- adding schema
User admin connected to database omnisci
User admin disconnected from database omnisci
- inserting file: /omnisci/data/mapd_import/sample_datasets/nyc_trees_2015_683k/nyc_trees_2015_683k.csv
User admin connected to database omnisci
Exception: File or directory path "/omnisci/data/mapd_import/sample_datasets/nyc_trees_2015_683k/nyc_trees_2015_683k.csv" is not whitelisted.
User admin disconnected from database omnisci

**walter@ubuntu:~$ docker exec -it reverent_antonelli /omnisci/bin/omnisql**
Password: 
User admin connected to database omnisci
omnisql> SELECT origin_city AS "Origin", dest_city AS "Destination", AVG(airtime) AS
..> "Average Airtime" FROM flights_2008_10k WHERE distance < 175 GROUP BY origin_city,
..> dest_city;
No rows returned.
omnisql>

Hi @walter,

recently we added a security enhancement to our database that prevents access to the copy command to not authorized paths, in fact the error you are getting is

Exception: File or directory path "some_path/some_file is not whitelisted.
User admin connected to database omnisci
User admin disconnected from database omnisci
- inserting file: /omnisci/data/mapd_import/sample_datasets/nyc_trees_2015_683k/nyc_trees_2015_683k.csv
User admin connected to database omnisci
Exception: File or directory path "/omnisci/data/mapd_import/sample_datasets/nyc_trees_2015_683k/nyc_trees_2015_683k.csv" is not whitelisted.
User admin disconnected from database omnisci

as you can read in this thread
a bug has been filed, and in the meanwhile you would add the path /omnisci/data/mapd_import/sample_datasets/ to the white list, adding this line in the main section of the omnisci.conf file
allowed-import-paths = ["/omnisci/data/mapd_import"]

We are sorry for the inconvenience.

Candido

Hi @walter

With your docker instance, you’ll need to do a different workaround.

Use docker exec -it <container id> bash to access the instance
Open the /omnisci/insert_sample_data script for editing.
Change this line (should be 5th line of text):
MAPD_DATA=${MAPD_DATA:="$PWD/data"}
to
MAPD_DATA=${MAPD_DATA:="/omnisci-storage/data"}

You can now exit the docker instance and rerun the following command:
docker exec -it <container-id> ./insert_sample_data

This will import the sample dataset and your query should now return data.

Sorry for the confusion. Let us know how it goes.
Pey