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

Error while using Docker-Container: Error while loading shared libraries #5294

Closed
patreu22 opened this issue Dec 5, 2018 · 19 comments
Closed

Comments

@patreu22
Copy link

patreu22 commented Dec 5, 2018

Hello there,

I've got the following (extract) of a Docker-compose file:

  osrm-server:
    image: osrm/osrm-backend
    build:
      context: .
      dockerfile: ./osrm/Dockerfile.osrm
    ports:
      - 5000:5000
    command: bash -c "osrm-routed --algorithm mld berlin-latest.osrm"

The Dockerfile.osrm looks like this:

FROM osrm/osrm-backend
RUN apt-get update
RUN apt-get install -y wget
RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf
RUN osrm-partition berlin-latest.osrm
RUN osrm-customize berlin-latest.osrm
EXPOSE 5000

But now the osrm-extract command is throwing an error:

osrm-extract: error while loading shared libraries: libboost_program_options.so.1.67.0: cannot open shared object file: No such file or directory
ERROR: Service 'osrm-server' failed to build: The command '/bin/sh -c osrm-extract -p /opt/car.lua berlin-latest.osm.pbf' returned a non-zero code: 127

We tested the same Dockerfile + Docker-compose on another machine and it works there, does anybody now how to fix it?

@goggel
Copy link

goggel commented Dec 6, 2018

Same problem with Docker Version 2.0.0.0-mac81 (29211) (Engine: 18.09.0) and osrm/osrm-backend:latest 349bb0747a29 without further configuration.

@patreu22
Copy link
Author

patreu22 commented Dec 6, 2018

Please keep me informed if you make any new progress. I tried to uninstall and reinstall Docker, but it didn't help. My setup is equal to yours, I'm also working on a Mac machine.

I think it would be really great to get some help by some core developers here :)

@goggel
Copy link

goggel commented Dec 6, 2018

Using tag v5.20.0 fixes the problem and i would guess that switching the image to debian (f978900) causes the issue.
I'm a bit confused that latest is not the latest relase but seems to be the current master. Would it not make sense to point latest to the lastest release and use a tag develop/beta/master or something similar for current developments.

@eguarc
Copy link

eguarc commented Dec 6, 2018

I have deployed again forcing the tag to v5.20.0 and it works fine.

TAG:
osrm/osrm-backend:v5.20.0@sha256:23c75d40c83b287476e0ea0883dfe7c06c3d54302d41df343c36079b8a06f36e

thanks!

@patreu22
Copy link
Author

patreu22 commented Dec 6, 2018

Also did the trick for me, v5.20.0 works! For anybody following up that workaround: Keep in mind that you have to use apk instead of apt-get and Shell instead of Bash.
I'll keep that issue open so maybe some of the developers are interested into tracking down that bug.

Thx @goggel :)

@Stan92
Copy link

Stan92 commented Dec 7, 2018

Hi @patreu22
I follow the different step you said. I was able to create the image but running the docker-compose, I got errors like Missing/broken files : france-latest-osrm.osrm.ramIndex, france-latest-osrm.osrm.fileIndex, etc... with a final message "required files are missing".

my dockerfile looks like :

FROM osrm/osrm-backend:v5.20.0
RUN apk update
RUN apk add ca-certificates wget && update-ca-certificates
RUN wget http://download.geofabrik.de/europe/france-latest.osm.pbf
RUN osrm-extract -p /opt/car.lua france-latest.osm.pbf
RUN osrm-partition france-latest.osrm
RUN osrm-customize france-latest.osrm
EXPOSE 5000

and my compose file

version: '3'
services:
  osrm-server:
    image: ssr-osrm-backend2
    build: 
      context: .
      dockerfile: Dockerfile
    ports:
      - "5000:5000"
    command: sh -c "osrm-routed --algorithm mld france-latest-osrm"

I do admit, I m new to docker. I suppose I missed something..

@patreu22
Copy link
Author

patreu22 commented Dec 7, 2018

Could you try osrm/osrm-backend:v5.20.0 as the image in the docker-compose for the osrm-server? That's the primary difference I can spot on the first look.

@Stan92
Copy link

Stan92 commented Dec 7, 2018

Could you try osrm/osrm-backend:v5.20.0 as the image in the docker-compose for the osrm-server? That's the primary difference I can spot on the first look.

it was a mistake.

RUN osrm-partition france-latest.osm
RUN osrm-customize france-latest.osm

instead of

RUN osrm-partition france-latest.osrm
RUN osrm-customize france-latest.osrm

and

command: sh -c "osrm-routed --algorithm mld france-latest.osm"
instead of
command: sh -c "osrm-routed --algorithm mld france-latest-osrm"

Thanks.

@moraisaugusto
Copy link

I tried with the current version(3d781e6f28242623e45ff3c8da27a0122012e52d) and got the same error(lib not found). With v5.20.0@sha256:23c75d40c83b287476e0ea0883dfe7c06c3d54302d41df343c36079b8a06f36e worked fine.

tip: I tried to create a symlink from libboost_program_options.so.1.67.0 to libboost_program_options.so.1.68.0 but didn't work too.

@chesty
Copy link

chesty commented Dec 12, 2018

It looks like the build stage installs libboost-all-dev which installs libboost 1.67, and the run stage installs libboost 1.62.

@xydinesh
Copy link
Contributor

I can't reproduce this error, I used same Dockerfile from the above.

FROM osrm/osrm-backend
RUN apt-get update
RUN apt-get install -y wget
RUN wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
RUN osrm-extract -p /opt/car.lua berlin-latest.osm.pbf
RUN osrm-partition berlin-latest.osrm
RUN osrm-customize berlin-latest.osrm
EXPOSE 5000
docker build -t xydinesh/osrm5294 .
[info] Unreachable nodes statistics per level
[warn] Level 1 unreachable boundary nodes per cell: 0.00272232 sources, 0.000907441 destinations
[warn] Level 2 unreachable boundary nodes per cell: 0.0238095 sources, 0 destinations
[warn] Level 3 unreachable boundary nodes per cell: 0.166667 sources, 0 destinations
[info] MLD customization writing took 0.018387 seconds
[info] Graph writing took 0.015086 seconds
[info] RAM: peak bytes used: 80490496
Removing intermediate container 03bca878550e
 ---> a0f618ef2243
Step 8/8 : EXPOSE 5000
 ---> Running in 2af80c205099
Removing intermediate container 2af80c205099
 ---> 1f551921c16d
Successfully built 1f551921c16d
Successfully tagged xydinesh/osrm5294:latest

@xydinesh
Copy link
Contributor

I tried with following docker-compose too. I can't reproduce this issue

version: '3'
services:
  osrm-server:
    image: xydinesh/osrm5294:compose
    build:
      context: .
      dockerfile: Dockerfile.osrm
    ports:
      - 5000:5000
    command: bash -c "osrm-routed --algorithm mld berlin-latest.osrm"
docker-compose up --force-recreate
Successfully tagged xydinesh/osrm5294:compose
WARNING: Image for service osrm-server was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating tmp_osrm-server_1 ... done
Attaching to tmp_osrm-server_1
osrm-server_1  | [info] starting up engines, v5.20.0
osrm-server_1  | [info] Threads: 4
osrm-server_1  | [info] IP address: 0.0.0.0
osrm-server_1  | [info] IP port: 5000
osrm-server_1  | [info] http 1.1 compression handled by zlib version 1.2.11
osrm-server_1  | [info] Listening on: 0.0.0.0:5000
osrm-server_1  | [info] running and waiting for requests

@xydinesh
Copy link
Contributor

xydinesh commented Dec 13, 2018

@patreu22 Did you try changing image name in the docker-compose ? It doesn't look right to me.

  osrm-server:
    image: osrm/osrm-backend

Because docker-compose suppose to create an image with this name, also it has the same name as the osrm image name Dockerfile.osrm pulls from docker hub.

According to docker-compose#build

If you specify image as well as build, then Compose names the built image with the webapp and optional tag specified in image:

@chesty
Copy link

chesty commented Dec 13, 2018

Thanks @xydinesh, fair enough that you can't reproduce the issue, but is it intentional to build with libboost 1.67 in the build stage then install 1.62 in the run stage? that seems weird.

@C4ptainCrunch
Copy link

C4ptainCrunch commented Dec 13, 2018

I also have the issue on a fresh install of my machine (docker was installed 5 min ago)

docker run -t -v $(pwd):/host osrm/osrm-backend osrm-extract -p /host/new.lua /host/data/belgium-latest.osm.pbf
osrm-extract: error while loading shared libraries: libboost_program_options.so.1.67.0: cannot open shared object file: No such file or directory

Here is the result of docker image ls

REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
docker.io/osrm/osrm-backend   latest              447cbd68b3b6        45 hours ago        152 MB

Edit: i pinned the version to v5.20.0 and it works. Seems that latest is the only version causing a problem.

@xydinesh
Copy link
Contributor

@chesty No, It was not intentional. Let's pin everything to one version. I will send a pull request with a fix.

@ImreSamu
Copy link

@xydinesh : my proposal ImreSamu@3c36326 you can resuse/adapt/drop ... ;)

@danpat
Copy link
Member

danpat commented Dec 15, 2018

Will be fixed in 5.21 by #5311, thanks @xydinesh

@danpat danpat closed this as completed Dec 15, 2018
@oncream
Copy link

oncream commented Aug 18, 2020

Sorry for being late.
I solved this problem on my linux system.
This is a security issue, check selinux,
Run setenforce 0 to temporarily close selinux

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