neo4j / docker-neo4j

Docker Images for the Neo4j Graph Database
Apache License 2.0
336 stars 171 forks source link

Error using or configuring APOC in GithubAction #424

Closed AdrianPardo99 closed 1 year ago

AdrianPardo99 commented 1 year ago

Guidelines

Error trying to install neo4j:4.4.9 and using APOC plugin in gitaction

To help us understand your issue, please specify important details, primarily:

neo4j.exceptions.CypherSyntaxError: {code: Neo.ClientError.Statement.SyntaxError} {message: Unknown function 'apoc.convert.toJson'
jobs:
  test:
    runs-on: ubuntu-latest
    services: # Service containers to run with `test`
      # Label used to access the service container
      neo4j:
        # Docker Hub image
        image: neo4j:4.4.9
        # Provide the password for neo4j
        env:
          NEO4J_AUTH: "neo4j/neo4j_password"
          NEO4J_dbms_connector_bolt_enabled: "true"
          NEO4J_dbms_connector_bolt_advertised__address: localhost:7687
          NEO4JLABS_PLUGINS: "['apoc']"
        ports:
          - 7687:7687

Is missing something in my configuration or I'm losing something for configuration?

jennyowen commented 1 year ago

@AdrianPardo99 I think it's due to the quoting you have around NEO4JLABS_PLUGINS: "['apoc']"

The value "['apoc']" is piped straight into jq to interpret what plugins have been requested. So testing your NEO4JLABS_PLUGINS value...

echo "['apoc']" | jq
parse error: Invalid numeric literal at line 1, column 8

so that error message, or something similar, probably shows up somewhere in your docker logs. If I swap over the quote type, then it works:

echo '["apoc"]' | jq
[
  "apoc"
]

The documentation could possibly be clearer, but there are at least some examples to copy: https://neo4j.com/docs/operations-manual/current/docker/operations/#docker-neo4j-plugins