neo4j/docker-neo4j

Images seem to break on a regular basis

adadgio opened this issue · 5 comments

Guidelines

Images do not seem to be stable, two examples. We use images in github actions like such :

neo4j:4.2.4
or
neo4j:latest

With the following setup

services:
      neo4j:
        image: neo4j:4.2.4
        env:
          NEO4J_ACCEPT_LICENSE_AGREEMENT: yes
          NEO4J_AUTH: "neo4j/abcde"
          NEO4JLABS_PLUGINS: '["graph-data-science", "apoc"]'
        options: >-
          --name neo4j-e2e
          --health-cmd "cypher-shell -u neo4j -p abcde 'RETURN 1'"
          --health-interval 10s
          --health-timeout 5s
          --health-start-period 10s
          --health-retries 5
        ports:
          - 7687:7687
       cyphershell:
        image: neo4jbuildservice/cypher-shell-build
        env:
          NEO4J_AUTH: "neo4j/abcde"

One day, the image works, the other days, we can get the following errors without changing anything in our code

With neo4j:4.2.4 : Error: Failed to initialize, neo4j service is unhealthy.
With neo4j:latest: apoc.xxx procedure not found

@adadgio neo4j:latest will always point to the latest neo4j release. For example, today it is pointing at 5.1, once 5.2 is released, it will then point to that image.

I'm not sure what the error is that you are seeing as they appear to be from two different issues. Is this correct?

With neo4j:4.2.4 : Error: Failed to initialize, neo4j service is unhealthy.

Seems odd as Neo4j is not a service inside the container. Where is this message coming from? Is this the error from Github actions when running it's own health check?

With neo4j:latest: apoc.xxx procedure not found

That looks like apoc has not been installed. But this is using the image neo4j:latest. I'll test this out to make sure it is installed on my local setup.

Screenshot 2022-10-31 at 13 57 22

@sirReeall Two different issues indeed. Sure, seems logical with the latest release. What I don't understand is why there would be a difference with a fixed version.

It is running from a github action indeed. Last time the healthcheck failed on a fixed version, I bumped it up to the next minot version and it resolved... and then the same issue came up a few days later (on said fixed version). Maybe its the number of wait seconds to do the healthcheck...

@adadgio I tested out neo4j:latest with apoc and this installed correctly. One thing to note is there is a change in Neo4j 5 with apoc. Only the core procedures are available in the apoc jar and I wonder if the "With neo4j:latest: apoc.xxx procedure not found" error is from a procedure that this now in the extended library.

Here is the list for Neo4j 5 Apoc Core: https://neo4j.com/docs/apoc/current/overview/

Here is the list for Neo4j 5 Apoc Extended: https://neo4j.com/labs/apoc/5/overview/

With regards to the other issue "With neo4j:4.2.4 : Error: Failed to initialize, neo4j service is unhealthy." Do you know if Github actions caches the previously run container? or are these always deployed from a vanilla image?

Good to know about apoc, yes, that's the problem it seems. I wonder how you install the extended procedures now... I'll look into it.

I don't think github caches anything by defaut.

Also, it's worth knowing that neo4jbuildservice/cypher-shell-build is NOT a documented image, it's used internally in our build system and doesn't contain any cypher-shell executables. You aren't going to have any success using that image.

If you want to use cypher-shell you have to use the neo4j image and set the command cypher-shell instead. EG
docker run -p 7474:7474 -p 7687:7687 neo4j:4.4 cypher-shell <ARGUMENTS>