Closed mvuk closed 5 years ago
@mvuk Looking at your gitter comment I solved my issue by making sure to include config.neo4j.session.type = :http config.neo4j.session.url = ENV["DB_URL"] in the application.rb
, looks like you have resolved this. Closing this, feel free to reopen if still facing issue. Thanks.
Overview
When developing locally in development, I have no issues. I have my neo4j.yml file set to the following, where it starts up.
I have another environment, called "demo".
Where things go wrong
The "DB_URL" value that I pass through evaluates to http://neo4j:password@db:7474 which I have set up in the appropriate docker-compose.yml file.
When I am starting up, I wrote a script that when rails initializes that it will run migrations on the database. When my rails application runs to start up, I see the following response in the console:
You will notice that the GET request is pointing to localhost:7474 instead of db:7474. I have even tried not using "db" and configured it to point at other ports (eg. localhost:8320) however it is always evaluating to localhost:7474.
Where things go right
So then I wonder, why doesn't the proper database URL pass through? Once that rake task is run, "rails s" runs to start up the rails server. The server successfully starts, and my application is able to display its home screen! When I look at my "demo.log" file, I see the following:
This means 200 success! You will also notice that it is calling db:7474 and not localhost:7474. So the application itself knows the correct url but when I try to run the task such as "bin/rails neo4j:schema:load[true]" or "rake neo4j:migrate" then it insists on once again only using "localhost:7474" and never the url which I assigned to it.
I can even SSH into that docker container, and then manually run one of these neo4j tasks again, and it will start looking for localhost:7474 again.
I look through my configuration files, and nowhere do I hard code in a "localhost:7474".
So my next logical question is: could it be that the "localhost:7474" is being hard-coded in somewhere? Would that direct me to a solution here?
Runtime information:
Neo4j database version:
neo4j
gem version: 9.5neo4j-core
gem version: