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

Running mongodb plugin inside docker container #25

Open
MateuszSkalka opened this issue Oct 16, 2020 · 9 comments
Open

Running mongodb plugin inside docker container #25

MateuszSkalka opened this issue Oct 16, 2020 · 9 comments

Comments

@MateuszSkalka
Copy link

Hello everyone,
I succesfully compiled a docker image with orthanc-mongodb installed inside, when I try to run the container with a custom configuration I encountered an error (from the bash inside docker container):

W1016 20:29:34.006603 main.cpp:821] Loading plugin(s) from: /root/orthanc-mongodb/build/libOrthancMongoDBIndex.so
W1016 20:29:34.065896 PluginsManager.cpp:269] Registering plugin 'MongoDBIndex' (version 1.5.7)
free(): invalid pointer
Aborted (core dumped)

rest of the plugins register properly.

My Dockerfile:

FROM jodogne/orthanc-plugins:1.8.0
RUN apt-get update
RUN apt -y install build-essential unzip cmake make libsasl2-dev uuid-dev libssl-dev zlib1g-dev git curl
RUN apt -y install python

RUN curl -L --output orthanc.tar.gz https://www.orthanc-server.com/downloads/get.php?path=/orthanc/Orthanc-1.5.7.tar.gz
RUN tar -xzf orthanc.tar.gz

RUN git clone https://github.com/Doc-Cirrus/orthanc-mongodb.git
RUN mkdir orthanc-mongodb/build
&& cd orthanc-mongodb/build
&& cmake -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DORTHANC_ROOT=/root/Orthanc-1.5.7 -DAUTO_INSTALL_DEPENDENCIES=ON ..
&& make

RUN rm /etc/orthanc/orthanc.json
COPY "./orthanc-conf.json" "/etc/orthanc/orthanc-conf.json"

EXPOSE 4242
EXPOSE 8042

ENTRYPOINT ["Orthanc", "/etc/orthanc/orthanc-conf.json"]

part of the json configuration file that cousing the problem:

"Plugins" : [
"/usr/local/share/orthanc/plugins/",
"/root/orthanc-mongodb/build/libOrthancMongoDBIndex.so",
"/root/orthanc-mongodb/build/libOrthancMongoDBStorage.so"
],

"MongoDB" : {
"EnableIndex" : true, // false to use default SQLite
"EnableStorage" : true, // false to use default SQLite
"ConnectionUri" : "mongodb://localhost:27017/orthanc_db",
"ChunkSize" : 261120
},

the error occures no matter witch version of orthanc-plugins image i compile with.

Thanks,
Mateusz Skalka

@kosch
Copy link
Contributor

kosch commented Oct 18, 2020

Thats possible, we're a bit behind with Orthanc usage currently. We're using 1.5.8, we're gonna switch to 1.7.4 till the end of October. So at that point this plugin is tested based on 1.7 Orthanc. Maybe end of November we're switch to 1.8 Orthanc. A bit patience is needed ;-)

@MateuszSkalka
Copy link
Author

Hi,
After chaning Orthanc to version 1.5.8 the same error occures. Is this possibe that something other causes the error?

@kosch
Copy link
Contributor

kosch commented Oct 19, 2020

Maybe MongoDB version, we're still using 3.6.

@MateuszSkalka
Copy link
Author

I use MongoDB database which I previously succesfully connected to Orhanc when it wasn't containerized, so i think it can't be the problem

@Betalos
Copy link
Contributor

Betalos commented Oct 19, 2020

@MateuszSkalka could you tell me you env versions (mongo, orthanc, os).
and which version on the pluging you downloaded

@MateuszSkalka
Copy link
Author

The mongoDB version we're using: v4.0.20

I tested and installed the plugins using four different versions of jodogne/orthanc-plugins image from dockerhub, 1.8.0, 1.7.4 , 1.5.8 and 1.5.7, each one gave me similar error, segmentation fault on older versions and invalid pointer on versions 1.8 and 1.7.4

I'm pulling source code from master branch of orthanc-mongodb repository and install rest of the plugins with -DAUTO_INSTALL_DEPENDENCIES=ON

@Betalos
Copy link
Contributor

Betalos commented Oct 20, 2020

OK I see.
try this repo https://github.com/Betalos/orthanc-mongodb and also I'm not sure about the DAUTO_INSTALL_DEPENDENCIES=ON I have not used it so try to install the deps manually (readme section).
The plugin I have it up and running with 1.8.0/1.7.*.
I would suspect it's a 'jodogne/orthanc-plugins image from dockerhub' related, try to build everything yourself just to be sure.

@ihor-mozil
Copy link
Contributor

I'm able to reproduce this with jodogne base image, however the 1.5.8 version prduces different seg fault that relates to open ssl initialization, the 1.8.0 version segfaults when trying to parse the Orthanc configuration. I'm not sure I'll be able to figure this out. If I find anything I'll post here.
Manual installation on CentOS looks like working.

@ihor-mozil
Copy link
Contributor

ihor-mozil commented Oct 20, 2020

New branch orthanc-1.8.0 has been created. The parsing issue was fixed. I don't know exactly what it was. It looks like the deprecated jsoncpp methods causes some issues with the newer g++ v8.

Please try this Docker file. It works for me good.

FROM jodogne/orthanc-plugins:1.8.0
RUN apt-get update
RUN apt -y install build-essential unzip cmake make libsasl2-dev uuid-dev libssl-dev zlib1g-dev git curl
RUN apt -y install python

RUN curl -L --output orthanc.tar.gz https://www.orthanc-server.com/downloads/get.php?path=/orthanc/Orthanc-1.5.7.tar.gz
RUN tar -xzf orthanc.tar.gz

RUN git clone -b orthanc-1.8.0 https://github.com/Doc-Cirrus/orthanc-mongodb.git
RUN mkdir orthanc-mongodb/build && cd orthanc-mongodb/build && cmake -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DORTHANC_ROOT=/root/Orthanc-1.5.7 -DAUTO_INSTALL_DEPENDENCIES=ON .. && make

RUN rm /etc/orthanc/orthanc.json
COPY "./orthanc-conf.json" "/etc/orthanc/orthanc-conf.json"

EXPOSE 4242
EXPOSE 8042

ENTRYPOINT ["Orthanc", "/etc/orthanc/"]

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

4 participants