# Unable to get Docker + HTTPS working

**URL:** <https://community.neo4j.com/t/unable-to-get-docker-https-working/30035>\
**Category:** Neo4j Graph Platform\
**Tags:** operations\
**Created:** [December 3, 2020, 10:18am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035 "2020-12-03T10:18:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.the](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.the/32/4308_2.png) [@michael.the](https://community.neo4j.com/u/michael.the)\
**Post date:** [December 3, 2020, 10:18am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035/1 "2020-12-03T10:18:48Z")

</div>

Hi,

We want to use docker to run neo4j 4.1.1 and have SSL enabled. However, neo4j will not run with these settings. The specific error we get is:

```auto
ERROR Failed to start Neo4j on dbms.connector.http.listen_address, a socket address. If missing port or hostname it is acquired from dbms.default_listen_address. Error starting Neo4j database server at /data/databases

```

The following command is used to spin up the docker container (the image comes from docker hub):

```bash
#!/bin/bash
groups=( $( id --real --groups neo4j ) )
docker run \
        --interactive \
        --detach \
        --name=neo4j411 \
        --publish=7687:7687 \
        --publish=7473:7473 \
        --publish=7474:7474 \
        --volume=/appl/neo4j/conf:/conf \
        --volume=/appl/neo4j/plugins:/plugins \
        --volume=/appl/neo4j/logs:/logs \
        --volume=/appl/neo4j/data:/data \
        --volume=/appl/mnt/:/import \
        --volume=/appl/neo4j/export:/export \
        --volume=/appl/neo4j/ssl:/ssl \
        --user="$(id -u neo4j):$(id -g neo4j)" \
        --group-add=$groups \
        --env TZ='Europe/Amsterdam' \
        --env NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.* \
        --env NEO4J_dbms_security_procedures_whitelist=gds.*,apoc.* \
        --env NEO4J_dbms_memory_heap_initial__size=31G \
        --env NEO4J_dbms_memory_heap_max__size=31G \
        --env NEO4J_dbms_memory_pagecache_size=135G \
        --env NEO4J_dbms_ssl_policy_bolt_enabled=true \
        --env NEO4J_dbms_ssl_policy_bolt_base__directory=/ssl/bolt \
        --env NEO4J_dbms_ssl_policy_bolt_private__key=private.key \
        --env NEO4J_dbms_ssl_policy_bolt_public__certificate=certificate.csr \
        --env NEO4J_dbms_ssl_policy_bolt_client__auth=NONE \
        --env NEO4J_dbms_ssl_policy_https_enabled=true \
        --env NEO4J_dbms_ssl_policy_https_base__directory=/ssl/https \
        --env NEO4J_dbms_ssl_policy_https_private__key=private.key \
        --env NEO4J_dbms_ssl_policy_https_public__certificate=certificate.csr \
        --env NEO4J_dbms_ssl_policy_https_client__auth=NONE \
        --env NEO4J_dbms_connector_http_enabled=true \
        --env NEO4J_dbms_connector_https_enabled=true \
        --env NEO4J_dbms_connector_bolt_tls__level=REQUIRED \
        neo4j:latest /bin/bash

```

Which results in the following log entries in neo4j.log:

```auto
2020-11-27 14:13:19.274+0000 INFO Starting...
2020-11-27 14:13:21.817+0000 INFO ======== Neo4j 4.1.1 ========
2020-11-27 14:13:31.478+0000 ERROR Failed to start Neo4j on dbms.connector.http.listen_address, a socket address. If missing port or hostname it is acquired from dbms.default_listen_address. Error starting Neo4j database server at /data/databases
java.lang.RuntimeException: Error starting Neo4j database server at /data/databases
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:198)
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:158)
        at org.neo4j.server.CommunityBootstrapper.createNeo(CommunityBootstrapper.java:36)
        at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:117)
        at org.neo4j.server.NeoBootstrapper.start(NeoBootstrapper.java:87)
        at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:35)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.procedure.impl.GlobalProceduresRegistry@536d97f8' was successfully initialized, but failed to start. Please see the attached cause exception "Unable to set up injection for procedure `GraphGenerateProc`, the field `tracker` has type `interface org.neo4j.graphalgo.core.utils.mem.AllocationTracker` which is not a known injectable component.".
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:463)
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:110)
        at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:189)
        ... 5 more
Caused by: org.neo4j.kernel.api.exceptions.ComponentInjectionException: Unable to set up injection for procedure `GraphGenerateProc`, the field `tracker` has type `interface org.neo4j.graphalgo.core.utils.mem.AllocationTracker` which is not a known injectable component.
        at org.neo4j.procedure.impl.FieldInjections.createInjector(FieldInjections.java:98)
        at org.neo4j.procedure.impl.FieldInjections.setters(FieldInjections.java:81)
        at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:264)
        at org.neo4j.procedure.impl.ProcedureCompiler.compileProcedure(ProcedureCompiler.java:226)
        at org.neo4j.procedure.impl.ProcedureJarLoader.loadProcedures(ProcedureJarLoader.java:114)
        at org.neo4j.procedure.impl.ProcedureJarLoader.loadProceduresFromDir(ProcedureJarLoader.java:85)
        at org.neo4j.procedure.impl.GlobalProceduresRegistry.start(GlobalProceduresRegistry.java:342)
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:442)
        ... 7 more
2020-11-27 14:13:31.479+0000 INFO Neo4j Server shutdown initiated by request

```

Without SSL, using the following docker command, we are able to get everything up and running:

```bash
docker run \
        --interactive \
        --detach \
        --name=neo4j411 \
        --publish=7687:7687 \
        --publish=7473:7473 \
        --publish=7474:7474 \
        --volume=/appl/neo4j/conf:/conf \
        --volume=/appl/neo4j/plugins:/plugins \
        --volume=/appl/neo4j/logs:/logs \
        --volume=/appl/neo4j/data:/data \
        --volume=/appl/mnt/:/import \
        --volume=/appl/neo4j/export:/export \
        --volume=/appl/neo4j/ssl:/ssl \
        --user="$(id -u neo4j):$(id -g neo4j)" \
        --group-add=$groups \
        --env TZ='Europe/Amsterdam' \
        --env NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.* \
        --env NEO4J_dbms_security_procedures_whitelist=gds.*,apoc.* \
        --env NEO4J_dbms_memory_heap_initial__size=31G \
        --env NEO4J_dbms_memory_heap_max__size=31G \
        --env NEO4J_dbms_memory_pagecache_size=135G \
        neo4j:latest /bin/bash

```

Your help is much appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![rweverwijk](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rweverwijk/32/18973_2.png) [@rweverwijk](https://community.neo4j.com/u/rweverwijk)\
**Post date:** [December 8, 2020, 10:15am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035/2 "2020-12-08T10:15:12Z")

</div>

Hi @michael.the

I see your question is open for too long, sorry about that.  
Welcome to the Neo4j Community (say hi to Mario for me ;) )

I haven't experienced this before, looking at your stacktrace my first try would be starting without all the plugins. The stack points to the `GraphGenerateProc` as cause of this issue.

Can you please check this:

```bash
groups=( $( id --real --groups neo4j ) )
docker run \
        --interactive \
        --detach \
        --name=neo4j411 \
        --publish=7687:7687 \
        --publish=7473:7473 \
        --publish=7474:7474 \
        --volume=/appl/neo4j/conf:/conf \
        --volume=/appl/neo4j/logs:/logs \
        --volume=/appl/neo4j/data:/data \
        --volume=/appl/mnt/:/import \
        --volume=/appl/neo4j/export:/export \
        --volume=/appl/neo4j/ssl:/ssl \
        --user="$(id -u neo4j):$(id -g neo4j)" \
        --group-add=$groups \
        --env TZ='Europe/Amsterdam' \
        --env NEO4J_dbms_memory_heap_initial__size=31G \
        --env NEO4J_dbms_memory_heap_max__size=31G \
        --env NEO4J_dbms_memory_pagecache_size=135G \
        --env NEO4J_dbms_ssl_policy_bolt_enabled=true \
        --env NEO4J_dbms_ssl_policy_bolt_base__directory=/ssl/bolt \
        --env NEO4J_dbms_ssl_policy_bolt_private__key=private.key \
        --env NEO4J_dbms_ssl_policy_bolt_public__certificate=certificate.csr \
        --env NEO4J_dbms_ssl_policy_bolt_client__auth=NONE \
        --env NEO4J_dbms_ssl_policy_https_enabled=true \
        --env NEO4J_dbms_ssl_policy_https_base__directory=/ssl/https \
        --env NEO4J_dbms_ssl_policy_https_private__key=private.key \
        --env NEO4J_dbms_ssl_policy_https_public__certificate=certificate.csr \
        --env NEO4J_dbms_ssl_policy_https_client__auth=NONE \
        --env NEO4J_dbms_connector_http_enabled=true \
        --env NEO4J_dbms_connector_https_enabled=true \
        --env NEO4J_dbms_connector_bolt_tls__level=REQUIRED \
        neo4j:latest /bin/bash

```

Cheers,  
Ron

---

<div class="post-metadata">

**Author:** ![MarioLiebreks](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MarioLiebreks](https://community.neo4j.com/u/MarioLiebreks)\
**Post date:** [December 11, 2020, 8:44am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035/3 "2020-12-11T08:44:16Z")

</div>

It is unbelievable but moving the 2 plugins from the head of the --env list in the command to the tail, it worked out!!!

```bash
#!/bin/bash
groups=( $( id --real --groups neo4j ) )
docker run \
        --interactive \
        --detach \
        --name=neo4j411 \
        --publish=7687:7687 \
        --publish=7473:7473 \
        --publish=7474:7474 \
        --volume=/appl/neo4j/conf:/conf \
        --volume=/appl/neo4j/plugins:/plugins \
        --volume=/appl/neo4j/logs:/logs \
        --volume=/appl/neo4j/data:/data \
        --volume=/appl/mnt/:/import \
        --volume=/appl/neo4j/export:/export \
        --volume=/appl/neo4j/ssl:/ssl \
        --user="$(id -u neo4j):$(id -g neo4j)" \
        --group-add=$groups \
        --env TZ='Europe/Amsterdam' \
        --env NEO4J_dbms_memory_heap_initial__size=31G \
        --env NEO4J_dbms_memory_heap_max__size=31G \
        --env NEO4J_dbms_memory_pagecache_size=135G \
        --env NEO4J_dbms_ssl_policy_bolt_enabled=true \
        --env NEO4J_dbms_ssl_policy_bolt_base__directory=/ssl/bolt \
        --env NEO4J_dbms_ssl_policy_bolt_private__key=private.key \
        --env NEO4J_dbms_ssl_policy_bolt_public__certificate=certificate.csr \
        --env NEO4J_dbms_ssl_policy_bolt_client__auth=NONE \
        --env NEO4J_dbms_ssl_policy_https_enabled=true \
        --env NEO4J_dbms_ssl_policy_https_base__directory=/ssl/https \
        --env NEO4J_dbms_ssl_policy_https_private__key=private.key \
        --env NEO4J_dbms_ssl_policy_https_public__certificate=certificate.csr \
        --env NEO4J_dbms_ssl_policy_https_client__auth=NONE \
        --env NEO4J_dbms_connector_http_enabled=true \
        --env NEO4J_dbms_connector_https_enabled=true \
        --env NEO4J_dbms_connector_bolt_tls__level=REQUIRED \
        --env NEO4J_dbms_security_procedures_unrestricted=apoc.*,gds.* \
        --env NEO4J_dbms_security_procedures_whitelist=gds.*,apoc.* \
         neo4j:latest /bin/bash

```

---

<div class="post-metadata">

**Author:** ![rweverwijk](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/rweverwijk/32/18973_2.png) [@rweverwijk](https://community.neo4j.com/u/rweverwijk)\
**Post date:** [December 11, 2020, 9:59am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035/4 "2020-12-11T09:59:48Z")

</div>

Good to hear that Mario, although I cannot think of a reason why that would make a difference.

---

<div class="post-metadata">

**Author:** ![joanna.stefanska77](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/joanna.stefanska77/32/19878_2.png) [@joanna.stefanska77](https://community.neo4j.com/u/joanna.stefanska77)\
**Post date:** [September 1, 2021, 11:01am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035/5 "2021-09-01T11:01:14Z")

</div>

@MarioLiebreks @michael.the I'm trying to use your docker run command and it works nicely for the browser, but when I get inside the container and try to invoke cypher-shell command, it doesn't work :(  
[root@6d1516546a82 neo4j]# cypher-shell  
Connection to the database terminated. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.  
[root@6d1516546a82 neo4j]# cypher-shell --encryption=true  
Failed to establish secured connection with the server  
Error message in debug.log is  
2021-09-01 10:59:34.009+0000 ERROR [o.n.b.t.TransportSelectionHandler] Fatal error occurred when initialising pipeline: [id: 0xdbb6e8bd, L:/127.0.0.1:7687 ! R:/127.0.0.1:57400]  
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate\_unknown

Did you guys managed to get it working?

---

<div class="post-metadata">

**Author:** ![sam-som](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/sam-som/32/22761_2.png) [@sam-som](https://community.neo4j.com/u/sam-som)\
**Post date:** [March 2, 2022, 8:43am UTC](https://community.neo4j.com/t/unable-to-get-docker-https-working/30035/6 "2022-03-02T08:43:57Z")

</div>

There's a helpful note about this error on this blog post here [Getting Certificates for Neo4j with LetsEncrypt | by David Allen | Neo4j Developer Blog | Medium](https://medium.com/neo4j/getting-certificates-for-neo4j-with-letsencrypt-a8d05c415bbd)

Basically, the error is telling you that the cypher-shell command failed SSL validation.  
This is because cypher-shell will default to neo4j://localhost:7687 when --address is not supplied.  
To use cypher-shell after enabling SSL, you have to do "cypher-shell -u neo4j -a neo4j+s://{dns-from-your-certification}:7687.

Hope this help some other people in the future 🙂
