Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcgiwrap can't list /db, leading to runtime error: open64: 13 Permission denied /db/db//osm3s_osm_base Unix_Socket::7 #129

Open
LogicalOverflow opened this issue Oct 17, 2024 · 1 comment

Comments

@LogicalOverflow
Copy link

When running the docker container, any request to overpass just returns the following:

<?xml version="1.0" encoding="UTF-8"?>                                                                                                                                                                               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: runtime error: open64: 13 Permission denied /db/db//osm3s_osm_base Unix_Socket::7 </p>

</body>
</html>

The issue seems to be caused by the /db directory being owned by the overpass user with drwx------ permission while fcgiwrap runs as the nginx user, meaning it does not have permission to list the files in /db. Either running chown nginx or chmod og+rx /db inside the container resolve the issue.

This occurs both with and without mounting /db as a volume.

As a workaround, I added OVERPASS_PLANET_PREPROCESS=chmod og+rx /db to the container environment variables, which resolves the issue.

For reference, I was using the following environment variables, though I have tried a variety of combinations and they all produced this error:

- OVERPASS_META=yes
- OVERPASS_MODE=init
- OVERPASS_PLANET_URL=file:///germany-latest.osm.bz2
- OVERPASS_USE_AREAS=false
- OVERPASS_STOP_AFTER_INIT=false
- OVERPASS_ALLOW_DUPLICATE_QUERIES=yes
- OVERPASS_RULES_LOAD=10

(The germany-latest.osm.bz2 file is pre-downloaded and mounted via a volume)

@MathurinV
Copy link

Hey @LogicalOverflow , I was facing the same issue and I managed to make it work by mapping the /db directory to a directory inside my filesystem (ext4), without having it managed by docker:
in you docker compose file:

volumes:
  <YOUR_VOLUME>:
[...]
services:
  overpass-api:
    image: wiktorn/overpass-api
    volumes:
      - <YOUR_VOLUME>:/db

becomes:

# No docker volume
services:
  overpass-api:
    image: wiktorn/overpass-api
    volumes:
      - ./<YOUR_LOCAL_DIRECTORY>:/db

I am trying to find a workaround so docker volumes can still be used without having to add OVERPASS_PLANET_PREPROCESS=chmod og+rx /db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants