pelias / docker

Run the Pelias geocoder in docker containers, including example projects.
MIT License
338 stars 226 forks source link

portland-metro example elastic create error #119

Closed yuan7220 closed 5 years ago

yuan7220 commented 5 years ago

I am in the end of my rope to figure out a solution. Appreciate assistance on solving the error below while running pelias elastic create in the portland-metro example on ubuntu 18 on WSL.

ERROR: Cannot start service schema: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\"/home/may/code/docker/projects/portland-metro/pelias.json\\" to rootfs \\"/var/lib/docker/overlay2/7d0491bd244a3a80f47d9f53092113341ab3e0b0c0ea42afd68278f022e94a63/merged\\" at \\"/var/lib/docker/overlay2/7d0491bd244a3a80f47d9f53092113341ab3e0b0c0ea42afd68278f022e94a63/merged/code/pelias.json\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

missinglink commented 5 years ago

Please post the output of ls -lah /home/may/code/docker/projects/portland-metro/pelias.json

yuan7220 commented 5 years ago

Thanks for asking. The output for ls -lah is -rw-rw-rw- 1 may may 4.9K Jul 30 01:28 /home/may/code/docker/projects/portland-metro/pelias.json

I thought that the error message might suggest that ubunto cannot access /var/lib/docker. I verified that with ls -l. I added the following lines to ~/.bashrc export DOCKER_CERT_PATH=/mnt/c/Users/may/.docker/machine/certs export DOCKER_TLS_VERIFU=1

source ~/.bashrc

then I run pelias elastic create again. Below is the new error message. Any idea how to solve it? Thanks.

Traceback (most recent call last): File "/home/may/.local/bin/docker-compose", line 11, in sys.exit(main()) File "/home/may/.local/lib/python2.7/site-packages/compose/cli/main.py", line 71, in main command() File "/home/may/.local/lib/python2.7/site-packages/compose/cli/main.py", line 124, in perform_command project = project_from_options('.', options) File "/home/may/.local/lib/python2.7/site-packages/compose/cli/command.py", line 39, in project_from_options tls_config=tls_config_from_options(options, environment), File "/home/may/.local/lib/python2.7/site-packages/compose/cli/docker_client.py", line 84, in tls_config_from_options ssl_version=tls_version File "/home/may/.local/lib/python2.7/site-packages/docker/tls.py", line 81, in init 'Path to a certificate and key files must be provided' docker.errors.TLSParameterError: Path to a certificate and key files must be provided through the client_config param. TLS configurations should map the Docker CLI client configurations. See https://docs.docker.com/engine/articles/https/ for API details.

yuan7220 commented 5 years ago

What is confusing is that Docker for Windows does not use TLS for docker daemon 2019-07-30_16-02-35

yuan7220 commented 5 years ago

This post seems to suggest the need to specify TCP socket in python build in the program development. Will I be able to do something on ubuntu to set TCP socket?

missinglink commented 5 years ago

Sorry I'm not familiar with Windows, I haven't used it for about 15 years now 🙁

We don't officially support Windows as a target platform for Pelias, but I suspect it should 'just work' if you can configure the VM in a way that it thinks its just running Linux.

From what I can see above, you're having a configuration issue, try running the most basic 'hello world' example:

echo 'world' > /tmp/hello.txt

docker run --rm -it -v '/tmp/hello.txt:/tmp/hello.txt' ubuntu ls -lah /tmp/hello.txt

-rw-r--r-- 1 root root 6 Aug 13 11:01 /tmp/hello.txt

On my Mac this works fine, I created the hello.txt file locally and then mounted it using -v inside the container, finally, I'm just listing the file from inside the container.

If that's working fine then you can try the same thing in docker-compose and see if that's the issue.

Sorry I can't provide any more assistance, it appears to be a general issue and not Pelias-specific.