pelias / docker

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

Pelias Download All - Permission Denied. #284

Closed gelsas closed 2 years ago

gelsas commented 2 years ago

Hello everyone,

I am currently trying to setup the full planet build of pelias.

I have followed these steps: Started here: https://github.com/pelias/docker/tree/master/projects/planet

Then followed the steps described here: https://github.com/pelias/docker

After doing so I started to follow the steps to Run a Build on: https://github.com/pelias/docker/tree/master/projects/planet#run-a-build

The first error I am getting is this one

[trin@app planet]$ sudo git submodule update
Cloning into '/var/www/vhosts/trin/httpdocs/pelias/docker/projects/planet/acceptance-tests'...
Submodule path 'acceptance-tests': checked out '1cdcb109978485736b5a7f4318d5403994763af1'
[trin@app planet]$ pelias compose pull
Pulling libpostal     ... done
Pulling schema        ... done
Pulling api           ... done
Pulling placeholder   ... done
Pulling whosonfirst   ... done
Pulling openstreetmap ... done
Pulling openaddresses ... done
Pulling geonames      ... done
Pulling csv-importer  ... done
Pulling transit       ... done
Pulling polylines     ... done
Pulling interpolation ... done
Pulling pip           ... done
Pulling elasticsearch ... done
Pulling fuzzy-tester  ... done
[trin@app planet]$ pelias elastic start
Removing pelias_elasticsearch
Recreating abf1253d5782_pelias_elasticsearch ... error

ERROR: for abf1253d5782_pelias_elasticsearch  Cannot start service elasticsearch: driver failed programming external connectivity on endpoint pelias_elasticsearch (c14ba442f04df269fc08051577bbf6b96ce996fccb07212f914a94e851a778d5):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 127.0.0.1 --dport 9300 -j DNAT --to-destination 172.18.0.7:9300 ! -i br-92febc9bc408: iptables: No chain/target/match by that name.
 (exit status 1))

ERROR: for elasticsearch  Cannot start service elasticsearch: driver failed programming external connectivity on endpoint pelias_elasticsearch (c14ba442f04df269fc08051577bbf6b96ce996fccb07212f914a94e851a778d5):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 127.0.0.1 --dport 9300 -j DNAT --to-destination 172.18.0.7:9300 ! -i br-92febc9bc408: iptables: No chain/target/match by that name.
 (exit status 1))
ERROR: Encountered errors while bringing up the project.
[trin@app planet]$

But the reason why I am opening the issue here is this error:

[trin@app planet]$ pelias download all
info: [interpolation(TIGER)] downloading all TIGER data
internal/fs/utils.js:269
    throw err;
    ^

Error: EACCES: permission denied, mkdir '/data/geonames'
    at Object.mkdirSync (fs.js:921:3)
    at module.exports (/code/pelias/geonames/lib/tasks/download.js:13:6)
    at Object.<anonymous> (/code/pelias/geonames/bin/downloadData.js:11:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/data/geonames'
}
warn: [csv-download] No files to download, quitting
info: [openstreetmap-download] Downloading sources: https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
internal/fs/utils.js:269
    throw err;
    ^

Error: EACCES: permission denied, mkdir '/data/whosonfirst/sqlite'
    at Object.mkdirSync (fs.js:921:3)
    at download (/code/pelias/whosonfirst/utils/download_sqlite_all.js:34:6)
    at Object.<anonymous> (/code/pelias/whosonfirst/utils/download_sqlite_all.js:126:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47 {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/data/whosonfirst/sqlite'
}
error: [openstreetmap-download] error making directory /data/openstreetmap message=EACCES: permission denied, mkdir '/data/openstreetmap', stack=Error: EACCES: permission denied, mkdir '/data/openstreetmap', errno=-13, code=EACCES, syscall=mkdir, path=/data/openstreetmap
error: [openstreetmap-download] Failed to download data message=EACCES: permission denied, mkdir '/data/openstreetmap', stack=Error: EACCES: permission denied, mkdir '/data/openstreetmap', errno=-13, code=EACCES, syscall=mkdir, path=/data/openstreetmap
info: [openaddresses-download] Attempting to download all data
error: [openaddresses-download] error making directory /data/openaddresses message=EACCES: permission denied, mkdir '/data/openaddresses', stack=Error: EACCES: permission denied, mkdir '/data/openaddresses', errno=-13, code=EACCES, syscall=mkdir, path=/data/openaddresses
error: [openaddresses-download] Failed to download data message=EACCES: permission denied, mkdir '/data/openaddresses', stack=Error: EACCES: permission denied, mkdir '/data/openaddresses', errno=-13, code=EACCES, syscall=mkdir, path=/data/openaddresses
warn: [transit] 'pelias.json' config lacks a transit object entry. Transit importer quitting after taking no action
error: [interpolation(TIGER)]  message=getaddrinfo EAI_AGAIN data.geocode.earth, stack=Error: getaddrinfo EAI_AGAIN data.geocode.earth
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26), errno=EAI_AGAIN, code=EAI_AGAIN, syscall=getaddrinfo, hostname=data.geocode.earth, response=undefined
error: [interpolation(TIGER)]  message=getaddrinfo EAI_AGAIN data.geocode.earth, stack=Error: getaddrinfo EAI_AGAIN data.geocode.earth
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26), errno=EAI_AGAIN, code=EAI_AGAIN, syscall=getaddrinfo, hostname=data.geocode.earth, response=undefined
[trin@app planet]$

I tried to run sudo pelias download all aswell but I am getting the same error messages. I can not understand why I apparently do not have the permission to create the folders? What could be my issue ?

missinglink commented 2 years ago

What directory are you using for your DATA_DIR?

You'll need to check the permissions of that directory against the permissions of your docker user.

It's most likely that either the directory doesn't exist or it's not writable by docker.

Don't use sudo to run the pelias command.

missinglink commented 2 years ago

When you resolve the problem please close this issue.

nikitenich commented 1 year ago

I'm not deep dive in docker configuration and get the same error with Germany configuration. Adding user: "${UID}:${GID}" to each service in docker-compose.yml file helps with write permission error, but it leads to log spam when starting containers: WARN[0000] The "UID" variable is not set. Defaulting to a blank string. WARN[0000] The "GID" variable is not set. Defaulting to a blank string.