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

make import-osm fails with Docker Toolbox for Windows #807

Closed
zstadler opened this issue Apr 9, 2020 · 4 comments · Fixed by #957
Closed

make import-osm fails with Docker Toolbox for Windows #807

zstadler opened this issue Apr 9, 2020 · 4 comments · Fixed by #957

Comments

@zstadler
Copy link
Contributor

zstadler commented Apr 9, 2020

make import-osm fails with Docker Toolbox for Windows.

Failure log:

...
docker-compose run --rm -u $(id -u ${USER}):$(id -g ${USER}) import-osm
Importing in normal mode
[Apr  9 09:09:44] IO error: /cache/coords: Invalid argument
Makefile:108: recipe for target 'import-osm' failed
make: *** [import-osm] Error 1

To reproduce:

make download-geofabrik area=northamptonshire
rm -fr cache
make import-osm

Workaround:

The following changes need to be reverted.

  1. Restore the run of import-osm as root.

    diff --git a/Makefile b/Makefile
    index 729b04c..d9bee7e 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -105,7 +105,7 @@ psql: db-start
    
     .PHONY: import-osm
     import-osm: db-start all
    -       docker-compose run $(DC_OPTS) import-osm
    +       docker-compose run import-osm
    
     .PHONY: import-sql
     import-sql: db-start all
  2. Restore the use of an anonymous volume for cache.

    diff --git a/docker-compose.yml b/docker-compose.yml
    index 41087d4..176a15e 100644
    --- a/docker-compose.yml
    +++ b/docker-compose.yml
    @@ -1,6 +1,7 @@
     version: "2"
     volumes:
       pgdata:
    +  cache:
     services:
       postgres:
     image: "openmaptiles/postgis:${TOOLS_VERSION}"
    @@ -36,7 +37,7 @@ services:
     volumes:
       - ./data:/import
       - ./build:/mapping
    -      - ./cache:/cache
    +      - cache:/cache
       import-osm-diff:
     image: "openmaptiles/import-osm:${TOOLS_VERSION}"
     env_file: .env
    @@ -48,7 +49,7 @@ services:
     volumes:
       - ./data:/import
       - ./build:/mapping
    -      - ./cache:/cache
    +      - cache:/cache
       update-osm:
     image: "openmaptiles/import-osm:${TOOLS_VERSION}"
     env_file: .env
    @@ -60,7 +61,7 @@ services:
     volumes:
       - ./data:/import
       - ./build:/mapping
    -      - ./cache:/cache
    +      - cache:/cache
       openmaptiles-tools:
     image: "openmaptiles/openmaptiles-tools:${TOOLS_VERSION}"
     env_file: .env
zstadler added a commit to zstadler/openmaptiles that referenced this issue Apr 9, 2020
@nyurik
Copy link
Member

nyurik commented May 30, 2020

@zstadler we specifically made sure that all docker images can run without the root access. Running as root creates all local files as root as well, requiring sudo to delete them. Lets try to figure out how it can run safely on Windows too without requiring sudo for everyone.

@zstadler
Copy link
Contributor Author

@nyurik, The above is my capture of the issue and the only solution I have found.
How would you like to proceed?

@nyurik
Copy link
Member

nyurik commented May 31, 2020

So there are two changes you have here -- using volumes instead of local dirs, and removing -u param. Are you sure you need both? Would sharing the local dir instead of a full volume work?

@zstadler
Copy link
Contributor Author

zstadler commented May 31, 2020

The problem is that imposm fails to write to the mounted directory in either user mode or as root.
imposm succeeds only when (1) a Docker named volume is used for the imposm cache and (2) the imposm tasks are run as root.

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

Successfully merging a pull request may close this issue.

2 participants