Can't connect to neo4j server during build

neo4j

#1

Hi,
I have a simple rails app built on top of neo4j db. In my circle.yml I defined the steps needed to set-up neo4j like this:

database: override: - rake neo4j:install[community-latest,test] - rake neo4j:config[test,7475] - rake neo4j:start[test]

During build, the db set-up seems to work fine:

rake neo4j:start[test]
Starting Neo4j test…
Starting Neo4j Server…WARNING: not changing user
process [11935]… waiting for server to be ready… OK.
http://localhost:7475/ is ready.

But when rspec starts to run, I get the following message:

connection refused: localhost:7475

When I ssh to the build machine, and take a look at the neo4j logs, I see the following:

Server started on: http://localhost:7475/
Remote interface ready and available at [http://localhost:7475/]
— SERVER STARTED END —
Neo4j Server shutdown initiated by request

So for some reason, it seems like neo4j is being shut-down before specs are run. If I start neo4j manually on the build machine using rake neo4j:start[test], and run rspec, all works as expected. I tried moving the rake start command to test->pre section of circle.yml, but that didn’t help.

Any idea what’s going on here?


#2

Is this related?


#3

Hi @mikemarsian,

Can you try starting neo4j by including it as a service in your circle.yml? You’ll also need to disable auth as demonstrated here.

tl;dr Add the following to your circle.yml:

machine:
  pre:
    - sudo sed -i "s|dbms.security.auth_enabled=true|dbms.security.auth_enabled=false|g" /etc/neo4j/neo4j-server.properties
  services:
    - neo4j

Cheers,
Frank


#4