# Using official Osmimis pro image + aws S3 plugin + minio = curlCode: 6, Couldn't resolve host name

**URL:** https://discourse.orthanc-server.org/t/using-official-osmimis-pro-image-aws-s3-plugin-minio-curlcode-6-couldnt-resolve-host-name/2511
**Category:** Google Groups archive
**Created:** [July 6, 2021, 12:02pm UTC](https://discourse.orthanc-server.org/t/using-official-osmimis-pro-image-aws-s3-plugin-minio-curlcode-6-couldnt-resolve-host-name/2511 "2021-07-06T12:02:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Darren\_Gallagher](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/d/258eb7/32.png) [@Darren\_Gallagher](https://discourse.orthanc-server.org/u/Darren_Gallagher)
#### Post date: [July 6, 2021, 12:02pm UTC](https://discourse.orthanc-server.org/t/using-official-osmimis-pro-image-aws-s3-plugin-minio-curlcode-6-couldnt-resolve-host-name/2511/1 "2021-07-06T12:02:47Z")

</div>

Hi,

I’m testing the version 1.3.0 of the plugin in the Docker images 21.6.2, with an entirely local setup using Docker compose with local PostgreSQL and local Minio.

docker inspect [osimis.azurecr.io/orthanc-pro:latest](http://osimis.azurecr.io/orthanc-pro:latest)

[

{

“Id”: “sha256:fcc0462f61f4884eb579213e79d27c854301906868a194e80a5450d5997b8081”,

“RepoTags”: [

“[osimis.azurecr.io/orthanc-pro:latest](http://osimis.azurecr.io/orthanc-pro:latest)”

],

“RepoDigests”: [

[osimis.azurecr.io/orthanc-pro@sha256:c9b3c48b0349570dc4fa79c114532e805dbaba04f959bf2f1eb9cd9d81bfebe7](mailto:osimis.azurecr.io/orthanc-pro@sha256:c9b3c48b0349570dc4fa79c114532e805dbaba04f959bf2f1eb9cd9d81bfebe7)

],

“Parent”: “”,

“Comment”: “”,

“Created”: “2021-06-29T10:19:19.783689535Z”,

“Container”: “0a978e7c137109ec582e791f9fa7bfde7eeefa455eb4352302299b9e494e4d82”,

Using the docs here:

[https://book.orthanc-server.com/plugins/object-storage.html#emulation-of-aws-s3-using-minio](https://book.orthanc-server.com/plugins/object-storage.html#emulation-of-aws-s3-using-minio)

[Please note that MINIO\_ACCESS\_KEY and MINIO\_SECRET\_KEY have been deprecated in favour of MINIO\_ROOT\_USER and MINIO\_ROOT\_PASSWORD. See [https://docs.min.io/docs/minio-docker-quickstart-guide.html](https://docs.min.io/docs/minio-docker-quickstart-guide.html)]

My docker-compose has the following configuration for the Orthanc container (this is derived from the [osimis.azurecr.io/orthanc-pro:latest](http://osimis.azurecr.io/orthanc-pro:latest) image but with some additional python modules being pip installed.

container\_name: my-orthanc

build:

context: .

dockerfile: Dockerfile

cache\_from:

- [osimis.azurecr.io/orthanc-pro](http://osimis.azurecr.io/orthanc-pro)

volumes:

- ./python/:/python

- /tmp/orthanc-db/:/var/lib/orthanc/db/

networks:

local:

environment:

- VERBOSE\_ENABLED=false

- DEFAULT\_LOG\_LEVEL=INFO

- DICOM\_WEB\_PLUGIN\_ENABLED=true

- ORTHANC\_\_PYTHON\_SCRIPT=“/python/main.py”

- ORTHANC\_\_PYTHON\_VERBOSE=false

- AWS\_ACCESS\_KEY\_ID=${AWS\_ACCESS\_KEY\_ID}

- AWS\_SECRET\_ACCESS\_KEY=${AWS\_SECRET\_ACCESS\_KEY}

- AWS\_DEFAULT\_REGION=${AWS\_DEFAULT\_REGION}

- POSTGRESQL\_PLUGIN\_ENABLED=true

- ORTHANC\_\_POSTGRESQL\_\_ENABLE\_INDEX=true

- ORTHANC\_\_POSTGRESQL\_\_ENABLE\_STORAGE=false

- ORTHANC\_\_POSTGRESQL\_\_ENABLE\_SSL=false

- ORTHANC\_\_POSTGRESQL\_\_HOST=postgres

- ORTHANC\_\_POSTGRESQL\_\_PORT=5432

- ORTHANC\_\_POSTGRESQL\_\_DATABASE=orthanc

- ORTHANC\_\_POSTGRESQL\_\_USERNAME=postgres

- ORTHANC\_\_POSTGRESQL\_\_PASSWORD=foobar

- ORTHANC\_\_AWS\_S3\_STORAGE\_\_BUCKET\_NAME=platform-local-orthanc-files

- ORTHANC\_\_AWS\_S3\_STORAGE\_\_REGION=eu-west-2

- ORTHANC\_\_AWS\_S3\_STORAGE\_\_ACCESS\_KEY=

- ORTHANC\_\_AWS\_S3\_STORAGE\_\_SECRET\_KEY=

- ORTHANC\_\_AWS\_S3\_STORAGE\_\_VIRTUALADDRESSING=false

- ORTHANC\_\_AWS\_S3\_STORAGE\_\_ENDPOINT=[http://minio:9000/](http://minio:9000/)

secrets:

- orthanc.secret.json

restart: unless-stopped

minio:

command: “server /data”

container\_name: orthanc-minio

image: minio/minio

ports: [9000:9000]

networks:

local:

environment:

- MINIO\_REGION= eu-west-2

- MINIO\_ROOT\_USER=

- MINIO\_ROOT\_PASSWORD=

volumes:

- ./localstorage/minio:/data

restart: unless-stopped

When I then try to POST an instance into the server I receive the following error:

my-orthanc | 2021-07-06T10:37:20.266188600Z E0706 10:37:20.266046 PluginsManager.cpp:197] Exception while invoking plugin service 3002: Error in the plugin implementing a custom storage area

my-orthanc | 2021-07-06T10:37:20.265914200Z E0706 10:37:20.265640 PluginsManager.cpp:164] AWS S3 Storage: error while creating object 46fadded-bec5-45c3-ada5-93164e8e8da7: error while writing file 46fadded-bec5-45c3-ada5-93164e8e8da7.dcm: curlCode: 6, Couldn’t resolve host name

my-orthanc | 2021-07-06T10:37:20.266771800Z E0706 10:37:20.266593 PluginsManager.cpp:164] Error in the REST callback, traceback:

my-orthanc | 2021-07-06T10:37:20.266816900Z \<class ‘ValueError’\>

my-orthanc | 2021-07-06T10:37:20.266826900Z Internal error

my-orthanc | 2021-07-06T10:37:20.266830400Z

my-orthanc | 2021-07-06T10:37:20.266832900Z File “/python/rest.py”, line 179, in OnRestInstances

my-orthanc | 2021-07-06T10:37:20.266836800Z coreApiResponse = orthanc.RestApiPost(“/instances”, request[“body”])

my-orthanc | 2021-07-06T10:37:20.266841400Z

my-orthanc | 2021-07-06T10:37:20.266845400Z E0706 10:37:20.266693 PluginsErrorDictionary.cpp:111] Exception inside the plugin engine: Error encountered within the plugin engine

orthanc-nginx | 2021-07-06T10:37:20.267511600Z 172.27.0.1 - - [06/Jul/2021:10:37:20 +0000] “POST /instances HTTP/1.1” 500 291 “-” “curl/7.68.0” “-”

To debug this I connected to the Orthanc container (docker container exec -it my-orthanc /bin/bash) and used the python REPL to test that boto3 can talk to the minio instance from the Orthance container:

root@f481526c1de2:/# export AWS\_ACCESS\_KEY\_ID=

root@f481526c1de2:/# export AWS\_SECRET\_ACCESS\_KEY=

root@f481526c1de2:/# python3

Python 3.7.3 (default, Jan 22 2021, 20:04:44)

[GCC 8.3.0] on linux

Type “help”, “copyright”, “credits” or “license” for more information.

> > > import boto3

> > > s3 = boto3.resource(‘s3’, endpoint\_url=[http://minio:9000](http://minio:9000))

> > > bucket = s3.Bucket(‘testbucket’)

> > > file\_list = [s.key for s in list(bucket.objects.all())]

> > > print(file\_list)

[‘ML Workflow.jpg’, ‘patch.diff’]

We have had the S3 plugin working on earlier versions of the Osimis image using AWS cloud backend (e.g not minio). The new ENV VAR that I have added in local docker-compose setup are:

ORTHANC\_\_AWS\_S3\_STORAGE\_\_VIRTUALADDRESSING=false

ORTHANC\_\_AWS\_S3\_STORAGE\_\_ENDPOINT=[http://minio:9000/](http://minio:9000/)

Has anyone else successfully used minio with Orthanc via docker-compose? Is this related to something new in the 21.6.2 release? [Bitbucket](https://bitbucket.org/osimis/orthanc-builder/src/master/release-notes-docker-images.txt)

Anything else I can try?

Is the source code to the official S3 plugin available anywhere?

Thanks in advance

Darren

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [July 6, 2021, 4:59pm UTC](https://discourse.orthanc-server.org/t/using-official-osmimis-pro-image-aws-s3-plugin-minio-curlcode-6-couldnt-resolve-host-name/2511/2 "2021-07-06T16:59:16Z")

</div>

Hello Darren,

After a very long investigation, I think I have spotted the error… that seems to be a simple typo. From your original post:

_On Tuesday, July 6, 2021 at 2:02:47 PM UTC+2 [daz...@gmail.com](mailto:daz...@gmail.com) wrote:_

_I’m testing the version 1.3.0 of the plugin in the Docker images 21.6.2, with an entirely local setup using Docker compose with local PostgreSQL and local Minio. […]_  
_ **- ORTHANC\_\_AWS\_S3\_STORAGE\_\_VIRTUALADDRESSING=false** _  
_- ORTHANC\_\_AWS\_S3\_STORAGE\_\_ENDPOINT=[http://minio:9000/](http://minio:9000/)_

=\> You use the environment variable “ORTHANC\_\_AWS\_S3\_STORAGE\_\_VIRTUALADDRESSING”, but you should use “ORTHANC\_\_AWS\_S3\_STORAGE\_\_VIRTUAL\_ADDRESSING” (note the missing underscore between “virtual” and “addressing”).

The explanation about how to map some configuration option (in the present case, “VirtualAddressing” in section “AwsS3Storage”) to an environment variable of the “osimis/orthanc” images is given in the Orthanc Book:

[https://book.orthanc-server.com/users/docker-osimis.html#environment-variables](https://book.orthanc-server.com/users/docker-osimis.html#environment-variables)

Please could you give a try?

Regards,  
Sébastien-
