I have a rails app and am using CircleCI for my test suite. I have started to implement neo4j in the app, but have been running into a problem getting it to work in the CI environment. After some amount of time, my neo4j container will just… go away. I have been running my test suite and then re-running it with SSH enabled, and while ssh-ed into the container and running a basic curl command to see if it’s up, after some amount of time, it just stops responding.
I’m using the bitnami neo4j docker image, and provide my docker key/setting below for the circle config. I haven’t been able to correlate the server disappearance to any set amount of time or any specific test or action of the test suite. I also can’t get access to the neo4j container to do any sort of hardcore debugging/logging. If I could get some sort of verbose logging maybe that could help.
I’d really, really appreciate any ideas or suggestions on how to fix or troubleshoot this. If I could somehow get verbose logging or an ssh into the neo4j container that would help me out a lot.
It does seem to be somehow time related, as in, if I run only the neo4j test alone and first it always runs and passes. But, I’ve also seen the neo4j container go away after anywhere between 5 and 12 minutes. It seems to be all over the place.
(the below output has been altered a bit)
circleci@b6db4173f47b:~$ curl localhost:7575
{
"data" : "http:// localhost:7575/db/data/",
"management" : "http:// localhost:7575/db/manage/",
"bolt" : "bolt:// localhost:7687"
}
# Sometime Later....
circleci@b6db4173f47b:~$ curl localhost:7575
curl: (7) Failed to connect to localhost port 7575: Connection refused
Here’s the snippet of my circle/config.yml that I’m using to get neo4j running.
docker:
- image: circleci/ruby:2.4.5-node-browsers
- image: circleci/mariadb:10.2.15
- image: docker.elastic.co/elasticsearch/elasticsearch:6.6.2
- image: circleci/redis
- image: bitnami/neo4j:3.5.7
environment:
NEO4J_PASSWORD: somepassword
NEO4J_HTTP_PORT_NUMBER: 7575
NEO4J_HOST: localhost
Here’s the example failure.
Neo4jNodes::Plan Connections connects and doesn't blow up!
Failure/Error: n_plan = Neo4jNodes::Plan.create(title: "Plan")
Neo4j::Core::CypherSession::ConnectionFailedError:
Faraday::ConnectionFailed: Couldn't connect to server
# ./spec/neo4j_nodes/plan_spec.rb:6:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# Faraday::ConnectionFailed:
# Couldn't connect to server
# ./spec/neo4j_nodes/plan_spec.rb:6:in `block (3 levels) in <top (required)>'
I sometimes see “Job was canceled” in the neo4j output when I go back and look at it, but that’s the only output I get when it goes and fails.